From d77ff13430498e65f5047b3c28affb4f933982e7 Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:01:13 -0700 Subject: [PATCH 01/35] Sync eng/common directory with azure-sdk-tools for PR 17084 (#49460) * Publish complete eval build results directly to Blob * Report sanitized Blob publication failure diagnostics * Opt eval publishing into the AzureStorage network policy * Publish real skill and live eval results to Blob * Enable scoped automatic publication for tools main evals * Remove dedicated synthetic storage smoke mode * Restrict refresh token destinations and make publisher lock portable * Reject noncanonical archive identities and clarify publisher boundaries * Document the production-only dashboard boundary * Convert Blob publisher scripts to TypeScript * Notify the dashboard after publishing evaluation results * Centralize eval publication configuration and simplify pipeline IDs * Simplify eval publication and close validation gaps * Simplify eval result publication and strengthen failure recovery * Use one eval publication opt-in for upload and storage egress * Keep one main-only eval publication switch * Use pipeline configuration and Azure CLI for eval publication * Fix eval publication edge cases and run regressions in PR CI * Configure eval dashboard endpoints through pipeline variables * Remove optional eval publication receipts * Simplify eval bundling and support Node 24 with pnpm --------- Co-authored-by: helen229 --- eng/common/pipelines/live-eval.yml | 9 + eng/common/pipelines/skill-eval.yml | 10 + .../pipelines/templates/jobs/eval-shard.yml | 27 +- .../templates/jobs/eval-summarize.yml | 63 ++- .../templates/stages/archetype-eval.yml | 15 +- .../templates/steps/eval-publish-results.yml | 59 ++ eng/common/pipelines/workflow-eval.yml | 10 + eng/common/scripts/eval/README.md | 169 +++++- eng/common/scripts/eval/build-eval-summary.ts | 98 +++- eng/common/scripts/eval/lib/shard-results.ts | 271 +++++++++ .../scripts/eval/publisher/CHANGELOG.md | 17 + .../eval/publisher/Publish-EvalResults.ps1 | 135 +++++ eng/common/scripts/eval/publisher/bundle.ts | 201 +++++++ .../scripts/eval/publisher/package.json | 17 + .../scripts/eval/publisher/pnpm-lock.yaml | 22 + .../eval/publisher/test/publisher.test.ts | 376 +++++++++++++ .../scripts/eval/test/shard-results.test.ts | 530 ++++++++++++++++++ 17 files changed, 1993 insertions(+), 36 deletions(-) create mode 100644 eng/common/pipelines/templates/steps/eval-publish-results.yml create mode 100644 eng/common/scripts/eval/lib/shard-results.ts create mode 100644 eng/common/scripts/eval/publisher/CHANGELOG.md create mode 100644 eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 create mode 100644 eng/common/scripts/eval/publisher/bundle.ts create mode 100644 eng/common/scripts/eval/publisher/package.json create mode 100644 eng/common/scripts/eval/publisher/pnpm-lock.yaml create mode 100644 eng/common/scripts/eval/publisher/test/publisher.test.ts create mode 100644 eng/common/scripts/eval/test/shard-results.test.ts diff --git a/eng/common/pipelines/live-eval.yml b/eng/common/pipelines/live-eval.yml index e69e48005506..b471748d25e8 100644 --- a/eng/common/pipelines/live-eval.yml +++ b/eng/common/pipelines/live-eval.yml @@ -13,6 +13,12 @@ schedules: - main always: true # run even when main has not changed +parameters: + - name: publishDashboardResults + displayName: 'Publish trusted main results to Blob (includes pipeline-wide Azure Storage egress)' + type: boolean + default: true + variables: # Managed-pool image selection (LINUXPOOL/LINUXVMIMAGE). Repo-local. - template: /eng/pipelines/templates/variables/image.yml @@ -22,6 +28,9 @@ variables: extends: template: /eng/common/pipelines/templates/stages/archetype-eval.yml parameters: + createDashboardBundle: true + # EvalStorageAccountName is configured by the pipeline owner, not in synced YAML. + publishDashboardResults: ${{ parameters.publishDashboardResults }} # Shared mock/live builder; select the live tier (real Cli MCP). mcpSetupTemplate: /eng/common/pipelines/templates/steps/eval-mcp-setup.yml TestType: live diff --git a/eng/common/pipelines/skill-eval.yml b/eng/common/pipelines/skill-eval.yml index 880a9d3eef22..53b467039735 100644 --- a/eng/common/pipelines/skill-eval.yml +++ b/eng/common/pipelines/skill-eval.yml @@ -13,11 +13,18 @@ trigger: - eng/common/pipelines/templates/jobs/** - eng/common/pipelines/templates/steps/eval-invoke.yml - eng/common/pipelines/templates/steps/eval-mcp-setup.yml + - eng/common/pipelines/templates/steps/eval-publish-results.yml - eng/common/pipelines/templates/stages/archetype-eval.yml - eng/common/scripts/eval/** pr: none +parameters: + - name: publishDashboardResults + displayName: 'Publish trusted main results to Blob (includes pipeline-wide Azure Storage egress)' + type: boolean + default: true + variables: # Managed-pool image selection (LINUXPOOL/LINUXVMIMAGE). Repo-local. - template: /eng/pipelines/templates/variables/image.yml @@ -27,6 +34,9 @@ variables: extends: template: /eng/common/pipelines/templates/stages/archetype-eval.yml parameters: + createDashboardBundle: true + # EvalStorageAccountName is configured by the pipeline owner, not in synced YAML. + publishDashboardResults: ${{ parameters.publishDashboardResults }} # Shared mock/live builder; select the mock tier. mcpSetupTemplate: /eng/common/pipelines/templates/steps/eval-mcp-setup.yml TestType: mock diff --git a/eng/common/pipelines/templates/jobs/eval-shard.yml b/eng/common/pipelines/templates/jobs/eval-shard.yml index fc4245111884..155f5c270d86 100644 --- a/eng/common/pipelines/templates/jobs/eval-shard.yml +++ b/eng/common/pipelines/templates/jobs/eval-shard.yml @@ -1,5 +1,5 @@ # Fan-out shard job: one leg per shard runs its evals against the prebuilt MCP and publishes -# per-leg JUnit (always) + transcripts (on failure). Pass/fail is the eval VERDICT, not the +# per-leg raw JSONL + JUnit + completeness (always), and transcripts (on failure). Pass/fail is the eval VERDICT, not the # `vally` exit code (vally can exit 1 on a teardown flake after a pass). parameters: @@ -41,6 +41,8 @@ jobs: # A red shard shouldn't abort its siblings; the rollup gates in Summary. continueOnError: true timeoutInMinutes: ${{ parameters.shardTimeoutInMinutes }} + workspace: + clean: all strategy: matrix: $[ stageDependencies.Prepare.generate_eval_matrix.outputs['detect.matrix'] ] maxParallel: 10 @@ -50,9 +52,9 @@ jobs: # name instead of colliding with the prior attempt's artifact (which fails the rerun). # The Summary job keeps only the highest attempt per shard so retries supersede cleanly. - output: pipelineArtifact - displayName: 'Publish $(shardName) JUnit' + displayName: 'Publish $(shardName) raw results, JUnit and completeness' artifactName: 'eval-result-$(shardName)-$(System.JobAttempt)' - targetPath: $(Build.ArtifactStagingDirectory)/junit + targetPath: $(Build.ArtifactStagingDirectory)/eval-result condition: always() - output: pipelineArtifact displayName: 'Publish $(shardName) transcripts (on failure)' @@ -61,12 +63,13 @@ jobs: condition: failed() steps: - checkout: self + clean: true fetchDepth: 1 - task: UseNode@1 - displayName: 'Use Node.js 22.x' + displayName: 'Use Node.js 24.x' inputs: - version: 22.x + version: 24.x # 1ES Official image blocks registry.npmjs.org; restore via the azure-sdk npm mirror. - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml @@ -122,13 +125,15 @@ jobs: - ${{ if parameters.postEvalTemplate }}: - template: ${{ parameters.postEvalTemplate }} - # JUnit is tiny — stage it always; heavy transcripts stage separately on failure. - # Also create the debug dir here so the failed()-gated debug publish always has a target - # (otherwise the publish errors "Path does not exist" when the dir was never created). + # Preserve exactly the newest invocation, including completed failed evals. + # Even an early failure publishes an incomplete marker; never fall back to stale data. - script: | - mkdir -p "$(Build.ArtifactStagingDirectory)/junit" "$(Build.ArtifactStagingDirectory)/debug" - find "$(Build.SourcesDirectory)/artifacts/vally-results/$(shardName)" -name '*.junit.xml' -exec cp {} "$(Build.ArtifactStagingDirectory)/junit/" \; - displayName: 'Collect $(shardName) JUnit' + mkdir -p "$(Build.ArtifactStagingDirectory)/debug" + node --experimental-strip-types "$(Build.SourcesDirectory)/eng/common/scripts/eval/lib/shard-results.ts" \ + --results-root "$(Build.SourcesDirectory)/artifacts/vally-results/$(shardName)" \ + --output-directory "$(Build.ArtifactStagingDirectory)/eval-result" \ + --shard-name "$(shardName)" --attempt "$(System.JobAttempt)" + displayName: 'Collect $(shardName) result data and completeness' condition: always() # On a real failure keep transcripts; strip JUnit so Summary can't double-count it. diff --git a/eng/common/pipelines/templates/jobs/eval-summarize.yml b/eng/common/pipelines/templates/jobs/eval-summarize.yml index 8d9f49d6c8c8..eddc71c6e908 100644 --- a/eng/common/pipelines/templates/jobs/eval-summarize.yml +++ b/eng/common/pipelines/templates/jobs/eval-summarize.yml @@ -5,41 +5,86 @@ parameters: - name: failOnFailedTests type: boolean default: false + - name: createDashboardBundle + type: boolean + default: false + - name: publishDashboardResults + type: boolean + default: false jobs: - job: Summarize - displayName: 'Publish + gate rollup' + displayName: 'Consolidate, publish + gate results' pool: name: $(LINUXPOOL) image: $(LINUXVMIMAGE) os: linux + workspace: + clean: all + variables: + EvalExpectedMatrix: $[ stageDependencies.Prepare.generate_eval_matrix.outputs['detect.matrix'] ] + templateContext: + outputs: + - output: pipelineArtifact + displayName: 'Retain selected build summary and saved bundle' + artifactName: 'eval-summary-$(System.JobAttempt)' + targetPath: $(Build.ArtifactStagingDirectory)/eval-summary + condition: always() steps: + - checkout: self + clean: true + fetchDepth: 1 + - task: UseNode@1 - displayName: 'Use Node.js 22.x' + displayName: 'Use Node.js 24.x' inputs: - version: 22.x + version: 24.x - # Match *.junit.xml only so stray XML (e.g. a DLL's doc XML) can't fake a shard. + # Allowlist result data only, excluding debug, MCP, SDL and signing artifacts. - task: DownloadPipelineArtifact@2 displayName: 'Download all shard results' inputs: buildType: 'current' - itemPattern: '**/*.junit.xml' + itemPattern: | + eval-result-*/results.jsonl + eval-result-*/shard.json + eval-result-*/**/*.junit.xml targetPath: $(Pipeline.Workspace)/eval-results - # Renders the rollup to the run's Summary tab (##vso[task.uploadsummary]). + # Only attempt verification needs the current build token; rendering uses saved evidence. + - script: | + node --experimental-strip-types "$(Build.SourcesDirectory)/eng/common/scripts/eval/lib/shard-results.ts" \ + --attempts-output "$(Build.ArtifactStagingDirectory)/eval-summary/job-attempts.json" + displayName: 'Verify latest shard job attempts from current build timeline' + condition: always() + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + EVAL_EXPECTED_MATRIX: $(EvalExpectedMatrix) + - script: | node --experimental-strip-types "$(Build.SourcesDirectory)/eng/common/scripts/eval/build-eval-summary.ts" \ --results-root "$(Pipeline.Workspace)/eval-results" \ - --output-path "$(Build.ArtifactStagingDirectory)/eval-summary.md" - displayName: 'Render Markdown rollup' + --selected-root "$(Pipeline.Workspace)/eval-selected" \ + --attempts-file "$(Build.ArtifactStagingDirectory)/eval-summary/job-attempts.json" \ + --output-path "$(Build.ArtifactStagingDirectory)/eval-summary/eval-summary.md" + displayName: 'Select expected latest attempts and render complete-build summary' condition: always() + env: + EVAL_EXPECTED_MATRIX: $(EvalExpectedMatrix) + + - ${{ if or(parameters.createDashboardBundle, parameters.publishDashboardResults) }}: + - template: ../steps/eval-publish-results.yml + parameters: + publishDashboardResults: ${{ parameters.publishDashboardResults }} + # Completed failing evals are useful data: publish BEFORE the evaluation gate. - task: PublishTestResults@2 displayName: 'Publish eval rollup' + condition: succeededOrFailed() inputs: testResultsFormat: 'JUnit' - testResultsFiles: '$(Pipeline.Workspace)/eval-results/**/*.junit.xml' + testResultsFiles: '$(Pipeline.Workspace)/eval-selected/**/*.junit.xml' mergeTestResults: true failTaskOnFailedTests: ${{ parameters.failOnFailedTests }} + failTaskOnMissingResultsFile: true testRunTitle: 'Vally evals' diff --git a/eng/common/pipelines/templates/stages/archetype-eval.yml b/eng/common/pipelines/templates/stages/archetype-eval.yml index 4e29b4c314ce..8ee61d9878cd 100644 --- a/eng/common/pipelines/templates/stages/archetype-eval.yml +++ b/eng/common/pipelines/templates/stages/archetype-eval.yml @@ -62,11 +62,22 @@ parameters: # Per-shard job timeout, passed to the shard job's timeoutInMinutes. Live tier raises it. type: number default: 20 + - name: createDashboardBundle + type: boolean + default: false + # Publication includes the required pipeline-wide AzureStorage egress policy. + - name: publishDashboardResults + type: boolean + default: false extends: # 1es-redirect picks Official (internal) vs Unofficial; its Use1ESOfficial defaults true. template: /eng/pipelines/templates/stages/1es-redirect.yml parameters: + # The checkbox controls compile-time egress; the account variable gates upload at runtime. + # Keep trust policy in YAML, without hardcoding DevOps definition IDs in shared code. + ${{ if and(parameters.publishDashboardResults, eq(variables['System.CollectionUri'], 'https://dev.azure.com/azure-sdk/'), eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Repository.Name'], 'Azure/azure-sdk-tools'), eq(variables['Build.SourceBranch'], 'refs/heads/main'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Schedule', 'Manual')) }}: + AllowAzureStorage: true stages: - stage: Prepare displayName: 'Build MCP' @@ -98,9 +109,11 @@ extends: - stage: Summary displayName: 'Summarize results' - dependsOn: Eval + dependsOn: [Prepare, Eval] condition: always() jobs: - template: /eng/common/pipelines/templates/jobs/eval-summarize.yml parameters: failOnFailedTests: ${{ parameters.failOnFailedTests }} + createDashboardBundle: ${{ parameters.createDashboardBundle }} + publishDashboardResults: ${{ parameters.publishDashboardResults }} diff --git a/eng/common/pipelines/templates/steps/eval-publish-results.yml b/eng/common/pipelines/templates/steps/eval-publish-results.yml new file mode 100644 index 000000000000..00d8c1c869c8 --- /dev/null +++ b/eng/common/pipelines/templates/steps/eval-publish-results.yml @@ -0,0 +1,59 @@ +# Builds a data-only archive, then uses the authenticated Azure CLI to publish it. +parameters: + - name: publishDashboardResults + type: boolean + default: false + +steps: + - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml + parameters: + npmrcPath: $(Build.SourcesDirectory)/.npmrc + CustomCondition: and(succeeded(), eq(variables['EvalSummaryComplete'], 'true')) + + # Bootstrap only the pinned package manager with Node's bundled npm, as specs does. + # Isolate the archive install from any consuming repository's pnpm workspace. + - script: | + set -euo pipefail + npm install --prefix "$(Agent.TempDirectory)/eval-pnpm" --no-save --no-package-lock --ignore-scripts --no-audit --no-fund pnpm@12.6.0 + node "$(Agent.TempDirectory)/eval-pnpm/node_modules/pnpm/bin/pnpm.mjs" --ignore-workspace install --pm-on-fail=ignore --frozen-lockfile --prod --ignore-scripts + displayName: 'Install archive dependency' + workingDirectory: eng/common/scripts/eval/publisher + condition: and(succeeded(), eq(variables['EvalSummaryComplete'], 'true')) + env: + NPM_CONFIG_USERCONFIG: $(Build.SourcesDirectory)/.npmrc + + - script: | + set -euo pipefail + organization="${SYSTEM_COLLECTIONURI%/}" + node --experimental-strip-types "$(Build.SourcesDirectory)/eng/common/scripts/eval/publisher/bundle.ts" \ + --index "$(Pipeline.Workspace)/eval-results/shard-index.json" \ + --summary "$(Build.ArtifactStagingDirectory)/eval-summary/eval-summary.md" \ + --output "$(Build.ArtifactStagingDirectory)/eval-summary/dashboard-bundle.zip" \ + --organization "${organization##*/}" --project "$SYSTEM_TEAMPROJECT" \ + --repository "$BUILD_REPOSITORY_NAME" --pipeline "$BUILD_DEFINITIONNAME" \ + --definition-id "$SYSTEM_DEFINITIONID" --build-id "$BUILD_BUILDID" \ + --attempt "$SYSTEM_JOBATTEMPT" --branch "$BUILD_SOURCEBRANCH" --source-version "$BUILD_SOURCEVERSION" + displayName: 'Prepare one complete build result bundle' + condition: and(succeeded(), eq(variables['EvalSummaryComplete'], 'true')) + + # Pipeline-owned account configuration is a runtime value, not a template parameter. + # Missing configuration skips the task; PRs/foreign repos/non-main never get this task. + - ${{ if and(parameters.publishDashboardResults, eq(variables['System.CollectionUri'], 'https://dev.azure.com/azure-sdk/'), eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Repository.Name'], 'Azure/azure-sdk-tools'), eq(variables['Build.SourceBranch'], 'refs/heads/main'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Schedule', 'Manual')) }}: + - task: AzureCLI@2 + displayName: 'Publish saved build bundle directly to Blob' + condition: and(succeeded(), eq(variables['EvalSummaryComplete'], 'true'), ne(variables['EvalStorageAccountName'], ''), eq(variables['System.CollectionUri'], 'https://dev.azure.com/azure-sdk/'), eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Repository.Name'], 'Azure/azure-sdk-tools'), eq(variables['Build.SourceBranch'], 'refs/heads/main'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Schedule', 'Manual')) + timeoutInMinutes: 20 + env: + EVAL_STORAGE_ACCOUNT_NAME: $(EvalStorageAccountName) + EVAL_DASHBOARD_REFRESH_URL: $(EvalDashboardRefreshUrl) + EVAL_DASHBOARD_RESOURCE: $(EvalDashboardResource) + inputs: + azureSubscription: eval-dashboard-sc + scriptType: pscore + scriptLocation: inlineScript + # Environment mapping passes values literally, without parsing variable contents as code. + inlineScript: | + & "$(Build.SourcesDirectory)/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1" ` + -StorageAccountName $env:EVAL_STORAGE_ACCOUNT_NAME ` + -BundlePath "$(Build.ArtifactStagingDirectory)/eval-summary/dashboard-bundle.zip" ` + -DashboardRefreshUrl $env:EVAL_DASHBOARD_REFRESH_URL -DashboardResource $env:EVAL_DASHBOARD_RESOURCE diff --git a/eng/common/pipelines/workflow-eval.yml b/eng/common/pipelines/workflow-eval.yml index d61b02b65e0a..ac81e5781920 100644 --- a/eng/common/pipelines/workflow-eval.yml +++ b/eng/common/pipelines/workflow-eval.yml @@ -16,11 +16,18 @@ trigger: - eng/common/pipelines/templates/jobs/** - eng/common/pipelines/templates/steps/eval-invoke.yml - eng/common/pipelines/templates/steps/eval-mcp-setup.yml + - eng/common/pipelines/templates/steps/eval-publish-results.yml - eng/common/pipelines/templates/stages/archetype-eval.yml - eng/common/scripts/eval/** pr: none +parameters: + - name: publishDashboardResults + displayName: 'Publish trusted main results to Blob (includes pipeline-wide Azure Storage egress)' + type: boolean + default: true + variables: # Defines LINUXPOOL + LINUXVMIMAGE used by the archetype's jobs. - template: /eng/pipelines/templates/variables/image.yml @@ -30,6 +37,9 @@ variables: extends: template: /eng/common/pipelines/templates/stages/archetype-eval.yml parameters: + createDashboardBundle: true + # EvalStorageAccountName is configured by the pipeline owner, not in synced YAML. + publishDashboardResults: ${{ parameters.publishDashboardResults }} # Shared mock/live builder; select the mock tier. mcpSetupTemplate: /eng/common/pipelines/templates/steps/eval-mcp-setup.yml TestType: mock diff --git a/eng/common/scripts/eval/README.md b/eng/common/scripts/eval/README.md index b934c0f9357a..d760c556bbc7 100644 --- a/eng/common/scripts/eval/README.md +++ b/eng/common/scripts/eval/README.md @@ -7,16 +7,172 @@ the committed `package-lock.json` instead of resolved fresh from semver ranges o It lives under `eng/common` so it syncs to every repo that consumes the shared eval pipeline templates. -- The only dependency should be `@microsoft/vally-cli`, pinned to the version CI should evaluate with. +- This evaluator package's only dependency is `@microsoft/vally-cli`, pinned to the version CI should evaluate with. - `package-lock.json` must be committed so `npm ci` is deterministic. +- Optional Blob publication is isolated in [publisher](publisher/), with + its own pnpm package/lock for **fflate only** and CLI/PowerShell tests. Shard evaluator + restores do not install it; publication adds no Node Azure SDK dependencies. + +## Complete build results and direct Blob publishing + +Shards now retain the newest invocation's raw JSONL, JUnit and a completion marker +via [shard-results](lib/shard-results.ts), including failed evaluations. +Summary checks the full Prepare matrix and selects each expected shard's highest +attempt once for Markdown, the Tests tab and bundling. Missing, interrupted or +corrupt results remain incomplete; later failed attempts never fall back to older +successful artifacts. A separate step reads the current-build timeline with +`System.AccessToken` and three bounded transient retries, saving the latest attempt +evidence beside the summary. Rendering reads that file and needs no token or network. +Unverified or ambiguous attempts cannot authorize publication. The legacy JUnit-only +summary remains supported. No historical build download or reconstruction is involved. +The bundler accepts exactly one already-selected attempt per expected shard; it +does not repeat Summary's selection or accept an ambiguous list of attempts. + +The [publishing step](../../pipelines/templates/steps/eval-publish-results.yml) restores +the archive dependency with **pnpm 12.6.0** from the **default JavaScript feed**, prepares one saved ZIP +and a checksum/identity descriptor, then runs [Publish-EvalResults.ps1](publisher/Publish-EvalResults.ps1) +under `AzureCLI@2` using `eval-dashboard-sc`. The script uses `az storage blob upload`, +not a custom SDK transport. There is no enterprise checkout, dashboard file upload, +evaluator rerun or container creation. Bundle metadata is passed explicitly by YAML; +neither bundling nor upload interprets DevOps environment variables or publishing policy. +Shard/Summary jobs and publisher CI use Node 24; the publisher requires **24.14.1+**, +matching the specs repository. Its frozen `pnpm-lock.yaml` retains the reviewed +SHA512 checksum and no private registry URLs. `--ignore-workspace` prevents a +consumer's workspace from changing the install or pulling in unrelated packages. +The pipeline uses Node's bundled npm only to bootstrap the exact pnpm version into +the agent's temporary directory, with lifecycle scripts disabled. The same +authenticated `.npmrc` is used by both commands; no global tools are changed. +`--pm-on-fail=ignore` avoids pnpm resolving/downloading itself again after that +explicit bootstrap, without changing dependency checks or the frozen lock. + +| Control | Current use | +| --- | --- | +| `publishDashboardResults` | The only checkbox; defaults to `true` in the three tools entrypoints. Set `false` to disable both upload and Azure Storage egress | +| `EvalStorageAccountName` | Pipeline-owner configuration. Upload is skipped when absent; set it to `evaltestsummary` for this dashboard | +| `EvalDashboardRefreshUrl` | Pipeline-owner configuration: `https://azsdk-eval-bue6a7dwanatgpb3.westus3-01.azurewebsites.net/api/refresh` | +| `EvalDashboardResource` | Pipeline-owner configuration: `api://258998df-81ec-460c-bdd7-56a9bdde1e48` (resource URI, not a `/.default` scope) | +| `createDashboardBundle` | Shared-template artifact-only mode; enabled for all three tools entrypoints | + +The pipeline owner must set **`EvalStorageAccountName=evaltestsummary`** and the two +dashboard variables above in each onboarded DevOps pipeline, with **queue-time +override disabled** and edit permissions restricted. These settings are trusted +deployment configuration: the owner must verify the dashboard URL/API pairing. +The task passes values through environment mapping, never by evaluating their contents +as script code. This source change does not configure DevOps or grant +access. The dashboard reads that account's existing `vally-results` container; +publishing to another account does not redirect the reader. Service-connection +authorization, approved branch checks and existing RBAC remain required. + +Publishing policy stays in YAML: organization `https://dev.azure.com/azure-sdk/`, +project `internal`, repository `Azure/azure-sdk-tools`, exact `refs/heads/main`, and +a CI, scheduled or manual reason. There is no hardcoded definition-ID allowlist or +variable template in shared code. Feature branches, other repositories, PRs, pull +refs and public-project runs do not get the credential-bearing task. At runtime it +also requires a complete summary and a configured storage account. + +There is no separate automatic-publication, feature-branch override or network-access +flag. Publication requests the documented +[AzureStorage policy](https://aka.ms/1es/netiso/pipelinetemplates), which +keeps `DefaultDeny, CFSClean, CFSClean2, CFSClean3` and allows Azure Storage egress +for **all processes in that pipeline**, not just one container. It grants no RBAC +access. DevOps pipeline-stored variables are runtime values and cannot select a +compile-time 1ES policy: the checkbox and trusted-run checks select egress, while +the account variable additionally gates upload. An enabled trusted run can therefore +have storage egress even if the account variable is absent, but cannot upload. +Set the checkbox to `false` for artifact-only runs with no added storage egress. +Shared templates still default to no publication. Keep approvals, network restrictions +and existing consumer defaults unchanged. + +These entrypoints run real evaluations and consume model quota; there is no synthetic +pipeline mode. Completed failed evaluations publish before their existing test gate; +missing or incomplete results fail Summary and cannot publish. + +### Archive and retry contract + +For this dashboard, configure account `evaltestsummary`; the container remains `vally-results`. +An archive uses `v1//////dashboard-bundle.zip`. +It contains a schema-v1 manifest, executed plain-eval JSONL trials, Markdown and JUnit, +never debug files, MCP binaries or unrelated workspace contents. Non-executed skips +remain in raw artifacts and JUnit/Markdown; an entirely skipped shard is incomplete. + +Reader limits are **32 MiB ZIP, 128 MiB expanded, 10,000 entries and 100,000 trials**. +Canonical identities, UTC calendar dates, safe entries and counts are validated +before upload. Blob metadata records schema, SHA-256, hashed publisher identity and +the original storage time; Azure RBAC remains the authorization boundary. +Construction checks every required non-empty input, merged byte/trial limits and +the total entry count, including merged JSONL, before creating the ZIP. The final +compressed-size cap is checked afterward. Full ZIP decoding remains in contract +tests rather than reopening the archive in production. JSONL is decoded once and +parsed directly as text, with byte limits on both source and serialized records. + +Uploads use `--auth-mode login --overwrite false --if-none-match '*'` with the **same +saved ZIP**; Azure CLI owns transport retries, without another script/task retry loop. +Request/socket timeouts and the task deadline bound execution. Existing archives must match metadata, +owner, checksum and size. Changed content needs a new Summary attempt, not an overwrite. +The publisher never deletes archives; the dashboard's separate identity stays read-only. +The upload is confirmed and logged before notification. No local publication status +file is written; a failed notification does not change the stored archive or fail upload. + +### Notification and recovery + +Every successful publication attempts to send only `{blobName, sha256}` to +`EvalDashboardRefreshUrl`, using a token for `EvalDashboardResource`. No production +dashboard URL or API ID is hardcoded in the script. The URL must be a canonical +HTTPS App Service address ending exactly in `/api/refresh`, with no credentials, +nondefault port, query or fragment; the resource must be `api://`. +Validation happens before requesting a notification token. Missing or invalid +configuration preserves the uploaded archive, sends no token and warns. +The storage OAuth resource `https://storage.azure.com/` remains a platform constant, +not a deployment destination. For the values above, Azure CLI requests a token for +`api://258998df-81ec-460c-bdd7-56a9bdde1e48`; the dashboard +validates the Entra v2 token's GUID `aud`, not the `api://` resource string. +The application needs `Dashboard.Refresh` permission and the receiver's Easy Auth +client allowlist. Blob permission alone does not grant notification access. + +Signals are bounded to 2 KiB, retry at most four times, honor `Retry-After` and never +follow redirects. Failure is a warning after durable upload. Browser reload/startup +and daily reconciliation recover missed signals without changing source archives. +Do not replace viewer authentication or network restrictions to make a signal succeed. + +### Publisher tests and diagnostics + +With **Node 24.14.1+ and pnpm 12.6.0**, run `pnpm --ignore-workspace install +--pm-on-fail=ignore --frozen-lockfile --prod --ignore-scripts` and +`pnpm --ignore-workspace --pm-on-fail=ignore test` from `publisher`, +then `node --experimental-strip-types --test` from this directory. +Publisher tests require **PowerShell 7.4+ and +Pester 5**; pipeline upload uses the agent's authenticated Azure CLI. The existing +common-tests PR pipeline runs all shared/archive Node tests and discovers the tagged +PowerShell suite under `eng/common-tests/eval`; failures fail the CI job. +CI restores only the locked archive dependency, not the Vally evaluator. +Regression coverage includes the actual HTTP +cmdlet against loopback, invalid collision metadata, upload-before-notification +ordering and publication without local status files. +Construction regressions exercise the exact entry/trial boundaries, aggregate +expanded bytes, final compressed bytes, required inputs and UTF-8 JSONL limits. +The loopback fixture selects the first Node application when CI has multiple Node +installations on `PATH`. Configuration tests use synthetic hosts/resources and +prove invalid targets cannot request or receive notification tokens. +Tests use synthetic fixtures and fake Azure transports; +they do not evaluate models or contact production services. A real-run test remains +separate from local checks and should use an already approved evaluation run. + +The task logs the stored Blob name and notification outcome. Failures include a +bounded operation/error code, never raw Azure responses, tokens or result contents. +Token acquisition failures require checking the +service connection; Blob 403 requires checking its data-role scope; network failures +require checking approved egress. Preserve the original archive for conflicts, and +retry the signal or the same saved bytes for outages. Never substitute account keys, +relax TLS or broaden permissions to hide a failed request. ## TypeScript (no build step) The `*.ts` sources run directly through Node's native type stripping (erasable syntax only — -no `enum`/`namespace`/parameter properties, no emit). CI pins Node `22.x`, which strips types -unflagged on `>=22.18`; the pipeline `node` invocations and the `npm test` script pass -`--experimental-strip-types` so the same sources also run on older local Node (`>=22.6`), which -prints a harmless `ExperimentalWarning`. Relative imports use explicit `.ts` specifiers, as Node requires. +no `enum`/`namespace`/parameter properties, no emit). Shard/Summary jobs and publisher +CI use Node `24.x`; the publisher requires `>=24.14.1`. The older dependency-free +glue still supports its declared Node 22 minimum, but that is not the publisher's +runtime requirement. Relative imports use explicit `.ts` specifiers, as Node requires. +The standalone Blob publisher uses the same execution model; it adds no compiler or TypeScript runtime dependency. ## Vendored files @@ -45,6 +201,7 @@ cd ../../../.. ./eng/common/scripts/eval/node_modules/.bin/vally lint . ``` -This matches the CI job step-for-step, so a green local run on the current lockfile means a green CI run. +This uses the same locked CLI as CI. A passing local run does not validate the +agent's credentials, network access, artifact permissions or live-service behavior. A global install (`npm install -g @microsoft/vally-cli@`) still works for ad-hoc iteration, but it won't match the transitive dependency tree CI uses and isn't a substitute for the steps above when validating a version bump. diff --git a/eng/common/scripts/eval/build-eval-summary.ts b/eng/common/scripts/eval/build-eval-summary.ts index c270821e6375..fb738b8f554a 100644 --- a/eng/common/scripts/eval/build-eval-summary.ts +++ b/eng/common/scripts/eval/build-eval-summary.ts @@ -6,6 +6,7 @@ import fs from "node:fs"; import path from "node:path"; import { pathToFileURL } from "node:url"; import { globFiles } from "./lib/glob.ts"; +import { expectedShardsFromMatrix, selectSummaryResults } from "./lib/shard-results.ts"; // Maps a JUnit file path back to its shard and job attempt. Result artifacts download into // folders named `eval-result--` (the attempt suffix keeps "Rerun failed @@ -194,7 +195,7 @@ export function getEvalSummary(resultsRoot) { * @param {Record} shards Output of getEvalSummary. * @returns {string} Markdown. */ -export function formatEvalSummaryMarkdown(shards) { +export function formatEvalSummaryMarkdown(shards, incompleteShards = []) { const all = Object.values(shards); const shardCount = all.length; @@ -213,7 +214,10 @@ export function formatEvalSummaryMarkdown(shards) { // A run that parsed zero testcases is NOT a pass — surface it as a loud NO RESULTS state. let overall; let overallIcon; - if (totalTests === 0) { + if (incompleteShards.length) { + overall = "INCOMPLETE"; + overallIcon = "⚠️"; + } else if (totalTests === 0) { overall = "NO RESULTS"; overallIcon = "⚠️"; } else if (totalFailed === 0) { @@ -231,6 +235,13 @@ export function formatEvalSummaryMarkdown(shards) { lines.push(`## ${overallIcon} Vally eval results — ${overall}`); lines.push(""); + if (incompleteShards.length) { + lines.push("> Some expected shards are missing or incomplete. The available results below are **not** a complete build result; no dashboard bundle will be uploaded."); + lines.push(""); + for (const shard of incompleteShards) lines.push(`- **${shard.shard}**: ${shard.reason}`); + lines.push(""); + } + if (totalTests === 0) { lines.push(`No scenarios were found across ${shardCount} shard(s).`); lines.push(""); @@ -313,16 +324,27 @@ export function formatEvalSummaryMarkdown(shards) { function parseArgs(argv) { const options = { outputPath: "eval-summary.md" }; for (let i = 0; i < argv.length; i++) { - const next = () => argv[++i]; - switch (argv[i]) { + const arg = argv[i]; + const next = () => { + const value = argv[++i]; + if (!value || value.startsWith("--")) throw new Error(`Missing value for ${arg}`); + return value; + }; + switch (arg) { case "--results-root": options.resultsRoot = next(); break; case "--output-path": options.outputPath = next(); break; + case "--selected-root": + options.selectedRoot = next(); + break; + case "--attempts-file": + options.attemptsFile = next(); + break; default: - throw new Error(`Unknown argument: ${argv[i]}`); + throw new Error(`Unknown argument: ${arg}`); } } if (!options.resultsRoot) { @@ -331,25 +353,83 @@ function parseArgs(argv) { return options; } -function main(argv) { +async function main(argv) { const options = parseArgs(argv); - const shards = getEvalSummary(options.resultsRoot); - const markdown = formatEvalSummaryMarkdown(shards); + fs.mkdirSync(path.dirname(path.resolve(options.outputPath)), { recursive: true }); + fs.mkdirSync(options.resultsRoot, { recursive: true }); + let selection = null; + if (options.selectedRoot) { + let expectedShards = []; + let matrixValid = true; + try { + expectedShards = expectedShardsFromMatrix(process.env.EVAL_EXPECTED_MATRIX); + } catch { + matrixValid = false; + } + // Even a failed Prepare must use an empty destination, not stale selected results. + let jobAttempts = { schemaVersion: 1, valid: false, attempts: {} }; + if (matrixValid && options.attemptsFile) { + try { + const stat = fs.lstatSync(options.attemptsFile); + if (!stat.isFile() || stat.size > 2 * 1024 * 1024) throw new Error("Invalid attempt evidence."); + jobAttempts = JSON.parse(fs.readFileSync(options.attemptsFile, "utf8")); + } + catch { + console.warn("##vso[task.logissue type=warning]Latest shard attempts could not be verified; Summary will retain diagnostics but refuse publication."); + } + } + selection = selectSummaryResults({ resultsRoot: options.resultsRoot, + selectedRoot: options.selectedRoot, expectedShards, jobAttempts }); + if (!matrixValid) { + selection.status.push({ shard: "Prepare", attempt: null, complete: false, + reason: "The expected shard matrix is unavailable or invalid; check the Prepare stage." }); + } + } + const shards = getEvalSummary(options.selectedRoot ?? options.resultsRoot); + if (selection) { + for (const entry of selection.status) { + if (entry.complete && !shards[entry.shard]?.total) { + entry.complete = false; + entry.reason = "The selected JUnit contains no evaluation testcases."; + } + } + selection.complete = selection.status.every((entry) => entry.complete); + selection.shardInput.complete = selection.complete; + fs.writeFileSync(path.join(options.resultsRoot, "shard-index.json"), JSON.stringify(selection.shardInput, null, 2) + "\n"); + } + let markdown = formatEvalSummaryMarkdown(shards, selection?.status.filter((entry) => !entry.complete) ?? []); + if (selection) { + markdown += "\n### Selected shard attempts\n\n| Shard | Attempt | Result data |\n| --- | ---: | --- |\n"; + for (const entry of selection.status) markdown += `| ${entry.shard} | ${entry.attempt ?? "—"} | ${entry.complete ? "Complete" : "Incomplete"} |\n`; + fs.writeFileSync(path.join(path.dirname(options.outputPath), "eval-summary.json"), JSON.stringify({ + schemaVersion: 1, complete: selection.complete, shards: selection.status, + totals: Object.values(shards).reduce((totals, shard) => ({ scenarios: totals.scenarios + shard.total, + failed: totals.failed + shard.failed, skipped: totals.skipped + shard.skipped }), { scenarios: 0, failed: 0, skipped: 0 }), + }, null, 2) + "\n"); + } fs.writeFileSync(options.outputPath, markdown, "utf8"); console.log(markdown); if (process.env.TF_BUILD) { console.log(`##vso[task.uploadsummary]${path.resolve(options.outputPath)}`); + if (selection) console.log(`##vso[task.setvariable variable=EvalSummaryComplete]${selection.complete}`); } + // Completed evaluation failures remain governed by failOnFailedTests. Missing result + // data is an infrastructure failure, reported after retaining a diagnostic summary. + if (selection && !selection.complete) process.exitCode = 1; + return shards; } if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { try { - main(process.argv.slice(2)); + await main(process.argv.slice(2)); } catch (error) { + if (process.env.TF_BUILD && process.argv.includes("--selected-root")) { + console.log("##vso[task.setvariable variable=EvalSummaryComplete]false"); + } console.error(error.message); process.exit(1); } diff --git a/eng/common/scripts/eval/lib/shard-results.ts b/eng/common/scripts/eval/lib/shard-results.ts new file mode 100644 index 000000000000..c38925562c4d --- /dev/null +++ b/eng/common/scripts/eval/lib/shard-results.ts @@ -0,0 +1,271 @@ +// Dependency-free artifact staging/selection shared by eval pipeline consumers. +// Publish an incomplete marker even when an invocation fails before producing results; +// a later incomplete attempt must never fall back to an older successful attempt. +import fs from "node:fs"; +import path from "node:path"; +import { setTimeout as delay } from "node:timers/promises"; +import { parseArgs } from "node:util"; +import { pathToFileURL } from "node:url"; +import { globFiles } from "./glob.ts"; + +// No individual result can exceed the bundle's expanded-size ceiling. Check before +// copying/reading whole files; completion metadata should never approach this size. +const MAX_RESULT_BYTES = 128 * 1024 * 1024; +const MAX_METADATA_BYTES = 64 * 1024; +const MISSING_RESULTS = "The invocation is missing trials, JUnit, or its final run-summary."; + +function validShard(name) { + return typeof name === "string" && /^[A-Za-z0-9_][A-Za-z0-9_-]{0,199}$/.test(name); +} + +export function expectedShardsFromMatrix(value) { + const matrix = typeof value === "string" ? JSON.parse(value) : value; + if (!matrix || typeof matrix !== "object" || Array.isArray(matrix)) { + throw new Error("The Prepare stage's eval matrix is required to check result completeness."); + } + const names = Object.values(matrix).map((entry) => entry?.shardName); + if (!names.length || names.some((name) => !validShard(name)) || new Set(names).size !== names.length) { + throw new Error("The eval matrix must contain unique, non-empty shard names."); + } + return names.sort(); +} + +// The artifact list cannot reveal a newer retry that lost its agent before publishing. +export function latestShardAttempts(timeline, matrix) { + expectedShardsFromMatrix(matrix); + if (!Array.isArray(timeline?.records)) throw new Error("The current build timeline is required."); + const attempts = {}; + for (const [key, entry] of Object.entries(matrix)) { + if (!validShard(key)) throw new Error("Invalid matrix leg identity."); + const jobs = timeline.records.filter(record => record?.type === "Job" && record.identifier === `Eval.RunShard.${key}`); + for (const record of jobs) { + if (!Number.isSafeInteger(record.attempt) || record.attempt < 1) throw new Error("Invalid timeline attempt."); + const current = { attempt: record.attempt, complete: record.state === "completed" && + ["succeeded", "succeededWithIssues", "failed"].includes(record.result) }; + const previous = attempts[entry.shardName]; + if (previous?.attempt === current.attempt && previous.complete !== current.complete) throw new Error("Ambiguous timeline attempt."); + if (!previous || previous.attempt < current.attempt) attempts[entry.shardName] = current; + } + if (!attempts[entry.shardName]) throw new Error("An expected matrix job is missing from the current build timeline."); + } + return { schemaVersion: 1, valid: true, attempts }; +} + +export async function readShardAttempts(env, { fetchImpl = fetch, wait = delay } = {}) { + const base = new URL(env.SYSTEM_COLLECTIONURI), matrix = JSON.parse(env.EVAL_EXPECTED_MATRIX); + expectedShardsFromMatrix(matrix); + if (base.protocol !== "https:" || base.hostname !== "dev.azure.com" || base.port || base.username || base.password || base.search || base.hash || + !/^\/[a-z0-9][a-z0-9-]{0,99}\/$/i.test(base.pathname) || !env.SYSTEM_ACCESSTOKEN || + !/^[a-f0-9-]{36}$/i.test(env.SYSTEM_TEAMPROJECTID ?? "") || !/^[1-9][0-9]*$/.test(env.BUILD_BUILDID ?? "")) { + throw new Error("Current build identity/token missing."); + } + const url = new URL(`${env.SYSTEM_TEAMPROJECTID}/_apis/build/builds/${env.BUILD_BUILDID}/timeline?api-version=7.1`, base); + for (let attempt = 0; attempt < 3; attempt++) { + let response; + try { + response = await fetchImpl(url, { headers: { authorization: `Bearer ${env.SYSTEM_ACCESSTOKEN}` }, + redirect: "error", signal: AbortSignal.timeout(30_000) }); + if (!response.ok) throw new Error("Timeline could not be read."); + return latestShardAttempts(await response.json(), matrix); + } catch (error) { + if ((response && ![408, 429, 500, 502, 503, 504].includes(response.status)) || attempt === 2) throw error; + } finally { await response?.body?.cancel().catch(() => {}); } + const header = response?.headers?.get("retry-after"), seconds = Number(header); + const milliseconds = header && Number.isFinite(seconds) ? seconds * 1000 : header ? Date.parse(header) - Date.now() : NaN; + await wait(Math.min(30_000, Math.max(0, Number.isFinite(milliseconds) ? milliseconds : 1000 * 2 ** attempt))); + } +} + +function emptyDirectory(directory) { + fs.mkdirSync(directory, { recursive: true }); + if (!fs.lstatSync(directory).isDirectory() || fs.readdirSync(directory).length) { + throw new Error(`Output directory must be empty and not a symbolic link: ${directory}`); + } +} + +function checkResultFile(file, limit = MAX_RESULT_BYTES) { + const stat = fs.lstatSync(file); + if (!stat.isFile() || stat.size > limit) { + throw new Error("Result files must be regular files within the size limit."); + } +} + +function readResultFile(file, limit = MAX_RESULT_BYTES) { + checkResultFile(file, limit); + return fs.readFileSync(file, "utf8"); +} + +function copyResultFile(source, destination) { + checkResultFile(source); + fs.copyFileSync(source, destination, fs.constants.COPYFILE_EXCL); +} + +function inspectInvocation(file) { + const result = { complete: false, trials: 0, reason: MISSING_RESULTS }; + try { + let summary; + // Iterate lines without allocating an array proportional to the newline count. + for (const [line] of readResultFile(file).matchAll(/[^\n]+/g)) { + if (!line.trim()) continue; + const record = JSON.parse(line); + if (!record || typeof record !== "object" || Array.isArray(record)) { + throw new Error("Invalid JSONL record."); + } + if (record.type === "run-summary") summary = record; + else if ((record.type === undefined || record.type === "trial-result") && ["success", "error"].includes(record.status)) { + result.trials++; + summary = undefined; + } + } + result.complete = Boolean(result.trials && Array.isArray(summary?.evals) && summary.evals.length); + result.reason = result.complete ? null : MISSING_RESULTS; + } catch { + // Do not log JSON.parse errors: they can include raw evaluation content. + result.reason = "The invocation contains incomplete, invalid, unreadable, or oversized JSONL."; + } + return result; +} + +export function stageShardResults({ resultsRoot, outputDirectory, shardName, attempt }) { + if (!validShard(shardName) || !Number.isSafeInteger(attempt) || attempt < 1) { + throw new Error("A valid shard name and positive job attempt are required."); + } + emptyDirectory(outputDirectory); + fs.mkdirSync(path.join(outputDirectory, "junit")); + const metadata = { + schemaVersion: 1, shard: shardName, attempt, complete: false, trials: 0, + reason: "No results.jsonl was produced.", + }; + const marker = path.join(outputDirectory, "shard.json"); + fs.writeFileSync(marker, JSON.stringify(metadata, null, 2) + "\n"); + try { + // Match lib/verdict.ts exactly: globFiles sorts paths, and the last path wins + // an mtime tie. localeCompare sorting would choose a different invocation. + let source; + let newest = -Infinity; + for (const file of globFiles(resultsRoot, "**/results.jsonl")) { + const mtime = fs.statSync(file).mtimeMs; + if (mtime >= newest) { + newest = mtime; + source = file; + } + } + if (source) { + const junit = globFiles(path.dirname(source), "**/*.junit.xml"); + let junitComplete = junit.length > 0; + for (const [index, file] of junit.entries()) { + try { + copyResultFile(file, path.join(outputDirectory, "junit", `${index}.junit.xml`)); + } catch { + junitComplete = false; + } + } + const stagedResults = path.join(outputDirectory, "results.jsonl"); + copyResultFile(source, stagedResults); + // Inspect the staged snapshot, not a source file that could still change. + Object.assign(metadata, inspectInvocation(stagedResults)); + if (!junitComplete) { + metadata.complete = false; + metadata.reason ??= MISSING_RESULTS; + } + } + } catch { + metadata.complete = false; + metadata.reason = "The invocation contains unreadable or oversized result files."; + } + fs.writeFileSync(marker, JSON.stringify(metadata, null, 2) + "\n"); + return metadata; +} + +export function selectSummaryResults({ resultsRoot, selectedRoot, expectedShards, jobAttempts }) { + if (!Array.isArray(expectedShards) || expectedShards.some((name) => !validShard(name)) || + new Set(expectedShards).size !== expectedShards.length) { + throw new Error("Expected shards must be unique, valid shard names from Prepare."); + } + emptyDirectory(selectedRoot); + const expected = new Set(expectedShards); + const selected = new Map(); + const seen = new Set(); + for (const entry of fs.readdirSync(resultsRoot, { withFileTypes: true })) { + const match = /^eval-result-(.+)-(\d+)$/.exec(entry.name); + if (!match || !expected.has(match[1])) continue; + if (!entry.isDirectory()) throw new Error("Shard artifact paths must be directories, not files or symbolic links."); + const attempt = Number(match[2]); + if (!Number.isSafeInteger(attempt) || attempt < 1) throw new Error("Invalid shard artifact attempt."); + const identity = `${match[1]}:${attempt}`; + if (seen.has(identity)) throw new Error(`Duplicate artifact attempt for ${match[1]}.`); + seen.add(identity); + const previous = selected.get(match[1]); + if (!previous || previous.attempt < attempt) { + selected.set(match[1], { shard: match[1], attempt, directory: entry.name }); + } + } + const status = []; + for (const shard of expectedShards) { + const selectedAttempt = selected.get(shard); + if (!selectedAttempt) { + status.push({ shard, attempt: null, complete: false, reason: "No artifact was published." }); + continue; + } + const directory = path.join(resultsRoot, selectedAttempt.directory); + const junit = globFiles(directory, "junit/*.junit.xml"); + let complete = false; + let reason = "The artifact is missing valid completion metadata or result files."; + try { + const metadata = JSON.parse(readResultFile(path.join(directory, "shard.json"), MAX_METADATA_BYTES)); + complete = metadata.schemaVersion === 1 && metadata.shard === shard && metadata.attempt === selectedAttempt.attempt && + metadata.complete === true && Number.isSafeInteger(metadata.trials) && metadata.trials > 0 && junit.length > 0; + if (complete) { + const invocation = inspectInvocation(path.join(directory, "results.jsonl")); + complete = invocation.complete && invocation.trials === metadata.trials; + } + if (!complete && metadata.complete === false) reason = "The latest shard attempt did not produce a complete invocation."; + } catch { /* Retain available JUnit below, but do not adopt an incomplete artifact for upload. */ } + if (jobAttempts?.valid !== true || jobAttempts.schemaVersion !== 1 || + jobAttempts.attempts?.[shard]?.attempt !== selectedAttempt.attempt || jobAttempts.attempts[shard].complete !== true) { + complete = false; + reason = "The latest timeline job attempt has no matching complete artifact, or its status could not be verified."; + } + // The Tests tab and Markdown use the SAME selected attempts as the bundle. + // Old-layout JUnit remains diagnostic; old artifacts are never upload-ready. + const files = junit.length ? junit : globFiles(directory, "**/*.junit.xml"); + const output = path.join(selectedRoot, selectedAttempt.directory, "junit"); + fs.mkdirSync(output, { recursive: true }); + for (const [index, file] of files.entries()) { + try { + copyResultFile(file, path.join(output, `${index}.junit.xml`)); + } catch { + complete = false; + reason = "The selected JUnit result files are unreadable or exceed the size limit."; + } + } + status.push({ shard, attempt: selectedAttempt.attempt, complete, reason: complete ? null : reason }); + } + const complete = status.length > 0 && status.every((entry) => entry.complete); + const shardInput = { + schemaVersion: 1, complete, expectedShards, + attempts: [...selected.values()].sort((a, b) => a.shard.localeCompare(b.shard)), + }; + fs.writeFileSync(path.join(resultsRoot, "shard-index.json"), JSON.stringify(shardInput, null, 2) + "\n"); + return { complete, status, shardInput }; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + try { + const { values } = parseArgs({ options: { "results-root": { type: "string" }, "output-directory": { type: "string" }, + "shard-name": { type: "string" }, attempt: { type: "string" }, "attempts-output": { type: "string" } } }); + if (values["attempts-output"]) { + let result = { schemaVersion: 1, valid: false, attempts: {} }; + try { result = await readShardAttempts(process.env); } + catch { console.log("##vso[task.logissue type=warning]Current build attempts could not be verified; no complete bundle will be published."); } + fs.mkdirSync(path.dirname(path.resolve(values["attempts-output"])), { recursive: true }); + fs.writeFileSync(values["attempts-output"], JSON.stringify(result, null, 2) + "\n"); + } else { + if (!values["results-root"] || !values["output-directory"]) throw new Error("Results and output directories are required."); + const result = stageShardResults({ resultsRoot: values["results-root"], outputDirectory: values["output-directory"], + shardName: values["shard-name"], attempt: Number(values.attempt) }); + console.log(`Staged ${result.shard} attempt ${result.attempt}: ${result.trials} trials; ${result.complete ? "complete" : "incomplete"}.`); + if (!result.complete) console.log(`##vso[task.logissue type=warning]${result.reason}`); + } + } catch (error) { console.error(error.message); process.exitCode = 1; } +} \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/CHANGELOG.md b/eng/common/scripts/eval/publisher/CHANGELOG.md new file mode 100644 index 000000000000..60fbc50525a8 --- /dev/null +++ b/eng/common/scripts/eval/publisher/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +## Unreleased + +- Retain one complete, latest-attempt evaluation archive per build in Blob storage. +- Use authenticated Azure CLI publication instead of a custom Node Azure SDK transport. +- Read the storage account from pipeline-owned configuration and keep publishing policy in YAML. +- Pass archive identity explicitly and isolate token-bearing timeline verification from summary rendering. +- Preserve create-only uploads, checksum/provenance metadata and authenticated notification recovery. +- Run shared/archive Node tests and tagged publisher PowerShell tests in the existing Windows/Linux PR CI job, without evaluations. +- Treat real redirect exceptions as permanent and reject noncanonical collision timestamps. +- Read the dashboard refresh URL and Entra API resource from protected pipeline variables, validating both before acquiring notification credentials. +- Preserve uploaded archives when notification configuration is missing or invalid, and handle multiple Node installations in hosted CI regression tests. +- Remove optional local publication status files; log confirmed uploads before attempting warning-only dashboard notifications. +- Use Node 24.14.1+ and pinned pnpm 12.6.0 for the publisher, with a portable SHA512 lock and frozen installs isolated from consuming workspaces. +- Enforce required entries and byte/trial/entry budgets during construction, including merged JSONL, instead of decoding the new ZIP again. +- Validate exactly one Summary-selected attempt per expected shard and parse JSONL strings directly without repeated Buffer conversions. \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 b/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 new file mode 100644 index 000000000000..a68588d08c44 --- /dev/null +++ b/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 @@ -0,0 +1,135 @@ +# Uploads one saved archive with Azure CLI, then signals the dashboard without local status files. +#requires -Version 7.4 +[CmdletBinding()] +param( + [Parameter(Mandatory)] [ValidatePattern('^[a-z0-9]{3,24}$')] [string] $StorageAccountName, + [Parameter(Mandatory)] [string] $BundlePath, + [string] $DashboardRefreshUrl = '', + [string] $DashboardResource = '' +) + +Set-StrictMode -Version 4 +$ErrorActionPreference = 'Stop' + +function Invoke-AzJson([string[]] $Arguments) { + # Capture all CLI output, especially tokens and errors; never echo raw Azure responses. + $output = az @Arguments --only-show-errors --output json 2>&1 + if ($LASTEXITCODE -ne 0) { throw 'Azure CLI operation failed.' } + # ConvertFrom-Json auto-converts ISO strings into dates on some PowerShell versions. + # Keep Blob metadata strings exact, including their required UTC Z suffix. + $document = [System.Text.Json.JsonDocument]::Parse($output -join "`n") + try { return $document.RootElement.Clone() } finally { $document.Dispose() } +} + +$operation = 'validate_inputs' +$failureCode = 'invalid_bundle' +$stored = $false +try { + $BundlePath = [System.IO.Path]::GetFullPath($BundlePath) + $archive = Get-Item -LiteralPath $BundlePath + $descriptor = Get-Item -LiteralPath "$BundlePath.json" + if ($archive.PSIsContainer -or $archive.LinkType -or $archive.Length -le 0 -or $archive.Length -gt 32MB -or + $descriptor.PSIsContainer -or $descriptor.LinkType -or $descriptor.Length -gt 64KB) { throw 'Invalid saved archive.' } + $prepared = Get-Content -LiteralPath $descriptor.FullName -Raw | ConvertFrom-Json -AsHashtable + $hash = (Get-FileHash -LiteralPath $BundlePath -Algorithm SHA256).Hash.ToLowerInvariant() + $name = [string] $prepared.blobName + if ($prepared.bytes -ne $archive.Length -or $prepared.sha256 -cne $hash -or $name.Length -gt 800 -or + $name -cnotmatch '^v1/[a-z0-9][a-z0-9-]{0,99}/(?:[a-z0-9_.~-]|%[0-9A-F]{2})+/[1-9][0-9]{0,19}/[1-9][0-9]{0,19}/[1-9][0-9]*/dashboard-bundle\.zip$') { + throw 'Archive identity or checksum differs from its preparation descriptor.' + } + + # Deployment values belong to protected pipeline configuration, not queue-time input. + # Never acquire a notification token for a noncanonical or non-App-Service destination. + $refreshUri = $null + $notificationValid = $DashboardRefreshUrl.Length -le 2048 -and + [Uri]::TryCreate($DashboardRefreshUrl, [UriKind]::Absolute, [ref]$refreshUri) -and + $refreshUri.Scheme -ceq 'https' -and $refreshUri.IsDefaultPort -and + $refreshUri.Host -match '^[a-z0-9][a-z0-9.-]*\.azurewebsites\.net$' -and + !$refreshUri.UserInfo -and !$refreshUri.Query -and !$refreshUri.Fragment -and + $refreshUri.AbsolutePath -ceq '/api/refresh' -and $refreshUri.AbsoluteUri -ceq $DashboardRefreshUrl -and + $DashboardResource -cmatch '^api://[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}\z' + + $operation = 'acquire_storage_identity' + $failureCode = 'storage_identity' + $token = (Invoke-AzJson -Arguments @('account', 'get-access-token', '--resource', 'https://storage.azure.com/')).GetProperty('accessToken').GetString() + $payload = $token.Split('.')[1].Replace('-', '+').Replace('_', '/') + $claims = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($payload.PadRight([int]([Math]::Ceiling($payload.Length / 4) * 4), '='))) | ConvertFrom-Json -AsHashtable + foreach ($key in @('tid', 'oid')) { + if ($claims[$key] -notmatch '^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$') { throw 'Invalid publisher identity.' } + } + $owner = [Convert]::ToHexString([System.Security.Cryptography.SHA256]::HashData([System.Text.Encoding]::UTF8.GetBytes("$($claims.tid):$($claims.oid)"))).ToLowerInvariant() + $storedAt = [DateTime]::UtcNow.ToString('o') + $storage = @('--account-name', $StorageAccountName, '--container-name', 'vally-results', '--name', $name, '--auth-mode', 'login') + + $operation = 'publish_blob' + $failureCode = 'publication_failed' + $duplicate = $false + try { + # CLI owns transport retries. Never overwrite, rebuild the ZIP, or create a container. + Invoke-AzJson -Arguments (@('storage', 'blob', 'upload') + $storage + @('--file', $BundlePath, + '--type', 'block', '--overwrite', 'false', '--if-none-match', '*', '--content-type', 'application/zip', + '--metadata', 'schema=1', "sha256=$hash", "publisher=$owner", "storedat=$storedAt", '--timeout', '30', '--socket-timeout', '30')) | Out-Null + } catch { + # Also covers a lost success response: adopt only the same already-stored archive. + $operation = 'verify_existing_blob' + $saved = Invoke-AzJson -Arguments (@('storage', 'blob', 'show') + $storage + @('--timeout', '30')) + $failureCode = 'submission_conflict' + $metadata = $saved.GetProperty('metadata') + $savedTime = $metadata.GetProperty('storedat').GetString() + $parsedTime = [DateTimeOffset]::MinValue + # Accept canonical UTC time only; .NET's loose parser otherwise admits spaces + # that the dashboard rejects. Truncate fractions to the reader's millisecond precision. + $validTime = $savedTime -cmatch '^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?Z\z' -and + [DateTimeOffset]::TryParse(($savedTime -replace '(\.\d{3})\d+(?=Z\z)', '$1'), [Globalization.CultureInfo]::InvariantCulture, [Globalization.DateTimeStyles]::None, [ref]$parsedTime) -and + $parsedTime.UtcDateTime.ToString('yyyy-MM-dd') -ceq $savedTime.Substring(0, 10) + if ($saved.GetProperty('properties').GetProperty('contentLength').GetInt64() -ne $archive.Length -or $metadata.GetProperty('schema').GetString() -cne '1' -or + $metadata.GetProperty('sha256').GetString() -cne $hash -or $metadata.GetProperty('publisher').GetString() -cne $owner -or !$validTime) { throw 'Conflicting archive.' } + $duplicate = $true + } + + $stored = $true + Write-Host "Result archive stored: $name (duplicate: $duplicate)." + + $body = @{ blobName = $name; sha256 = $hash } | ConvertTo-Json -Compress + if ([System.Text.Encoding]::UTF8.GetByteCount($body) -gt 2048) { throw 'Invalid refresh signal.' } + $notificationSucceeded = $false + for ($attempt = 0; $notificationValid -and $attempt -lt 4; $attempt++) { + $status = 0; $headers = @{} + try { + $token = (Invoke-AzJson -Arguments @('account', 'get-access-token', '--resource', $DashboardResource)).GetProperty('accessToken').GetString() + $response = Invoke-WebRequest -Uri $refreshUri ` + -Method Post -ContentType 'application/json' -Body $body -Headers @{ Authorization = "Bearer $token" } ` + -MaximumRedirection 0 -TimeoutSec 180 -OperationTimeoutSeconds 180 -SkipHttpErrorCheck + $status = [int]$response.StatusCode; $headers = $response.Headers + if ($status -eq 200) { + $report = $response.Content | ConvertFrom-Json -AsHashtable + if ($report.status -eq 'succeeded' -and $report.failureCount -eq 0) { + $notificationSucceeded = $true; break + } + } + } catch { + # Redirect errors can throw even with SkipHttpErrorCheck. Never retry/follow them. + if ($_.FullyQualifiedErrorId.Split(',')[0] -eq 'MaximumRedirectExceeded') { $status = 302 } + elseif ($_.Exception.PSObject.Properties['Response'] -and $_.Exception.Response) { $status = [int]$_.Exception.Response.StatusCode } + } + if (($status -ne 0 -and $status -ne 200 -and $status -notin @(408, 429, 500, 502, 503, 504)) -or $attempt -eq 3) { break } + $seconds = [Math]::Pow(2, $attempt) + if ($headers['Retry-After']) { + $value = [string]($headers['Retry-After'] | Select-Object -First 1) + $retryDate = [DateTimeOffset]::MinValue; $retrySeconds = 0.0 + if ([double]::TryParse($value, [ref]$retrySeconds) -and [double]::IsFinite($retrySeconds)) { $seconds = $retrySeconds } + elseif ([DateTimeOffset]::TryParse($value, [ref]$retryDate)) { $seconds = ($retryDate - [DateTimeOffset]::UtcNow).TotalSeconds } + } + Start-Sleep -Milliseconds ([int]([Math]::Clamp($seconds, 0, 60) * 1000)) + } + if (!$notificationValid) { Write-Warning 'Archive stored; dashboard notification configuration is missing or invalid. Reload/startup/daily reconciliation can recover it.' } + elseif (!$notificationSucceeded) { Write-Warning 'Archive stored; dashboard refresh failed. Reload/startup/daily reconciliation can recover it.' } + else { Write-Host 'Dashboard refresh succeeded.' } +} catch { + # Raw CLI output and exceptions can contain tokens. Stored data needs no local status file. + if ($stored) { + Write-Warning 'Archive stored; dashboard refresh failed. Reload/startup/daily reconciliation can recover it.' + } else { + throw "Evaluation publication failed: $operation ($failureCode). No raw Azure response was logged." + } +} \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/bundle.ts b/eng/common/scripts/eval/publisher/bundle.ts new file mode 100644 index 000000000000..a2a06f32e2ce --- /dev/null +++ b/eng/common/scripts/eval/publisher/bundle.ts @@ -0,0 +1,201 @@ +// Schema-v1 wire contract consumed by the read-only Vally dashboard. This module +// packages existing records only; it never executes an evaluation or calls an LLM. +import { createHash } from "node:crypto"; +import { lstat, mkdir, readFile, readdir, realpath, writeFile } from "node:fs/promises"; +import { dirname, join, resolve, sep } from "node:path"; +import { pathToFileURL } from "node:url"; +import { parseArgs } from "node:util"; +import { strToU8, unzipSync, zipSync } from "fflate"; + +export const MAX_ZIP_BYTES = 32 * 1024 * 1024; +export const MAX_EXPANDED_BYTES = 128 * 1024 * 1024; +const MAX_ENTRIES = 10_000; +const MAX_TRIALS = 100_000; + +export class PublicationError extends Error { + constructor(code, message) { super(message); this.code = code; } +} + +function requireValue(condition, message) { + if (!condition) throw new PublicationError("invalid_bundle", message); +} + +function parseJson(text) { + try { return JSON.parse(text); } + catch { throw new PublicationError("invalid_bundle", "Invalid result JSON; raw evaluation content was not logged."); } +} + +export const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex"); + +export function isUtcTimestamp(value) { + if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.*Z$/.test(value)) return false; + const timestamp = Date.parse(value); + // Date.parse normalizes impossible dates; the dashboard rejects that rollover. + return Number.isFinite(timestamp) && new Date(timestamp).toISOString().slice(0, 10) === value.slice(0, 10); +} + +export async function boundedFile(path, maximum = MAX_EXPANDED_BYTES) { + const stat = await lstat(path); + requireValue(stat.isFile() && stat.size > 0 && stat.size <= maximum, "Result input must be a non-empty regular file within the size limit."); + const bytes = await readFile(path); + requireValue(bytes.length === stat.size, "Result input changed while being read."); + return bytes; +} + +export function validateManifest(value) { + requireValue(value?.schemaVersion === 1 && !Array.isArray(value), "A schema-v1 manifest is required."); + for (const key of ["adoOrganization", "adoProject", "repo", "pipeline", "runTimestamp"]) { + requireValue(typeof value[key] === "string" && value[key].trim().length > 0 && value[key].length <= 200 && + value[key] === value[key].trim() && !/[\u0000-\u001f\u007f]/.test(value[key]), + "Manifest identity fields must be bounded, trimmed non-empty strings."); + } + // The reader trims identity fields before deriving its canonical Blob name. + // Reject padding here rather than publishing an archive the reader cannot import. + requireValue(/^[a-z0-9][a-z0-9-]{0,99}$/.test(value.adoOrganization) && + !/[\\/:]/.test(value.adoProject) && !/^\.+$/.test(value.adoProject), "Invalid Azure DevOps organization/project identity."); + for (const key of ["pipelineDefinitionId", "buildId"]) { + requireValue(typeof value[key] === "string" && /^[1-9][0-9]{0,19}$/.test(value[key]), "Positive numeric pipeline/build IDs are required."); + } + requireValue(Number.isSafeInteger(value.summaryAttempt) && value.summaryAttempt > 0, "A positive Summary attempt is required."); + requireValue(isUtcTimestamp(value.runTimestamp), "A valid UTC result timestamp is required."); + if (value.branch !== undefined) requireValue(typeof value.branch === "string" && value.branch.trim().length > 0 && value.branch === value.branch.trim() && + value.branch.length <= 200 && !/[\u0000-\u001f\u007f]/.test(value.branch), "Invalid source branch."); + if (value.sourceVersion !== undefined) requireValue(typeof value.sourceVersion === "string" && /^[a-fA-F0-9]{40,64}$/.test(value.sourceVersion), "A source commit SHA is required."); + return value; +} + +export function blobName(manifest) { + validateManifest(manifest); + const name = ["v1", manifest.adoOrganization, manifest.adoProject.toLowerCase(), manifest.pipelineDefinitionId, + manifest.buildId, String(manifest.summaryAttempt)].map(encodeURIComponent).join("/") + "/dashboard-bundle.zip"; + requireValue(name.length <= 800, "The encoded archive name exceeds the dashboard limit."); + return name; +} + +export function validateSelectedAttempts(index) { + requireValue(index?.schemaVersion === 1 && index.complete === true && Array.isArray(index.expectedShards) && + index.expectedShards.length > 0 && Array.isArray(index.attempts), "Only a complete expected-shard index can be published."); + // Summary already selected the latest attempts against the current-build timeline. + // Accept exactly that selection, not an unselected list that could hide ambiguity. + const expected = new Set(index.expectedShards); + requireValue(expected.size === index.expectedShards.length && [...expected].every(name => typeof name === "string" && + /^[A-Za-z0-9_][A-Za-z0-9_-]{0,199}$/.test(name)), "Expected shard names must be valid and unique."); + requireValue(index.attempts.length === expected.size, "Exactly one selected attempt per expected shard is required."); + for (const item of index.attempts) { + requireValue(item && expected.delete(item.shard) && Number.isSafeInteger(item.attempt) && item.attempt > 0 && + item.directory === `eval-result-${item.shard}-${item.attempt}`, "Invalid shard directory or attempt."); + } + return [...index.attempts].sort((a, b) => a.shard.localeCompare(b.shard)); +} + +function trialsFrom(bytes, { onSkipped } = {}) { + const trials = []; + for (const [line] of Buffer.from(bytes).toString("utf8").matchAll(/[^\n]+/g)) { + if (!line.trim()) continue; + requireValue(Buffer.byteLength(line) <= 8 * 1024 * 1024, "A JSONL record exceeds the size limit."); + const item = parseJson(line); + requireValue(item && typeof item === "object" && !Array.isArray(item), "Invalid trial object."); + if (["log", "run-summary"].includes(item.type)) continue; + if (onSkipped && item.status === "skipped" && !item.experiment && [undefined, "trial-result"].includes(item.type)) { + onSkipped(); continue; + } + requireValue((item.type === undefined || item.type === "trial-result") && !item.experiment && + ["success", "error"].includes(item.status), "Only plain-eval trial records are supported."); + const serialized = JSON.stringify(item); + requireValue(Buffer.byteLength(serialized) <= 8 * 1024 * 1024, "A serialized JSONL record exceeds the size limit."); + trials.push(serialized + "\n"); + requireValue(trials.length <= MAX_TRIALS, "Too many trial records."); + } + requireValue(trials.length > 0, "Every selected shard must contain trial records."); + return trials; +} + +export function validateBundle(bytes) { + requireValue(bytes.length > 0 && bytes.length <= MAX_ZIP_BYTES, "Bundle exceeds the 32 MiB archive limit."); + const sizes = new Map(); let expanded = 0; + try { + unzipSync(bytes, { filter(file) { + requireValue(["manifest.json", "results.jsonl", "eval-summary.md"].includes(file.name) || /^junit\/[a-zA-Z0-9_-]+\.xml$/.test(file.name), "Unexpected ZIP entry."); + requireValue(!sizes.has(file.name.toLowerCase()), "Duplicate ZIP entry."); + requireValue(Number.isSafeInteger(file.originalSize) && file.originalSize >= 0, "Invalid ZIP entry size."); + expanded += file.originalSize; sizes.set(file.name.toLowerCase(), file.originalSize); + requireValue(sizes.size <= MAX_ENTRIES && expanded <= MAX_EXPANDED_BYTES, "Bundle exceeds the extraction budget."); + return false; + } }); + const entries = unzipSync(bytes); + for (const name of ["manifest.json", "results.jsonl", "eval-summary.md"]) requireValue(entries[name]?.length > 0, "Required ZIP entry is missing."); + requireValue(Object.keys(entries).some(name => name.startsWith("junit/")), "JUnit results are missing."); + for (const [name, content] of Object.entries(entries)) requireValue(content.length === sizes.get(name.toLowerCase()), "ZIP size mismatch."); + const manifest = validateManifest(parseJson(Buffer.from(entries["manifest.json"]).toString("utf8"))); + return { manifest, trials: trialsFrom(entries["results.jsonl"]).length, entries }; + } catch (error) { + if (error instanceof PublicationError) throw error; + throw new PublicationError("invalid_bundle", "The saved ZIP could not be validated."); + } +} + +export async function prepareBundle({ indexPath, summaryPath, outputPath, manifest }) { + const name = blobName(manifest); + const root = await realpath(dirname(resolve(indexPath))); + const selected = validateSelectedAttempts(parseJson((await boundedFile(indexPath, 2 * 1024 * 1024)).toString("utf8"))); + const entries = {}, trials = []; + let expanded = 0, trialBytes = 0, entryCount = 0, skipped = 0; + const add = (name, bytes) => { + expanded += bytes.length; + requireValue(bytes.length > 0 && expanded <= MAX_EXPANDED_BYTES && ++entryCount <= MAX_ENTRIES, "Merged results exceed the bundle budget."); + entries[name] = bytes; + }; + add("manifest.json", strToU8(JSON.stringify(manifest, null, 2) + "\n")); + for (const [number, item] of selected.entries()) { + const directory = join(root, item.directory), info = await lstat(directory); + requireValue(info.isDirectory() && (await realpath(directory)).startsWith(root + sep), "Shard directory must remain inside the artifact root."); + const metadata = parseJson((await boundedFile(join(directory, "shard.json"), 64 * 1024)).toString("utf8")); + requireValue(metadata.schemaVersion === 1 && metadata.complete === true && metadata.shard === item.shard && + metadata.attempt === item.attempt, "Selected shard is incomplete or has mismatched metadata."); + // The current dashboard imports executed trials (success/error). Vally's + // executor-incompatible skips remain in raw shard artifacts and JUnit/ + // Markdown, not fabricated as failed executions or silently lost counts. + const shardTrials = trialsFrom(await boundedFile(join(directory, "results.jsonl")), { onSkipped: () => { skipped++; } }); + requireValue(shardTrials.length === metadata.trials, "Shard trial count differs from its completion marker."); + for (const text of shardTrials) { + trialBytes += Buffer.byteLength(text); trials.push(text); + requireValue(expanded + trialBytes <= MAX_EXPANDED_BYTES && trials.length <= MAX_TRIALS, "Merged trials exceed the bundle budget."); + } + const junitRoot = join(directory, "junit"); + requireValue((await lstat(junitRoot)).isDirectory(), "JUnit path must not be a symbolic link."); + const files = (await readdir(junitRoot)).filter(name => name.endsWith(".junit.xml")).sort(); + requireValue(files.length > 0, "A selected shard has no JUnit."); + for (const [fileNumber, name] of files.entries()) add(`junit/${number}-${fileNumber}.xml`, await boundedFile(join(junitRoot, name), MAX_EXPANDED_BYTES - expanded - trialBytes)); + } + add("results.jsonl", strToU8(trials.join(""))); + add("eval-summary.md", await boundedFile(summaryPath, MAX_EXPANDED_BYTES - expanded)); + // Stable timestamps prevent packaging metadata from changing otherwise equal bytes. + const bytes = zipSync(entries, { level: 6, mtime: new Date("2020-01-01T00:00:00Z") }); + // Inputs, required non-empty entries and merged budgets were checked during + // construction. Full ZIP decoding remains an archive-contract test, not a second pass. + requireValue(bytes.length > 0 && bytes.length <= MAX_ZIP_BYTES, "Bundle exceeds the 32 MiB archive limit."); + await mkdir(dirname(resolve(outputPath)), { recursive: true }); + await writeFile(outputPath, bytes, { flag: "wx" }); + return { shards: selected.length, trials: trials.length, skipped, bytes: bytes.length, sha256: sha256(bytes), blobName: name }; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + try { + const { values } = parseArgs({ options: { index: { type: "string" }, summary: { type: "string" }, output: { type: "string" }, + organization: { type: "string" }, project: { type: "string" }, repository: { type: "string" }, pipeline: { type: "string" }, + "definition-id": { type: "string" }, "build-id": { type: "string" }, attempt: { type: "string" }, + branch: { type: "string" }, "source-version": { type: "string" } } }); + if (!values.index || !values.summary || !values.output) throw new PublicationError("invalid_arguments", "Provide --index, --summary and --output."); + const result = await prepareBundle({ indexPath: values.index, summaryPath: values.summary, outputPath: values.output, + manifest: { schemaVersion: 1, adoOrganization: values.organization, adoProject: values.project, repo: values.repository, + pipeline: values.pipeline, pipelineDefinitionId: values["definition-id"], buildId: values["build-id"], + summaryAttempt: Number(values.attempt), branch: values.branch, sourceVersion: values["source-version"], runTimestamp: new Date().toISOString() } }); + // Transport consumes this saved identity/checksum, not pipeline environment variables. + await writeFile(`${values.output}.json`, JSON.stringify(result, null, 2) + "\n", { flag: "wx" }); + console.log(`Prepared one build bundle: ${result.shards} selected shards, ${result.trials} trials, ${result.bytes} bytes.`); + if (result.skipped) console.log(`${result.skipped} non-executed skipped records are retained in raw artifacts and JUnit/Markdown, not imported as dashboard outcomes.`); + } catch (error) { + console.error(error instanceof PublicationError ? error.message : "Bundle preparation failed; inspect the selected result artifacts."); + process.exitCode = 1; + } +} \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/package.json b/eng/common/scripts/eval/publisher/package.json new file mode 100644 index 000000000000..0a5e158ddac6 --- /dev/null +++ b/eng/common/scripts/eval/publisher/package.json @@ -0,0 +1,17 @@ +{ + "name": "@azure-tools/eval-result-publisher", + "version": "1.0.0", + "private": true, + "description": "Data-only Vally result bundling; Azure CLI performs publication. No evaluator or dashboard runtime.", + "type": "module", + "packageManager": "pnpm@12.6.0", + "engines": { + "node": ">=24.14.1" + }, + "scripts": { + "test": "node --experimental-strip-types --test test/*.test.ts && pwsh -NoProfile -Command \"Invoke-Pester -Path ../../../../common-tests/eval/Publish-EvalResults.Tests.ps1 -CI\"" + }, + "dependencies": { + "fflate": "0.8.3" + } +} \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/pnpm-lock.yaml b/eng/common/scripts/eval/publisher/pnpm-lock.yaml new file mode 100644 index 000000000000..56c3971ecf94 --- /dev/null +++ b/eng/common/scripts/eval/publisher/pnpm-lock.yaml @@ -0,0 +1,22 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + fflate: + specifier: 0.8.3 + version: 0.8.3 + +packages: + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + +snapshots: + + fflate@0.8.3: {} \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/test/publisher.test.ts b/eng/common/scripts/eval/publisher/test/publisher.test.ts new file mode 100644 index 000000000000..1b6d2cba2436 --- /dev/null +++ b/eng/common/scripts/eval/publisher/test/publisher.test.ts @@ -0,0 +1,376 @@ +// Verifies the saved archive contract and pipeline-owned publication policy, without Azure requests. +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { randomBytes } from "node:crypto"; +import { mkdtemp, mkdir, readFile, rm, truncate, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join, resolve } from "node:path"; +import { pathToFileURL } from "node:url"; +import { test } from "node:test"; +import { runInNewContext } from "node:vm"; +import { zipSync, strToU8 } from "fflate"; +import { MAX_EXPANDED_BYTES, MAX_ZIP_BYTES, blobName, boundedFile, isUtcTimestamp, prepareBundle, validateSelectedAttempts, sha256, validateBundle, validateManifest } from "../bundle.ts"; + +const manifest = { schemaVersion: 1, adoOrganization: "azure-sdk", adoProject: "internal", repo: "Azure/azure-sdk-tools", + pipeline: "synthetic", pipelineDefinitionId: "8255", buildId: "1001", summaryAttempt: 1, runTimestamp: "2026-09-21T00:00:00.000Z" }; +const trial = { type: "trial-result", itemId: "synthetic", evalName: "synthetic", stimulus: "synthetic", model: "no-llm", status: "error", error: "Synthetic", durationMs: 1, trajectory: null, gradeResult: null }; +const entries = (extra = {}) => ({ "manifest.json": strToU8(JSON.stringify(manifest)), "results.jsonl": strToU8(JSON.stringify(trial)), + "eval-summary.md": strToU8("# Synthetic test"), "junit/0.xml": strToU8(''), ...extra }); +const zip = (extra) => zipSync(entries(extra), { mtime: new Date("2020-01-01T00:00:00Z") }); + +async function fixture(t) { + const root = await mkdtemp(join(tmpdir(), "eval-publisher-")); + t.after(() => rm(root, { recursive: true, force: true })); + const path = join(root, "saved.zip"); await writeFile(path, zip()); + return { root, path }; +} + +async function constructionFixture(t) { + const f = await fixture(t), artifact = join(f.root, "eval-result-a-2"), junit = join(artifact, "junit"); + await mkdir(junit, { recursive: true }); + await writeFile(join(artifact, "results.jsonl"), JSON.stringify(trial) + "\n"); + await writeFile(join(artifact, "shard.json"), JSON.stringify({ schemaVersion: 1, shard: "a", attempt: 2, complete: true, trials: 1 })); + await writeFile(join(junit, "0.junit.xml"), ""); + const indexPath = join(f.root, "shard-index.json"), summaryPath = join(f.root, "summary.md"), outputPath = join(f.root, "bundle.zip"); + await writeFile(indexPath, JSON.stringify({ schemaVersion: 1, complete: true, expectedShards: ["a"], + attempts: [{ shard: "a", attempt: 2, directory: "eval-result-a-2" }] })); + await writeFile(summaryPath, "# Complete build\n"); + return { ...f, artifact, junit, indexPath, summaryPath, outputPath, manifest }; +} + +function run(script, args, env = {}, preload = []) { + const environment = { ...process.env, ...env }; delete environment.NODE_TEST_CONTEXT; + const child = spawnSync(process.execPath, ["--experimental-strip-types", ...preload, script, ...args], { + encoding: "utf8", env: environment, timeout: 30_000, maxBuffer: 2 * 1024 * 1024, + }); + assert.ifError(child.error); assert.equal(child.status, 0, child.stderr + child.stdout); + return child; +} + +test("shared shards -> saved timeline evidence -> token-free summary -> one schema-v1 ZIP", async (t) => { + const f = await fixture(t), scripts = resolve(import.meta.dirname, "../.."); + const downloads = join(f.root, "downloads"); await mkdir(downloads); + for (const shard of ["shard_a", "shard_b"]) { + const source = join(f.root, shard), invocation = join(source, "invocation"); + await mkdir(invocation, { recursive: true }); + await writeFile(join(invocation, "results.jsonl"), [ + { ...trial, itemId: shard }, { type: "run-summary", evals: [{ name: trial.evalName, stimuliRun: 1, passed: false }] }, + ].map(record => JSON.stringify(record)).join("\n") + "\n"); + await writeFile(join(invocation, "eval-results.junit.xml"), + ``); + run(join(scripts, "lib/shard-results.ts"), ["--results-root", source, "--output-directory", join(downloads, `eval-result-${shard}-1`), "--shard-name", shard, "--attempt", "1"]); + } + const summary = join(f.root, "summary", "eval-summary.md"), attempts = join(f.root, "summary", "job-attempts.json"); + const mock = join(f.root, "timeline-fetch.mjs"); + await writeFile(mock, `import { Socket } from "node:net"; + Socket.prototype.connect = function() { throw new Error("Network disabled"); }; + globalThis.fetch = async (url, options) => { + if (url.origin !== "https://dev.azure.com" || options.headers.authorization !== "Bearer fixture-token" || options.redirect !== "error") throw new Error("Unexpected timeline request"); + return Response.json({ records: ["a", "b"].map(key => ({ type: "Job", identifier: "Eval.RunShard." + key, + attempt: 1, state: "completed", result: "failed" })) }); + };`); + const matrix = JSON.stringify({ a: { shardName: "shard_a" }, b: { shardName: "shard_b" } }); + run(join(scripts, "lib/shard-results.ts"), ["--attempts-output", attempts], { + EVAL_EXPECTED_MATRIX: matrix, SYSTEM_COLLECTIONURI: "https://dev.azure.com/azure-sdk/", + SYSTEM_TEAMPROJECTID: "00000000-0000-4000-8000-000000000001", BUILD_BUILDID: "1001", SYSTEM_ACCESSTOKEN: "fixture-token", + }, ["--import", pathToFileURL(mock).href]); + assert.equal(JSON.parse(await readFile(attempts, "utf8")).valid, true); + const offline = join(f.root, "no-network.mjs"); + await writeFile(offline, `globalThis.fetch = () => { throw new Error("Rendering cannot fetch"); }; delete process.env.SYSTEM_ACCESSTOKEN;`); + const result = run(join(scripts, "build-eval-summary.ts"), ["--results-root", downloads, "--selected-root", join(f.root, "selected"), + "--attempts-file", attempts, "--output-path", summary], { TF_BUILD: "true", EVAL_EXPECTED_MATRIX: matrix }, ["--import", pathToFileURL(offline).href]); + assert.match(result.stdout, /EvalSummaryComplete\]true/); + const output = join(f.root, "build.zip"); + const packed = await prepareBundle({ indexPath: join(downloads, "shard-index.json"), summaryPath: summary, outputPath: output, manifest }); + assert.equal(packed.trials, 2); assert.equal(packed.shards, 2); + assert.equal(packed.sha256, sha256(await readFile(output))); + assert.equal(packed.blobName, "v1/azure-sdk/internal/8255/1001/1/dashboard-bundle.zip"); + const checked = validateBundle(await readFile(output)); assert.deepEqual(checked.manifest, manifest); + assert.equal(Object.keys(checked.entries).length, 5); + assert.doesNotMatch(Buffer.from(checked.entries["results.jsonl"]).toString("utf8"), /run-summary/); + assert.match(Buffer.from(checked.entries["eval-summary.md"]).toString("utf8"), /FAILED/); + await assert.rejects(prepareBundle({ indexPath: join(downloads, "shard-index.json"), summaryPath: summary, outputPath: output, manifest }), { code: "EEXIST" }); +}); + +test("bundle CLI takes explicit metadata, preserves the real pipeline name and saves transport identity", async (t) => { + const f = await fixture(t), artifact = join(f.root, "eval-result-a-1"); + await mkdir(join(artifact, "junit"), { recursive: true }); + await writeFile(join(artifact, "results.jsonl"), JSON.stringify(trial)); + await writeFile(join(artifact, "shard.json"), JSON.stringify({ schemaVersion: 1, shard: "a", attempt: 1, complete: true, trials: 1 })); + await writeFile(join(artifact, "junit", "0.junit.xml"), ''); + const index = join(f.root, "shard-index.json"), summary = join(f.root, "summary.md"), output = join(f.root, "explicit.zip"); + await writeFile(index, JSON.stringify({ schemaVersion: 1, complete: true, expectedShards: ["a"], attempts: [{ shard: "a", attempt: 1, directory: "eval-result-a-1" }] })); + await writeFile(summary, "# Saved summary"); + run(resolve(import.meta.dirname, "../bundle.ts"), ["--index", index, "--summary", summary, "--output", output, + "--organization", "azure-sdk", "--project", "Test Project", "--repository", "Azure/azure-sdk-tools", "--pipeline", "Real Pipeline Name", + "--definition-id", "9999", "--build-id", "1001", "--attempt", "2", "--branch", "refs/heads/main", "--source-version", "a".repeat(40)], { + SYSTEM_COLLECTIONURI: "https://attacker.example", SYSTEM_DEFINITIONID: "bad", BUILD_DEFINITIONNAME: "wrong", + }); + const bytes = await readFile(output), checked = validateBundle(bytes), prepared = JSON.parse(await readFile(`${output}.json`, "utf8")); + assert.equal(checked.manifest.pipeline, "Real Pipeline Name"); assert.equal(checked.manifest.pipelineDefinitionId, "9999"); + assert.equal(prepared.blobName, "v1/azure-sdk/test%20project/9999/1001/2/dashboard-bundle.zip"); + assert.equal(prepared.sha256, sha256(bytes)); assert.equal(prepared.bytes, bytes.length); + assert.doesNotMatch(await readFile(resolve(import.meta.dirname, "../bundle.ts"), "utf8"), /process\.env|SYSTEM_|BUILD_|TF_BUILD/); +}); + +test("skips remain in raw artifacts/JUnit, not fabricated as dashboard executions", async (t) => { + const f = await fixture(t), artifact = join(f.root, "eval-result-a-1"); + await mkdir(join(artifact, "junit"), { recursive: true }); + const skipped = { type: "trial-result", status: "skipped", itemId: "incompatible", skipReason: "Synthetic incompatible executor" }; + await writeFile(join(artifact, "results.jsonl"), [trial, skipped, { type: "run-summary", evals: [{ name: "synthetic" }] }].map(record => JSON.stringify(record)).join("\n")); + await writeFile(join(artifact, "shard.json"), JSON.stringify({ schemaVersion: 1, shard: "a", attempt: 1, complete: true, trials: 1 })); + await writeFile(join(artifact, "junit", "0.junit.xml"), ''); + const index = join(f.root, "shard-index.json"), summary = join(f.root, "summary.md"), output = join(f.root, "mixed.zip"); + await writeFile(index, JSON.stringify({ schemaVersion: 1, complete: true, expectedShards: ["a"], attempts: [{ shard: "a", attempt: 1, directory: "eval-result-a-1" }] })); + await writeFile(summary, "# Mixed result\n1 executed, 1 skipped"); + const result = await prepareBundle({ indexPath: index, summaryPath: summary, outputPath: output, manifest }); + assert.equal(result.trials, 1); assert.equal(result.skipped, 1); + const checked = validateBundle(await readFile(output)); assert.equal(checked.trials, 1); + assert.match(Buffer.from(checked.entries["junit/0-0.xml"]).toString(), / { + const a = { shard: "a", attempt: 2, directory: "eval-result-a-2" }, b = { shard: "b", attempt: 3, directory: "eval-result-b-3" }; + const base = { schemaVersion: 1, complete: true, expectedShards: ["a", "b"], attempts: [b, a] }; + assert.deepEqual(validateSelectedAttempts(base), [a, b]); assert.deepEqual(base.attempts, [b, a]); + for (const source of [{ ...base, complete: false }, { ...base, expectedShards: ["a", "b", "c"] }, { ...base, expectedShards: ["a", "a"] }, + { ...base, attempts: [a] }, { ...base, attempts: [a, a] }, { ...base, attempts: [a, { ...a, attempt: 1, directory: "eval-result-a-1" }, b] }, + ...[0, -1, 1.5, "2"].map(attempt => ({ ...base, attempts: [{ ...a, attempt }, b] })), + { ...base, expectedShards: ["a", "../b"] }, { ...base, attempts: [a, { ...b, shard: "unexpected" }] }, + { ...base, attempts: [{ ...a, directory: "../elsewhere" }, b] }, { ...base, attempts: [null, b] }]) { + assert.throws(() => validateSelectedAttempts(source), { code: "invalid_bundle" }); + } +}); + +test("construction keeps nonempty required inputs and shard completion checks before saving", async (t) => { + for (const input of ["results.jsonl", "junit/0.junit.xml", "summary.md"]) await t.test(`empty ${input}`, async (t) => { + const f = await constructionFixture(t); + await writeFile(input === "summary.md" ? f.summaryPath : join(f.artifact, input), ""); + await assert.rejects(prepareBundle(f), { code: "invalid_bundle" }); + await assert.rejects(readFile(f.outputPath), { code: "ENOENT" }); + }); + for (const patch of [{ complete: false }, { shard: "other" }, { attempt: 1 }, { trials: 2 }]) await t.test(`metadata ${JSON.stringify(patch)}`, async (t) => { + const f = await constructionFixture(t), path = join(f.artifact, "shard.json"); + await writeFile(path, JSON.stringify({ ...JSON.parse(await readFile(path, "utf8")), ...patch })); + await assert.rejects(prepareBundle(f), { code: "invalid_bundle" }); + await assert.rejects(readFile(f.outputPath), { code: "ENOENT" }); + }); + const f = await constructionFixture(t); + await rm(join(f.junit, "0.junit.xml")); + await assert.rejects(prepareBundle(f), { code: "invalid_bundle" }); +}); + +test("construction counts all 10,000 entries including merged JSONL and rejects one more", async (t) => { + const f = await constructionFixture(t); + // 9,997 JUnit files plus manifest, JSONL and Markdown reach the exact limit. + for (let start = 1; start < 9_997; start += 100) { + await Promise.all(Array.from({ length: Math.min(100, 9_997 - start) }, (_, offset) => + writeFile(join(f.junit, `${start + offset}.junit.xml`), ""))); + } + await prepareBundle(f); + assert.equal(Object.keys(validateBundle(await readFile(f.outputPath)).entries).length, 10_000); + await writeFile(join(f.junit, "9997.junit.xml"), ""); + const outputPath = join(f.root, "too-many-entries.zip"); + await assert.rejects(prepareBundle({ ...f, outputPath }), { code: "invalid_bundle" }); + await assert.rejects(readFile(outputPath), { code: "ENOENT" }); +}); + +test("construction enforces the aggregate expanded budget including trials before reading oversized input", async (t) => { + const f = await constructionFixture(t); + const used = Buffer.byteLength(JSON.stringify(manifest, null, 2) + "\n") + Buffer.byteLength(JSON.stringify(trial) + "\n") + + (await readFile(join(f.junit, "0.junit.xml"))).length; + await truncate(f.summaryPath, MAX_EXPANDED_BYTES - used + 1); + await assert.rejects(prepareBundle(f), { code: "invalid_bundle" }); + await assert.rejects(readFile(f.outputPath), { code: "ENOENT" }); +}); + +test("construction keeps the final compressed-size cap without decoding the newly created ZIP", async (t) => { + const f = await constructionFixture(t); + await writeFile(join(f.junit, "0.junit.xml"), randomBytes(MAX_ZIP_BYTES + 1024)); + await assert.rejects(prepareBundle(f), { code: "invalid_bundle" }); + await assert.rejects(readFile(f.outputPath), { code: "ENOENT" }); + const source = await readFile(resolve(import.meta.dirname, "../bundle.ts"), "utf8"); + assert.doesNotMatch(source.slice(source.indexOf("export async function prepareBundle")), /validateBundle\(|unzipSync\(/); +}); + +test("construction permits 100,000 trials but rejects a merged build with more", async (t) => { + const f = await constructionFixture(t), record = '{"status":"error"}\n'; + const metadata = { schemaVersion: 1, shard: "a", attempt: 2, complete: true, trials: 100_000 }; + await writeFile(join(f.artifact, "results.jsonl"), record.repeat(100_000)); + await writeFile(join(f.artifact, "shard.json"), JSON.stringify(metadata)); + const result = await prepareBundle(f); assert.equal(result.trials, 100_000); + assert.equal(validateBundle(await readFile(f.outputPath)).trials, 100_000); + const other = join(f.root, "eval-result-b-1"); await mkdir(join(other, "junit"), { recursive: true }); + await writeFile(join(other, "results.jsonl"), record); + await writeFile(join(other, "shard.json"), JSON.stringify({ ...metadata, shard: "b", attempt: 1, trials: 1 })); + await writeFile(join(other, "junit/0.junit.xml"), ""); + const index = JSON.parse(await readFile(f.indexPath, "utf8")); + index.expectedShards.push("b"); index.attempts.push({ shard: "b", attempt: 1, directory: "eval-result-b-1" }); + await writeFile(f.indexPath, JSON.stringify(index)); + const outputPath = join(f.root, "too-many-trials.zip"); + await assert.rejects(prepareBundle({ ...f, outputPath }), { code: "invalid_bundle" }); + await assert.rejects(readFile(outputPath), { code: "ENOENT" }); +}); + +test("direct JSON string parsing preserves UTF-8, byte limits and sanitized errors", async (t) => { + const f = await constructionFixture(t), path = join(f.artifact, "results.jsonl"); + await writeFile(path, JSON.stringify({ ...trial, itemId: "UTF-8 界" }) + "\r\n"); + await prepareBundle(f); + assert.match(Buffer.from(validateBundle(await readFile(f.outputPath)).entries["results.jsonl"]).toString("utf8"), /UTF-8 界/); + for (const raw of [JSON.stringify({ status: "error", itemId: "界".repeat(Math.ceil(8 * 1024 * 1024 / 3)) }), + '{"status":"error","values":[' + Array(940_000).fill("1e-6").join(",") + "]}"]) { + await writeFile(path, raw); + await assert.rejects(prepareBundle({ ...f, outputPath: join(f.root, "oversized-record.zip") }), { code: "invalid_bundle" }); + } + for (const path of [f.indexPath, join(f.artifact, "shard.json"), join(f.artifact, "results.jsonl")]) { + const previous = await readFile(path); + await writeFile(path, '{"secret":"PRIVATE_RESULT_CONTENT"'); + await assert.rejects(prepareBundle(f), error => error.code === "invalid_bundle" && !error.message.includes("PRIVATE_RESULT_CONTENT")); + await writeFile(path, previous); + } +}); + +test("ZIP allowlist, corrupt records, experiments and extraction bombs are rejected without logging content", async (t) => { + const f = await fixture(t); + for (const extra of [{ "../escape": strToU8("no") }, { "manifest.JSON": strToU8("no") }, { "bin/mcp.dll": strToU8("no") }, + { "results.jsonl": strToU8('{"secret":"do not log"') }, { "results.jsonl": strToU8(JSON.stringify({ ...trial, experiment: { runId: "x" } })) }, + { "results.jsonl": new Uint8Array() }, { "manifest.json": strToU8(JSON.stringify({ ...manifest, buildId: "0" })) }]) { + assert.throws(() => validateBundle(zip(extra)), { code: "invalid_bundle" }); + } + const bomb = Buffer.from(zip()), start = bomb.indexOf(Buffer.from([0x50, 0x4b, 0x01, 0x02])); + bomb.writeUInt32LE(128 * 1024 * 1024 + 1, start + 24); + assert.throws(() => validateBundle(bomb), { code: "invalid_bundle" }); + await assert.rejects(boundedFile(f.path, 1), { code: "invalid_bundle" }); + assert.throws(() => validateBundle(zip({ "results.jsonl": strToU8('{"secret":"do not log"') })), error => !error.message.includes("secret")); + assert.equal(validateBundle(zip({ "results.jsonl": strToU8(JSON.stringify(trial) + "\r\n") })).trials, 1); +}); + +test("canonical identity and UTC calendar validation match the reader", () => { + assert.equal(blobName({ ...manifest, adoProject: "Test Project" }), "v1/azure-sdk/test%20project/8255/1001/1/dashboard-bundle.zip"); + for (const key of ["adoOrganization", "adoProject", "repo", "pipeline", "runTimestamp"]) for (const padded of [` ${manifest[key]}`, `${manifest[key]} `]) { + assert.throws(() => validateManifest({ ...manifest, [key]: padded }), { code: "invalid_bundle" }); + } + for (const branch of [" ", " refs/heads/main", "refs/heads/main "]) assert.throws(() => validateManifest({ ...manifest, branch }), { code: "invalid_bundle" }); + assert.throws(() => blobName({ ...manifest, adoProject: "\u754c".repeat(200) }), { code: "invalid_bundle" }); + for (const timestamp of ["2024-02-29T23:59:59Z", "2026-09-24T12:34:56.1234567Z", "2026-01-01T00:00:00Z"]) assert.equal(isUtcTimestamp(timestamp), true); + for (const timestamp of ["2026-02-30T00:00:00Z", "2026-02-29T00:00:00Z", "2026-04-31T00:00:00Z", "2026-01-01T24:00:00Z", "2026-01-01T00:00:00+00:00", "2026-01-01T00:00:00", "not a date", null]) { + assert.equal(isUtcTimestamp(timestamp), false); + assert.throws(() => validateManifest({ ...manifest, runTimestamp: timestamp }), { code: "invalid_bundle" }); + } +}); + +test("the archive package pins Node 24/pnpm and one portable SHA512-locked dependency", async () => { + const packageJson = JSON.parse(await readFile(resolve(import.meta.dirname, "../package.json"), "utf8")); + const lock = await readFile(resolve(import.meta.dirname, "../pnpm-lock.yaml"), "utf8"); + assert.equal(packageJson.engines.node, ">=24.14.1"); assert.equal(packageJson.packageManager, "pnpm@12.6.0"); + assert.deepEqual(packageJson.dependencies, { fflate: "0.8.3" }); + assert.deepEqual([...lock.matchAll(/^ ([^\s]+@[^:]+):/gm)].map(match => match[1]), ["fflate@0.8.3", "fflate@0.8.3"]); + assert.match(lock, /specifier: 0\.8\.3\s+version: 0\.8\.3/); + assert.match(lock, /integrity: sha512-tbZNuJrLwGUp3zshBtdy4W\+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==/); + assert.doesNotMatch(lock, /https?:|tarball:|sha1-|packageManagerDependencies/); +}); + +test("PR CI runs every lightweight Node suite and discovers tagged publisher PowerShell tests", async () => { + const root = resolve(import.meta.dirname, "../../../../.."); + const ci = await readFile(join(root, "common-tests/ci.yml"), "utf8"); + assert.match(ci, /TargetDirectory: eng\/common-tests/); + assert.match(ci, /TargetTags: UnitTest,IntegrationTest/); + assert.match(ci, /CustomTestSteps:[\s\S]*config.Filter.Tag = @\('UnitTest', 'IntegrationTest'\)/); + assert.match(ci, /if \(\$result.FailedCount -gt 0\) \{ throw/); + assert.match(ci, /node --experimental-strip-types --test test\/\*\.test\.ts publisher\/test\/\*\.test\.ts/); + assert.match(ci, /version: 24\.x/); + assert.match(ci, /npm install --prefix.*pnpm@12\.6\.0/); + assert.match(ci, /pnpm\/bin\/pnpm\.mjs.*--dir publisher --ignore-workspace install --pm-on-fail=ignore --frozen-lockfile --prod --ignore-scripts/); + assert.match(ci, /NPM_CONFIG_USERCONFIG: \$\(Agent.TempDirectory\)\/eval-unit-tests\.npmrc/); + assert.doesNotMatch(ci, /vally eval|azureSubscription:|npm ci/); + const pester = await readFile(join(root, "common-tests/eval/Publish-EvalResults.Tests.ps1"), "utf8"); + assert.match(pester, /Describe 'Azure CLI evaluation publication' -Tag 'UnitTest'/); + assert.match(pester, /Microsoft.PowerShell.Utility\\Invoke-WebRequest/); + assert.match(pester, /server\.listen\(0,'127\.0\.0\.1'/); + const publisher = JSON.parse(await readFile(resolve(import.meta.dirname, "../package.json"), "utf8")); + assert.match(publisher.scripts.test, /common-tests\/eval\/Publish-EvalResults.Tests.ps1/); +}); + +test("pipeline separates token-bearing attempt verification from rendering and uploads before the score gate", async () => { + const root = resolve(import.meta.dirname, "../../../.."); + const summary = await readFile(join(root, "pipelines/templates/jobs/eval-summarize.yml"), "utf8"); + const verification = summary.slice(summary.indexOf("# Only attempt verification"), summary.indexOf('"$(Build.SourcesDirectory)/eng/common/scripts/eval/build-eval-summary.ts"')); + assert.match(verification, /--attempts-output/); assert.match(verification, /SYSTEM_ACCESSTOKEN: \$\(System.AccessToken\)/); + const rendering = summary.slice(summary.indexOf('"$(Build.SourcesDirectory)/eng/common/scripts/eval/build-eval-summary.ts"')); + assert.match(rendering, /--attempts-file/); assert.doesNotMatch(rendering, /SYSTEM_ACCESSTOKEN/); + assert.ok(summary.indexOf("../steps/eval-publish-results.yml") < summary.indexOf("task: PublishTestResults@2")); + const steps = await readFile(join(root, "pipelines/templates/steps/eval-publish-results.yml"), "utf8"); + assert.match(steps, /pnpm\/bin\/pnpm\.mjs.*--ignore-workspace install --pm-on-fail=ignore --frozen-lockfile --prod --ignore-scripts/); + assert.match(steps, /NPM_CONFIG_USERCONFIG: \$\(Build.SourcesDirectory\)\/\.npmrc/); + assert.doesNotMatch(steps, /npm ci/); + for (const job of ["eval-shard.yml", "eval-summarize.yml"]) { + assert.match(await readFile(join(root, "pipelines/templates/jobs", job), "utf8"), /version: 24\.x/); + } + assert.doesNotMatch(steps, /registryUrl:|azure-sdk-tools\/npm\/registry/); + assert.match(steps, /scriptType: pscore[\s\S]*scriptLocation: inlineScript[\s\S]*Publish-EvalResults\.ps1/); + assert.match(steps, /azureSubscription: eval-dashboard-sc/); + assert.match(steps, /EVAL_STORAGE_ACCOUNT_NAME: \$\(EvalStorageAccountName\)/); + assert.match(steps, /EVAL_DASHBOARD_REFRESH_URL: \$\(EvalDashboardRefreshUrl\)/); + assert.match(steps, /EVAL_DASHBOARD_RESOURCE: \$\(EvalDashboardResource\)/); + assert.match(steps, /-DashboardRefreshUrl \$env:EVAL_DASHBOARD_REFRESH_URL -DashboardResource \$env:EVAL_DASHBOARD_RESOURCE/); + assert.doesNotMatch(steps, /ResultPath|storage-publication-result/); + const publisher = await readFile(resolve(import.meta.dirname, "../Publish-EvalResults.ps1"), "utf8"); + assert.doesNotMatch(publisher, /Save-Receipt|ResultPath|persist_storage_result|receipt_failed|File\]::(?:Write|Open|Move)|Set-Content/); + assert.ok(publisher.indexOf('Write-Host "Result archive stored:') < publisher.indexOf("'--resource', $DashboardResource"), "Confirm upload before notification without a local status file"); + assert.doesNotMatch(steps, /258998df|azsdk-eval-bue6/); + assert.doesNotMatch(await readFile(resolve(import.meta.dirname, "../Publish-EvalResults.ps1"), "utf8"), /258998df|azsdk-eval-bue6/); + assert.doesNotMatch(await readFile(resolve(import.meta.dirname, "../Publish-EvalResults.ps1"), "utf8"), /TF_BUILD|SYSTEM_|BUILD_|System\.DefinitionId/); +}); + +test("one checkbox gates trusted-run egress; owner configuration additionally gates runtime upload", async () => { + const root = resolve(import.meta.dirname, "../../../.."); + const archetype = await readFile(join(root, "pipelines/templates/stages/archetype-eval.yml"), "utf8"); + const steps = await readFile(join(root, "pipelines/templates/steps/eval-publish-results.yml"), "utf8"); + const gate = source => source.match(/\$\{\{ if (and\(parameters\.publishDashboardResults, .+\)) \}\}:/)?.[1]; + const networkGate = gate(archetype), uploadGate = gate(steps); + assert.ok(networkGate); assert.equal(networkGate, uploadGate); + assert.doesNotMatch(networkGate, /System.DefinitionId|EvalStorageAccountName/); + const runtime = steps.match(/ condition: (and\(.+\))/)?.[1]; assert.ok(runtime); + const evaluate = (expression, variables, enabled = true, succeeds = true) => runInNewContext(expression.replace(/\bin\(/g, "oneOf("), { + variables, parameters: { publishDashboardResults: enabled }, succeeded: () => succeeds, + and: (...values) => values.every(Boolean), eq: (a, b) => String(a ?? "").toLowerCase() === String(b ?? "").toLowerCase(), + ne: (a, b) => String(a ?? "").toLowerCase() !== String(b ?? "").toLowerCase(), + oneOf: (value, ...items) => items.some(item => String(value ?? "").toLowerCase() === String(item).toLowerCase()), + }); + const base = { "System.CollectionUri": "https://dev.azure.com/azure-sdk/", "System.TeamProject": "internal", "Build.Repository.Name": "Azure/azure-sdk-tools", + "Build.SourceBranch": "refs/heads/main", "Build.Reason": "Manual", "EvalSummaryComplete": "true", "EvalStorageAccountName": "evaltestsummary" }; + assert.equal(evaluate(networkGate, base), true); assert.equal(evaluate(runtime, base), true); + assert.equal(evaluate(networkGate, base, false), false); assert.equal(evaluate(runtime, base, true, false), false); + for (const account of [undefined, ""]) assert.equal(evaluate(runtime, { ...base, EvalStorageAccountName: account }), false); + assert.equal(evaluate(runtime, { ...base, EvalSummaryComplete: "false" }), false); + for (const [key, value] of [["System.CollectionUri", "https://dev.azure.com/other/"], ["System.TeamProject", "public"], + ["Build.Repository.Name", "Azure/azure-rest-api-specs"], ["Build.Reason", "PullRequest"], ["Build.Reason", "ResourceTrigger"], + ...["refs/pull/1/merge", "refs/heads/feature", "refs/heads/feature/main", "refs/tags/main", ""].map(branch => ["Build.SourceBranch", branch])]) { + const variables = { ...base, [key]: value }; + assert.equal(evaluate(networkGate, variables), false); assert.equal(evaluate(runtime, variables), false); + } + for (const id of ["8255", "9999"]) assert.equal(evaluate(networkGate, { ...base, "System.DefinitionId": id }), true, "Definition IDs are archive identity, not shared policy"); +}); + +test("redirect retains Default Deny/CFS and shared publication defaults stay off", async () => { + const root = resolve(import.meta.dirname, "../../../.."); + const redirect = await readFile(join(root, "../pipelines/templates/stages/1es-redirect.yml"), "utf8"); + assert.match(redirect, /networkIsolationPolicy: DefaultDeny, CFSClean, CFSClean2, CFSClean3, AzureStorage/); + assert.match(redirect, /parameters.AllowAzureStorage.*parameters.Use1ESOfficial.*System.TeamProject.*PullRequest.*refs\/pull\//); + for (const path of ["templates/steps/eval-publish-results.yml", "templates/jobs/eval-summarize.yml", "templates/stages/archetype-eval.yml"]) { + assert.match(await readFile(join(root, "pipelines", path), "utf8"), /name: publishDashboardResults\s+type: boolean\s+default: false/); + } +}); + +for (const tier of ["workflow", "skill", "live"]) test(`${tier} forwards only the checkbox and preserves its evaluation tier`, async () => { + const root = resolve(import.meta.dirname, "../../../.."), content = await readFile(join(root, `pipelines/${tier}-eval.yml`), "utf8"); + assert.match(content, /createDashboardBundle: true/); assert.match(content, /name: publishDashboardResults[\s\S]*default: true/); + assert.ok(content.includes("publishDashboardResults: ${{ parameters.publishDashboardResults }}")); + assert.doesNotMatch(content, /eval-dashboard\.yml|EvalDashboardPublicationEnabled|System.DefinitionId|autoPublishDashboardResults|allowAzureStorageNetworkAccess/); + const inputs = content.slice(content.indexOf("\nparameters:\n"), content.indexOf("\nvariables:\n")); + assert.deepEqual([...inputs.matchAll(/- name: (\w+)/g)].map(match => match[1]), ["publishDashboardResults"]); + assert.match(content, /group: AzSDK_Eval_Variable_group/); assert.match(content, new RegExp(`TestType: ${tier === "live" ? "live" : "mock"}`)); + if (tier === "live") { assert.match(content, /UseAzSdkAuthentication: true/); assert.match(content, /failOnFailedTests: true/); } + if (tier === "skill") assert.match(content, /vallyRoot: \.github\/skills/); +}); \ No newline at end of file diff --git a/eng/common/scripts/eval/test/shard-results.test.ts b/eng/common/scripts/eval/test/shard-results.test.ts new file mode 100644 index 000000000000..38bca140a85a --- /dev/null +++ b/eng/common/scripts/eval/test/shard-results.test.ts @@ -0,0 +1,530 @@ +// Verifies complete result staging, authoritative attempts and recovery after transport failures. +import assert from "node:assert/strict"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; +import { spawnSync } from "node:child_process"; +import { test } from "node:test"; +import { expectedShardsFromMatrix, latestShardAttempts, readShardAttempts, selectSummaryResults, stageShardResults } from "../lib/shard-results.ts"; +import { getVallyShardVerdict } from "../lib/verdict.ts"; + +function setup(t) { + const root = fs.mkdtempSync(path.join(os.tmpdir(), "eval-artifacts-")); + t.after(() => fs.rmSync(root, { recursive: true, force: true })); + return root; +} + +function invocation(root, name, { failed = false, summary = true, malformed = false, junit = true } = {}) { + const directory = path.join(root, name); + fs.mkdirSync(directory, { recursive: true }); + const records = [{ type: "trial-result", status: failed ? "error" : "success", itemId: name }]; + if (summary) records.push({ type: "run-summary", evals: [{ name, stimuliRun: 1, passed: !failed }] }); + fs.writeFileSync(path.join(directory, "results.jsonl"), records.map((entry) => JSON.stringify(entry)).join("\n") + (malformed ? '\n{"type":' : "\n")); + if (junit) fs.writeFileSync(path.join(directory, "eval-results.junit.xml"), + `${failed ? '' : ""}`); + return directory; +} + +function artifact(root, shard, attempt, options = {}) { + const source = invocation(root, `source-${shard}-${attempt}`, options); + const output = path.join(root, "download", `eval-result-${shard}-${attempt}`); + stageShardResults({ resultsRoot: source, outputDirectory: output, shardName: shard, attempt }); + const evidence = path.join(root, "job-attempts.json"); + const timeline = fs.existsSync(evidence) ? readJson(evidence) : { schemaVersion: 1, valid: true, attempts: {} }; + if (!timeline.attempts[shard] || timeline.attempts[shard].attempt < attempt) timeline.attempts[shard] = { attempt, complete: true }; + fs.writeFileSync(evidence, JSON.stringify(timeline)); + return output; +} + +function readJson(file) { + return JSON.parse(fs.readFileSync(file, "utf8")); +} + +function runCli(scriptName, args, environment = {}, cwd = undefined) { + const script = fileURLToPath(new URL(`../${scriptName}`, import.meta.url)); + const env = { ...process.env, ...environment }; + delete env.NODE_TEST_CONTEXT; + for (const key of Object.keys(env)) if (env[key] === undefined) delete env[key]; + const preload = []; + if (scriptName === "build-eval-summary.ts" && args.includes("--selected-root")) { + const root = path.dirname(args[args.indexOf("--results-root") + 1]); + fs.mkdirSync(root, { recursive: true }); + const mock = path.join(root, "rendering-offline.mjs"); + fs.writeFileSync(mock, `globalThis.fetch = () => { throw new Error("Summary rendering cannot contact a service"); };`); + delete env.SYSTEM_ACCESSTOKEN; + preload.push("--import", pathToFileURL(mock).href); + args = [...args, "--attempts-file", path.join(root, "job-attempts.json")]; + } + const child = spawnSync(process.execPath, ["--experimental-strip-types", ...preload, script, ...args], { + encoding: "utf8", env, cwd, timeout: 30_000, maxBuffer: 1024 * 1024, + }); + assert.ifError(child.error); + return child; +} + +function runSummary(root, shards, options = {}) { + const output = path.join(root, "summary", "eval-summary.md"); + const matrix = Object.hasOwn(options, "matrix") ? options.matrix : + JSON.stringify(Object.fromEntries(shards.map((shardName) => [shardName, { shardName }]))); + const child = runCli("build-eval-summary.ts", [ + "--results-root", path.join(root, "download"), "--selected-root", path.join(root, "selected"), + "--output-path", output, + ], { TF_BUILD: "true", EVAL_EXPECTED_MATRIX: matrix }); + return { + child, markdown: fs.readFileSync(output, "utf8"), + result: readJson(path.join(root, "summary", "eval-summary.json")), + index: readJson(path.join(root, "download", "shard-index.json")), + }; +} + +test("expected shards come from the full Prepare matrix, not arrived artifacts or matrix keys", () => { + const matrix = { secondJob: { shardName: "area_b", evalArgs: "-e b.eval.yaml" }, firstJob: { shardName: "area_a" } }; + assert.deepEqual(expectedShardsFromMatrix(matrix), ["area_a", "area_b"]); + assert.deepEqual(expectedShardsFromMatrix(JSON.stringify(matrix)), ["area_a", "area_b"]); + for (const invalid of [undefined, "not JSON", {}, [], null, true, 1, { a: null }, { a: { shardName: "../escape" } }, + { a: { shardName: "" } }, { a: { shardName: "x".repeat(201) } }, { a: { shardName: "same" }, b: { shardName: "same" } }]) { + assert.throws(() => expectedShardsFromMatrix(invalid)); + } +}); + +test("completed failing evaluations stage exact raw bytes and all JUnit, but no unrelated files", (t) => { + const root = setup(t); + const source = invocation(root, "source", { failed: true }); + fs.writeFileSync(path.join(source, "debug.log"), "not bundled"); + fs.writeFileSync(path.join(source, "mcp.dll"), "not bundled"); + fs.mkdirSync(path.join(source, "nested")); + fs.copyFileSync(path.join(source, "eval-results.junit.xml"), path.join(source, "nested", "eval-results.junit.xml")); + const output = path.join(root, "staged"); + const result = stageShardResults({ resultsRoot: source, outputDirectory: output, shardName: "area_test", attempt: 2 }); + assert.deepEqual(result, { schemaVersion: 1, shard: "area_test", attempt: 2, complete: true, trials: 1, reason: null }); + assert.deepEqual(readJson(path.join(output, "shard.json")), result); + assert.deepEqual(fs.readdirSync(output).sort(), ["junit", "results.jsonl", "shard.json"]); + assert.deepEqual(fs.readdirSync(path.join(output, "junit")), ["0.junit.xml", "1.junit.xml"]); + assert.deepEqual(fs.readFileSync(path.join(output, "results.jsonl")), fs.readFileSync(path.join(source, "results.jsonl"))); +}); + +test("missing, interrupted and corrupt invocations publish incomplete markers", (t) => { + const root = setup(t); + for (const [index, options] of [{ summary: false }, { malformed: true }, { junit: false }].entries()) { + const source = invocation(root, `source-${index}`, options); + const output = path.join(root, `stage-${index}`); + const result = stageShardResults({ resultsRoot: source, outputDirectory: output, shardName: "test", attempt: 1 }); + assert.equal(result.complete, false); + assert.equal(result.trials, 1); + assert.ok(result.reason); + assert.deepEqual(readJson(path.join(output, "shard.json")), result); + assert.deepEqual(fs.readFileSync(path.join(output, "results.jsonl")), fs.readFileSync(path.join(source, "results.jsonl"))); + } + const output = path.join(root, "empty"); + const empty = stageShardResults({ resultsRoot: path.join(root, "not-created"), outputDirectory: output, shardName: "test", attempt: 1 }); + assert.equal(empty.complete, false); + assert.equal(empty.trials, 0); + assert.deepEqual(fs.readdirSync(output).sort(), ["junit", "shard.json"]); +}); + +test("non-object JSONL and empty final summaries are incomplete, and a trial invalidates an earlier summary", (t) => { + const root = setup(t); + const suffixes = ["null", "[]", "42", '{"type":"run-summary","evals":[]}', + '{"type":"run-summary","evals":null}', '{"type":"trial-result","status":"success"}']; + for (const [index, suffix] of suffixes.entries()) { + const source = invocation(root, `source-${index}`); + fs.appendFileSync(path.join(source, "results.jsonl"), suffix + "\n"); + const result = stageShardResults({ resultsRoot: source, outputDirectory: path.join(root, `staged-${index}`), shardName: "test", attempt: 1 }); + assert.equal(result.complete, false); + } +}); + +test("untyped trial records, CRLF and blank lines retain the reference completion semantics", (t) => { + const root = setup(t); + const source = invocation(root, "source"); + fs.writeFileSync(path.join(source, "results.jsonl"), '\r\n{"status":"success"}\r\n \r\n{"type":"run-summary","evals":[{"name":"legacy"}]}\r\n'); + const result = stageShardResults({ resultsRoot: source, outputDirectory: path.join(root, "staged"), shardName: "test", attempt: 1 }); + assert.equal(result.complete, true); + assert.equal(result.trials, 1); +}); + +test("staging selects the same newest invocation as the shard verdict", (t) => { + const root = setup(t); + const old = invocation(root, "runs/old"); + const latest = invocation(root, "runs/new", { failed: true }); + fs.utimesSync(path.join(old, "results.jsonl"), 1, 1); + fs.utimesSync(path.join(latest, "results.jsonl"), 2, 2); + const output = path.join(root, "stage"); + assert.equal(getVallyShardVerdict({ resultsDir: path.join(root, "runs") }).passed, false); + stageShardResults({ resultsRoot: path.join(root, "runs"), outputDirectory: output, shardName: "test", attempt: 1 }); + assert.deepEqual(fs.readFileSync(path.join(output, "results.jsonl")), fs.readFileSync(path.join(latest, "results.jsonl"))); + assert.deepEqual(fs.readFileSync(path.join(output, "junit", "0.junit.xml")), fs.readFileSync(path.join(latest, "eval-results.junit.xml"))); +}); + +test("equal-mtime invocation ties use the verdict's path order, not localeCompare", (t) => { + const root = setup(t); + const first = invocation(root, "runs/Z"); + const last = invocation(root, "runs/a", { failed: true }); + for (const directory of [first, last]) fs.utimesSync(path.join(directory, "results.jsonl"), 1, 1); + const output = path.join(root, "stage"); + assert.equal(getVallyShardVerdict({ resultsDir: path.join(root, "runs") }).passed, false); + stageShardResults({ resultsRoot: path.join(root, "runs"), outputDirectory: output, shardName: "test", attempt: 1 }); + assert.deepEqual(fs.readFileSync(path.join(output, "results.jsonl")), fs.readFileSync(path.join(last, "results.jsonl"))); +}); + +test("a corrupt newest invocation never falls back to older complete output", (t) => { + const root = setup(t); + const old = invocation(root, "runs/old"); + const latest = invocation(root, "runs/new", { malformed: true }); + fs.utimesSync(path.join(old, "results.jsonl"), 1, 1); + fs.utimesSync(path.join(latest, "results.jsonl"), 2, 2); + const output = path.join(root, "stage"); + const result = stageShardResults({ resultsRoot: path.join(root, "runs"), outputDirectory: output, shardName: "test", attempt: 1 }); + assert.equal(result.complete, false); + assert.deepEqual(fs.readFileSync(path.join(output, "results.jsonl")), fs.readFileSync(path.join(latest, "results.jsonl"))); +}); + +test("staging requires an empty destination and does not delete existing contents", (t) => { + const root = setup(t); + const source = invocation(root, "source"); + const output = path.join(root, "staged"); + fs.mkdirSync(output); + fs.writeFileSync(path.join(output, "keep.txt"), "keep me"); + assert.throws(() => stageShardResults({ resultsRoot: source, outputDirectory: output, shardName: "test", attempt: 1 }), /must be empty/); + assert.deepEqual(fs.readdirSync(output), ["keep.txt"]); + assert.equal(fs.readFileSync(path.join(output, "keep.txt"), "utf8"), "keep me"); +}); + +test("invalid shard identities or attempts are rejected before creating an output", (t) => { + const root = setup(t); + const output = path.join(root, "staged"); + for (const shardName of ["", "../escape", "a/b", "a\\b", "a\n", "x".repeat(201), undefined]) { + assert.throws(() => stageShardResults({ resultsRoot: root, outputDirectory: output, shardName, attempt: 1 })); + } + for (const attempt of [0, -1, 1.5, NaN, Infinity, Number.MAX_SAFE_INTEGER + 1]) { + assert.throws(() => stageShardResults({ resultsRoot: root, outputDirectory: output, shardName: "test", attempt })); + } + assert.equal(fs.existsSync(output), false); +}); + +test("symbolic-link destinations are not treated as owned empty directories", (t) => { + const root = setup(t); + const source = invocation(root, "source"); + const target = path.join(root, "target"); + const output = path.join(root, "link"); + fs.mkdirSync(target); + fs.symlinkSync(target, output, "junction"); + assert.throws(() => stageShardResults({ resultsRoot: source, outputDirectory: output, shardName: "test", attempt: 1 }), /symbolic link/); + assert.deepEqual(fs.readdirSync(target), []); +}); + +test("oversized raw files are not read or copied, but JUnit and an incomplete marker survive", (t) => { + const root = setup(t); + const source = invocation(root, "source"); + const fd = fs.openSync(path.join(source, "results.jsonl"), "r+"); + try { fs.ftruncateSync(fd, 128 * 1024 * 1024 + 1); } finally { fs.closeSync(fd); } + const output = path.join(root, "stage"); + const result = stageShardResults({ resultsRoot: source, outputDirectory: output, shardName: "test", attempt: 1 }); + assert.equal(result.complete, false); + assert.match(result.reason, /oversized/); + assert.equal(fs.existsSync(path.join(output, "results.jsonl")), false); + assert.deepEqual(fs.readdirSync(path.join(output, "junit")), ["0.junit.xml"]); + assert.equal(readJson(path.join(output, "shard.json")).complete, false); +}); + +test("summary selects latest expected attempts once; completed failures remain eligible for publication", (t) => { + const root = setup(t); + artifact(root, "area_a", 1, { failed: true }); + artifact(root, "area_a", 2); + artifact(root, "area_b", 1, { failed: true }); + artifact(root, "unrequested", 9); + const { child, markdown, result, index } = runSummary(root, ["area_b", "area_a"]); + assert.equal(child.status, 0, child.stderr); + assert.match(child.stdout, /##vso\[task.setvariable variable=EvalSummaryComplete\]true/); + assert.deepEqual(result, { + schemaVersion: 1, complete: true, + shards: [{ shard: "area_a", attempt: 2, complete: true, reason: null }, { shard: "area_b", attempt: 1, complete: true, reason: null }], + totals: { scenarios: 2, failed: 1, skipped: 0 }, + }); + assert.match(markdown, /results — FAILED/); + assert.match(markdown, /\| area_a \| 2 \| Complete \|/); + assert.deepEqual(fs.readdirSync(path.join(root, "selected")).sort(), ["eval-result-area_a-2", "eval-result-area_b-1"]); + assert.deepEqual(index, { + schemaVersion: 1, complete: true, expectedShards: ["area_a", "area_b"], + attempts: [{ shard: "area_a", attempt: 2, directory: "eval-result-area_a-2" }, { shard: "area_b", attempt: 1, directory: "eval-result-area_b-1" }], + }); +}); + +test("a later incomplete attempt and a missing shard never fall back to complete older artifacts", (t) => { + const root = setup(t); + artifact(root, "area_a", 1); + artifact(root, "area_a", 2, { junit: false }); + const { child, markdown, result, index } = runSummary(root, ["area_a", "area_missing"]); + assert.equal(child.status, 1); + assert.match(child.stdout, /##vso\[task.setvariable variable=EvalSummaryComplete\]false/); + assert.equal(result.complete, false); + assert.equal(index.complete, false); + assert.match(markdown, /results — INCOMPLETE/); + assert.doesNotMatch(markdown, /results — PASSED/); + assert.equal(result.shards[0].attempt, 2); + assert.equal(result.shards[1].attempt, null); + assert.equal(result.totals.scenarios, 0); + assert.deepEqual(index.expectedShards, ["area_a", "area_missing"]); + assert.deepEqual(index.attempts, [{ shard: "area_a", attempt: 2, directory: "eval-result-area_a-2" }]); +}); + +test("attempt selection is numeric and includes the newest directory even when it is empty", (t) => { + const root = setup(t); + artifact(root, "area_a", 9); + fs.mkdirSync(path.join(root, "download", "eval-result-area_a-10")); + const { child, result, index } = runSummary(root, ["area_a"]); + assert.equal(child.status, 1); + assert.equal(result.shards[0].attempt, 10); + assert.equal(result.totals.scenarios, 0); + assert.equal(index.attempts[0].attempt, 10); + assert.deepEqual(fs.readdirSync(path.join(root, "selected")), ["eval-result-area_a-10"]); +}); + +test("zero parsed JUnit cases make that shard incomplete even when another shard has results", (t) => { + const root = setup(t); + const output = artifact(root, "area_a", 1); + fs.writeFileSync(path.join(output, "junit", "0.junit.xml"), ""); + artifact(root, "area_b", 1); + const { child, result, index, markdown } = runSummary(root, ["area_a", "area_b"]); + assert.equal(child.status, 1); + assert.equal(result.complete, false); + assert.equal(index.complete, false); + assert.equal(result.totals.scenarios, 1); + assert.match(result.shards[0].reason, /no evaluation testcases/); + assert.equal(result.shards[1].complete, true); + assert.match(markdown, /results — INCOMPLETE/); +}); + +test("bad completion metadata cannot hide available diagnostic JUnit", (t) => { + const root = setup(t); + const base = { schemaVersion: 1, shard: "area_a", attempt: 1, complete: true, trials: 1 }; + const markers = ["not JSON", "null", JSON.stringify({}), JSON.stringify({ ...base, schemaVersion: 2 }), + JSON.stringify({ ...base, shard: "other" }), JSON.stringify({ ...base, attempt: 2 }), + JSON.stringify({ ...base, complete: "true" }), JSON.stringify({ ...base, trials: 0 }), + JSON.stringify({ ...base, trials: 1.5 }), JSON.stringify({ ...base, trials: 2 }), + JSON.stringify({ ...base, padding: " ".repeat(64 * 1024) })]; + for (const [index, marker] of markers.entries()) { + const directory = path.join(root, `case-${index}`); + const output = artifact(directory, "area_a", 1); + fs.writeFileSync(path.join(output, "shard.json"), marker); + const selection = selectSummaryResults({ resultsRoot: path.join(directory, "download"), selectedRoot: path.join(directory, "selected"), expectedShards: ["area_a"] }); + assert.equal(selection.complete, false); + assert.deepEqual(fs.readdirSync(path.join(directory, "selected", "eval-result-area_a-1", "junit")), ["0.junit.xml"]); + } +}); + +test("missing or corrupted raw results override a complete marker without losing diagnostic cases", (t) => { + const root = setup(t); + for (const corrupt of [false, true]) { + const directory = path.join(root, String(corrupt)); + artifact(directory, "area_a", 1); + const output = artifact(directory, "area_a", 2); + if (corrupt) fs.appendFileSync(path.join(output, "results.jsonl"), "not JSON\n"); + else fs.unlinkSync(path.join(output, "results.jsonl")); + const { child, result, index } = runSummary(directory, ["area_a"]); + assert.equal(child.status, 1); + assert.equal(result.complete, false); + assert.equal(result.shards[0].attempt, 2); + assert.equal(result.totals.scenarios, 1); + assert.equal(index.complete, false); + } +}); + +test("legacy-layout JUnit is diagnostic only, and never causes fallback to an older attempt", (t) => { + const root = setup(t); + artifact(root, "area_a", 1); + const latest = path.join(root, "download", "eval-result-area_a-2"); + fs.mkdirSync(latest); + fs.writeFileSync(path.join(latest, "eval-results.junit.xml"), ''); + const { child, result, index, markdown } = runSummary(root, ["area_a"]); + assert.equal(child.status, 1); + assert.equal(result.complete, false); + assert.deepEqual(result.totals, { scenarios: 1, failed: 1, skipped: 0 }); + assert.equal(index.attempts[0].attempt, 2); + assert.match(markdown, /latest \(0\/1 runs passed\)/); + assert.equal(fs.existsSync(path.join(root, "selected", "eval-result-area_a-1")), false); +}); + +test("failed Prepare retains incomplete summary contracts without inferring expected shards", (t) => { + const root = setup(t); + for (const [index, matrix] of [undefined, "", "not JSON", "{}", "[]"].entries()) { + const directory = path.join(root, `case-${index}`); + artifact(directory, "arrived", 1); + const { child, markdown, result, index: shardIndex } = runSummary(directory, [], { matrix }); + assert.equal(child.status, 1); + assert.equal(result.complete, false); + assert.equal(result.totals.scenarios, 0); + assert.match(markdown, /results — INCOMPLETE/); + assert.match(markdown, /check the Prepare stage/); + assert.deepEqual(shardIndex, { schemaVersion: 1, complete: false, expectedShards: [], attempts: [] }); + assert.deepEqual(fs.readdirSync(path.join(directory, "selected")), []); + } +}); + +test("a missing artifact root reports every expected shard missing", (t) => { + const root = setup(t); + const { child, result, index } = runSummary(root, ["area_a", "area_b"]); + assert.equal(child.status, 1); + assert.equal(result.complete, false); + assert.equal(result.totals.scenarios, 0); + assert.ok(result.shards.every((entry) => entry.attempt === null)); + assert.deepEqual(index.expectedShards, ["area_a", "area_b"]); + assert.deepEqual(index.attempts, []); +}); + +test("summary cannot publish when timeline evidence is unavailable, invalid or corrupt", (t) => { + const root = setup(t); + for (const mode of ["invalid", "missing", "corrupt"]) { + const directory = path.join(root, mode); + artifact(directory, "area_a", 1); + const attempts = path.join(directory, "job-attempts.json"); + if (mode === "invalid") fs.writeFileSync(attempts, JSON.stringify({ valid: false })); + if (mode === "missing") fs.unlinkSync(attempts); + if (mode === "corrupt") fs.writeFileSync(attempts, "not JSON"); + const output = path.join(directory, "summary", "eval-summary.md"); + const child = runCli("build-eval-summary.ts", ["--results-root", path.join(directory, "download"), + "--selected-root", path.join(directory, "selected"), "--output-path", output], { + TF_BUILD: "true", EVAL_EXPECTED_MATRIX: JSON.stringify({ a: { shardName: "area_a" } }), + }); + assert.equal(child.status, 1); assert.match(child.stdout, /EvalSummaryComplete\]false/); + assert.equal(readJson(path.join(directory, "download", "shard-index.json")).complete, false); + assert.equal(readJson(path.join(directory, "summary", "eval-summary.json")).totals.scenarios, 1); + assert.match(fs.readFileSync(output, "utf8"), /timeline/); + assert.equal(fs.existsSync(path.join(directory, "summary", "job-attempts.json")), false, "Rendering never fabricates timeline evidence"); + } +}); + +test("selection rejects stale destinations and never treats zero expected shards as complete", (t) => { + const root = setup(t); + artifact(root, "area_a", 1); + const selectedRoot = path.join(root, "selected"); + fs.mkdirSync(selectedRoot); + fs.writeFileSync(path.join(selectedRoot, "keep.txt"), "keep me"); + assert.throws(() => selectSummaryResults({ resultsRoot: path.join(root, "download"), selectedRoot, expectedShards: ["area_a"] }), /must be empty/); + assert.equal(fs.readFileSync(path.join(selectedRoot, "keep.txt"), "utf8"), "keep me"); + assert.equal(fs.existsSync(path.join(root, "download", "shard-index.json")), false); + const selection = selectSummaryResults({ resultsRoot: path.join(root, "download"), selectedRoot: path.join(root, "empty-selection"), expectedShards: [] }); + assert.equal(selection.complete, false); + assert.equal(selection.shardInput.complete, false); + assert.deepEqual(selection.shardInput.attempts, []); +}); + +test("ambiguous numeric attempt names and invalid attempts are rejected", (t) => { + const root = setup(t); + for (const [index, names] of [["01", "1", "2"], ["0"], ["9007199254740992"]].entries()) { + const directory = path.join(root, `case-${index}`); + const resultsRoot = path.join(directory, "download"); + for (const name of names) fs.mkdirSync(path.join(resultsRoot, `eval-result-area_a-${name}`), { recursive: true }); + assert.throws(() => selectSummaryResults({ resultsRoot, selectedRoot: path.join(directory, "selected"), expectedShards: ["area_a"] }), /artifact attempt/i); + } +}); + +test("staging CLI logs counts and sanitized warnings, never the raw invalid record", (t) => { + const root = setup(t); + const source = invocation(root, "source"); + const privateText = "SYNTHETIC_RAW_RECORD_DO_NOT_LOG"; + fs.appendFileSync(path.join(source, "results.jsonl"), privateText); + const output = path.join(root, "stage"); + const child = runCli("lib/shard-results.ts", ["--results-root", source, "--output-directory", output, "--shard-name", "area_test", "--attempt", "3"]); + assert.equal(child.status, 0, child.stderr); + assert.match(child.stdout, /Staged area_test attempt 3: 1 trials; incomplete/); + assert.match(child.stdout, /##vso\[task.logissue type=warning\]/); + assert.ok(!(child.stdout + child.stderr).includes(privateText)); + assert.equal(readJson(path.join(output, "shard.json")).complete, false); +}); + +test("summary CLI without selected-root preserves legacy JUnit-only behavior and default output", (t) => { + const root = setup(t); + const results = path.join(root, "download", "eval-result-legacy"); + fs.mkdirSync(results, { recursive: true }); + fs.writeFileSync(path.join(results, "junit.xml"), ''); + const child = runCli("build-eval-summary.ts", ["--results-root", path.join(root, "download")], + { TF_BUILD: "true", EVAL_EXPECTED_MATRIX: "invalid matrix is irrelevant in legacy mode" }, root); + assert.equal(child.status, 0, child.stderr); + assert.match(fs.readFileSync(path.join(root, "eval-summary.md"), "utf8"), /results — PASSED/); + assert.match(child.stdout, /##vso\[task.uploadsummary\]/); + assert.doesNotMatch(child.stdout, /EvalSummaryComplete/); + assert.equal(fs.existsSync(path.join(root, "eval-summary.json")), false); + assert.equal(fs.existsSync(path.join(root, "download", "shard-index.json")), false); +}); + +test("a selected-root flag without a value cannot silently fall back to legacy mode", (t) => { + const root = setup(t); + const child = runCli("build-eval-summary.ts", ["--results-root", root, "--selected-root"], { TF_BUILD: "true" }, root); + assert.equal(child.status, 1); + assert.match(child.stderr, /Missing value for --selected-root/); + assert.match(child.stdout, /##vso\[task.setvariable variable=EvalSummaryComplete\]false/); + assert.equal(fs.existsSync(path.join(root, "eval-summary.md")), false); +}); + +test("invalid Prepare cannot reuse a stale selected directory", (t) => { + const root = setup(t); + const selected = path.join(root, "selected"); + fs.mkdirSync(selected); + fs.writeFileSync(path.join(selected, "keep.txt"), "keep me"); + const child = runCli("build-eval-summary.ts", ["--results-root", path.join(root, "download"), "--selected-root", selected], + { TF_BUILD: "true", EVAL_EXPECTED_MATRIX: "{}" }, root); + assert.equal(child.status, 1); + assert.match(child.stderr, /must be empty/); + assert.match(child.stdout, /##vso\[task.setvariable variable=EvalSummaryComplete\]false/); + assert.deepEqual(fs.readdirSync(selected), ["keep.txt"]); + assert.equal(fs.readFileSync(path.join(selected, "keep.txt"), "utf8"), "keep me"); +}); + +const timelineEnv = { SYSTEM_COLLECTIONURI: "https://dev.azure.com/azure-sdk/", SYSTEM_TEAMPROJECTID: "00000000-0000-4000-8000-000000000001", + BUILD_BUILDID: "1001", SYSTEM_ACCESSTOKEN: "fixture-token", EVAL_EXPECTED_MATRIX: '{"a":{"shardName":"a"}}' }; +const timelineRecord = { type: "Job", identifier: "Eval.RunShard.a", attempt: 1, state: "completed", result: "failed" }; + +test("timeline uses matrix identifiers, highest attempts and completed state, rejecting ambiguous attempts", () => { + const matrix = { a: { shardName: "a" } }, records = [timelineRecord, { ...timelineRecord, attempt: 2 }]; + assert.deepEqual(latestShardAttempts({ records }, matrix).attempts.a, { attempt: 2, complete: true }); + records[1].result = "canceled"; + assert.equal(latestShardAttempts({ records }, matrix).attempts.a.complete, false); + assert.throws(() => latestShardAttempts({ records: [] }, matrix)); + assert.throws(() => latestShardAttempts({ records }, {})); + assert.throws(() => latestShardAttempts({ records: [timelineRecord, { ...timelineRecord, result: "canceled" }] }, matrix), /Ambiguous/); +}); + +test("newer failed attempt with no artifact cannot adopt an older complete artifact", t => { + const root = setup(t); artifact(root, "a", 1); + for (const [index, jobAttempts] of [undefined, null, + { schemaVersion: 1, valid: true, attempts: { a: { attempt: 2, complete: true } } }, + { schemaVersion: 1, valid: true, attempts: { a: { attempt: 1, complete: false } } }, + { schemaVersion: 1, valid: false, attempts: {} }].entries()) { + const selected = selectSummaryResults({ resultsRoot: path.join(root, "download"), selectedRoot: path.join(root, `selection-${index}`), expectedShards: ["a"], jobAttempts }); + assert.equal(selected.complete, false); assert.match(selected.status[0].reason, /timeline/); + } +}); + +test("timeline reads retry transient failures only, with a fixed three-attempt budget", async () => { + const waits = []; let calls = 0; + const result = await readShardAttempts(timelineEnv, { wait: async value => waits.push(value), fetchImpl: async (url, options) => { + calls++; assert.equal(url.href, "https://dev.azure.com/azure-sdk/00000000-0000-4000-8000-000000000001/_apis/build/builds/1001/timeline?api-version=7.1"); + assert.equal(options.headers.authorization, "Bearer fixture-token"); assert.equal(options.redirect, "error"); + if (calls === 1) throw new Error("Lost response"); + if (calls === 2) return new Response("", { status: 503 }); + return Response.json({ records: [timelineRecord] }); + } }); + assert.equal(result.valid, true); assert.equal(calls, 3); assert.deepEqual(waits, [1000, 2000]); + waits.length = 0; calls = 0; + await readShardAttempts(timelineEnv, { wait: async value => waits.push(value), fetchImpl: async () => ++calls === 1 ? + new Response("", { status: 429, headers: { "retry-after": "5" } }) : Response.json({ records: [timelineRecord] }) }); + assert.equal(calls, 2); assert.deepEqual(waits, [5000]); + calls = 0; + await assert.rejects(readShardAttempts(timelineEnv, { wait: async () => {}, fetchImpl: async () => { calls++; throw new Error("Offline"); } })); + assert.equal(calls, 3); + for (const status of [302, 401, 403]) { + calls = 0; + await assert.rejects(readShardAttempts(timelineEnv, { wait: () => assert.fail("Permanent failures do not retry"), + fetchImpl: async () => { calls++; return new Response("", { status }); } })); + assert.equal(calls, 1); + } +}); + +test("invalid timeline configuration cannot send the build token to another endpoint", async () => { + for (const collection of ["https://dev.azure.com:444/azure-sdk/", "https://dev.azure.com.attacker.example/azure-sdk/", + "http://dev.azure.com/azure-sdk/", "https://user:password@dev.azure.com/azure-sdk/", "https://dev.azure.com/azure-sdk/?extra=1"]) { + await assert.rejects(readShardAttempts({ ...timelineEnv, SYSTEM_COLLECTIONURI: collection }, { fetchImpl: () => assert.fail("Invalid endpoint reached fetch") })); + } +}); \ No newline at end of file From 4a1d68ed40d860b29f3da1ad9252caa6cb1b425e Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:32:54 -0700 Subject: [PATCH 02/35] Sync eng/common directory with azure-sdk-tools for PR 17238 (#49580) * Use scoped Copilot App token for hermetic Vally evals * Reuse shared GitHub login for Copilot eval authentication * Replace all Vally eval PATs with shared GitHub App authentication * Remove PR guards from shared Copilot authentication * Use one tested Copilot token environment variable * Use default Azure owner for Copilot login --------- Co-authored-by: helen229 --- eng/common/pipelines/live-eval.yml | 2 - eng/common/pipelines/skill-eval.yml | 5 +- .../pipelines/templates/jobs/eval-shard.yml | 2 + .../pipelines/templates/steps/eval-invoke.yml | 12 ++-- .../templates/steps/login-to-copilot.yml | 11 ++++ .../templates/steps/login-to-github.yml | 8 ++- eng/common/pipelines/workflow-eval.yml | 5 +- eng/common/scripts/login-to-github.ps1 | 56 ++++++++++++++++--- 8 files changed, 80 insertions(+), 21 deletions(-) create mode 100644 eng/common/pipelines/templates/steps/login-to-copilot.yml diff --git a/eng/common/pipelines/live-eval.yml b/eng/common/pipelines/live-eval.yml index b471748d25e8..e18bafa65fb7 100644 --- a/eng/common/pipelines/live-eval.yml +++ b/eng/common/pipelines/live-eval.yml @@ -22,8 +22,6 @@ parameters: variables: # Managed-pool image selection (LINUXPOOL/LINUXVMIMAGE). Repo-local. - template: /eng/pipelines/templates/variables/image.yml - # Provides the secret azuresdk-copilot-github-pat, mapped into GITHUB_TOKEN in the invoke step. - - group: AzSDK_Eval_Variable_group extends: template: /eng/common/pipelines/templates/stages/archetype-eval.yml diff --git a/eng/common/pipelines/skill-eval.yml b/eng/common/pipelines/skill-eval.yml index 53b467039735..2b639ae5307c 100644 --- a/eng/common/pipelines/skill-eval.yml +++ b/eng/common/pipelines/skill-eval.yml @@ -12,6 +12,9 @@ trigger: - eng/common/pipelines/skill-eval.yml - eng/common/pipelines/templates/jobs/** - eng/common/pipelines/templates/steps/eval-invoke.yml + - eng/common/pipelines/templates/steps/login-to-copilot.yml + - eng/common/pipelines/templates/steps/login-to-github.yml + - eng/common/scripts/login-to-github.ps1 - eng/common/pipelines/templates/steps/eval-mcp-setup.yml - eng/common/pipelines/templates/steps/eval-publish-results.yml - eng/common/pipelines/templates/stages/archetype-eval.yml @@ -28,8 +31,6 @@ parameters: variables: # Managed-pool image selection (LINUXPOOL/LINUXVMIMAGE). Repo-local. - template: /eng/pipelines/templates/variables/image.yml - # Provides the secret azuresdk-copilot-github-pat, mapped into GITHUB_TOKEN in the invoke step. - - group: AzSDK_Eval_Variable_group extends: template: /eng/common/pipelines/templates/stages/archetype-eval.yml diff --git a/eng/common/pipelines/templates/jobs/eval-shard.yml b/eng/common/pipelines/templates/jobs/eval-shard.yml index 155f5c270d86..cb54e75584e8 100644 --- a/eng/common/pipelines/templates/jobs/eval-shard.yml +++ b/eng/common/pipelines/templates/jobs/eval-shard.yml @@ -114,6 +114,8 @@ jobs: env: EVAL_ARGS: $(evalArgs) + - template: /eng/common/pipelines/templates/steps/login-to-copilot.yml + # Runs the eval via the invoke template (auth-conditional in the common default). - template: ${{ parameters.evalInvokeTemplate }} parameters: diff --git a/eng/common/pipelines/templates/steps/eval-invoke.yml b/eng/common/pipelines/templates/steps/eval-invoke.yml index 2ebb5133f11d..191765af3f90 100644 --- a/eng/common/pipelines/templates/steps/eval-invoke.yml +++ b/eng/common/pipelines/templates/steps/eval-invoke.yml @@ -1,7 +1,7 @@ # Invokes `vally eval` for one shard. UseAzSdkAuthentication=false (default) runs the hermetic # node script directly. UseAzSdkAuthentication=true wraps the same run in AzureCLI@2 so a live # MCP's Azure DevOps calls inherit the service-connection identity. -# copilot-sdk authenticates the model session via GITHUB_TOKEN (from the linked eval variable group). +# The shard's login-to-copilot template supplies the executor and prompt-judge token. parameters: - name: vallyRoot @@ -32,9 +32,8 @@ steps: --shard-name "$(shardName)" \ --output-dir "$(Build.SourcesDirectory)/artifacts/vally-results/$(shardName)" \ --threshold ${{ parameters.threshold }} - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - env: - GITHUB_TOKEN: $(azuresdk-copilot-github-pat) + env: + COPILOT_GITHUB_TOKEN: $(COPILOT_GITHUB_TOKEN) - ${{ else }}: - script: | @@ -45,6 +44,5 @@ steps: --threshold ${{ parameters.threshold }} displayName: 'vally eval $(shardName)' workingDirectory: ${{ parameters.vallyRoot }} - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - env: - GITHUB_TOKEN: $(azuresdk-copilot-github-pat) + env: + COPILOT_GITHUB_TOKEN: $(COPILOT_GITHUB_TOKEN) diff --git a/eng/common/pipelines/templates/steps/login-to-copilot.yml b/eng/common/pipelines/templates/steps/login-to-copilot.yml new file mode 100644 index 000000000000..da1c12db9143 --- /dev/null +++ b/eng/common/pipelines/templates/steps/login-to-copilot.yml @@ -0,0 +1,11 @@ +# Shared GitHub App authentication for Vally executors and prompt judges. +steps: + - template: /eng/common/pipelines/templates/steps/login-to-github.yml + parameters: + VariableNamePrefix: COPILOT_GITHUB_TOKEN + TokenRequest: + repositories: + - ${{ split(variables['Build.Repository.Name'], '/')[1] }} + permissions: + organization_copilot_requests: read + metadata: read \ No newline at end of file diff --git a/eng/common/pipelines/templates/steps/login-to-github.yml b/eng/common/pipelines/templates/steps/login-to-github.yml index 5814417bb0bb..8da4155b8c54 100644 --- a/eng/common/pipelines/templates/steps/login-to-github.yml +++ b/eng/common/pipelines/templates/steps/login-to-github.yml @@ -14,6 +14,10 @@ parameters: - name: ExportAsOutputVariable type: boolean default: false +- name: TokenRequest + # Optional GitHub access-token request body restricting repositories and permissions. + type: object + default: {} - name: ScriptDirectory default: eng/common/scripts - name: Condition @@ -33,4 +37,6 @@ steps: -InstallationTokenOwners '${{ join(''',''', parameters.TokenOwners) }}' -VariableNamePrefix '${{ parameters.VariableNamePrefix }}' -AlwaysUseOwnerSuffix:$${{ parameters.AlwaysUseOwnerSuffix }} - -ExportAsOutputVariable:$${{ parameters.ExportAsOutputVariable }} \ No newline at end of file + -ExportAsOutputVariable:$${{ parameters.ExportAsOutputVariable }} + env: + GITHUB_TOKEN_REQUEST: ${{ convertToJson(parameters.TokenRequest) }} \ No newline at end of file diff --git a/eng/common/pipelines/workflow-eval.yml b/eng/common/pipelines/workflow-eval.yml index ac81e5781920..01f5dbecb6cf 100644 --- a/eng/common/pipelines/workflow-eval.yml +++ b/eng/common/pipelines/workflow-eval.yml @@ -15,6 +15,9 @@ trigger: - eng/common/pipelines/workflow-eval.yml - eng/common/pipelines/templates/jobs/** - eng/common/pipelines/templates/steps/eval-invoke.yml + - eng/common/pipelines/templates/steps/login-to-copilot.yml + - eng/common/pipelines/templates/steps/login-to-github.yml + - eng/common/scripts/login-to-github.ps1 - eng/common/pipelines/templates/steps/eval-mcp-setup.yml - eng/common/pipelines/templates/steps/eval-publish-results.yml - eng/common/pipelines/templates/stages/archetype-eval.yml @@ -31,8 +34,6 @@ parameters: variables: # Defines LINUXPOOL + LINUXVMIMAGE used by the archetype's jobs. - template: /eng/pipelines/templates/variables/image.yml - # Provides the secret azuresdk-copilot-github-pat, mapped into GITHUB_TOKEN in the invoke step. - - group: AzSDK_Eval_Variable_group extends: template: /eng/common/pipelines/templates/stages/archetype-eval.yml diff --git a/eng/common/scripts/login-to-github.ps1 b/eng/common/scripts/login-to-github.ps1 index c3553b91a208..6680f89bf2f0 100644 --- a/eng/common/scripts/login-to-github.ps1 +++ b/eng/common/scripts/login-to-github.ps1 @@ -29,6 +29,10 @@ When set in Azure DevOps, also exports the variable as an output variable (##vso[task.setvariable ...;isOutput=true]) for downstream jobs/stages. +.PARAMETER TokenRequest + Optional JSON object restricting the installation token's repositories and permissions. + Defaults to GITHUB_TOKEN_REQUEST. When omitted, retains the installation's default scope. + .OUTPUTS Sets environment variables in the current process and exports them to the CI system: - Azure DevOps: sets secret pipeline variables via ##vso logging commands @@ -43,7 +47,8 @@ param( [string[]] $InstallationTokenOwners = @("Azure"), [string] $VariableNamePrefix = "GH_TOKEN", [switch] $AlwaysUseOwnerSuffix, - [switch] $ExportAsOutputVariable + [switch] $ExportAsOutputVariable, + [string] $TokenRequest = $env:GITHUB_TOKEN_REQUEST ) $ErrorActionPreference = 'Stop' @@ -210,16 +215,53 @@ function New-GitHubInstallationToken { [Parameter(Mandatory)] [string] $Jwt, [Parameter(Mandatory)] [string] $InstallationId, [Parameter(Mandatory)] [string] $ApiBase, - [Parameter(Mandatory)] [string] $ApiVersion + [Parameter(Mandatory)] [string] $ApiVersion, + [hashtable] $TokenRequest = @{} ) $headers = Get-Headers -Jwt $Jwt -ApiVersion $ApiVersion $uri = "$ApiBase/app/installations/$InstallationId/access_tokens" - $resp = Invoke-RestMethod -Method Post -Headers $headers -Uri $uri -TimeoutSec 30 -MaximumRetryCount 3 - if (!$resp.token) { throw "Failed to obtain installation access token for installation $InstallationId." } - return $resp.token + $request = @{ + Method = 'Post' + Headers = $headers + Uri = $uri + TimeoutSec = 30 + MaximumRetryCount = 3 + } + if ($TokenRequest.Count -gt 0) { + $request.Body = ConvertTo-Json -InputObject $TokenRequest -Depth 5 -Compress + $request.ContentType = 'application/json' + } + + $resp = Invoke-RestMethod @request + $token = Get-PropertyValue -InputObject $resp -PropertyName 'token' + if (!$token) { throw "Failed to obtain installation access token for installation $InstallationId." } + + $requestedPermissions = Get-PropertyValue -InputObject $TokenRequest -PropertyName 'permissions' + if ($requestedPermissions) { + $grantedPermissions = Get-PropertyValue -InputObject $resp -PropertyName 'permissions' + foreach ($permission in $requestedPermissions.Keys) { + if ((Get-PropertyValue -InputObject $grantedPermissions -PropertyName $permission) -ne $requestedPermissions[$permission]) { + throw "Installation token did not grant requested permission '$permission': '$($requestedPermissions[$permission])'." + } + } + } + return $token } function Invoke-LoginToGitHub { + param( + [string] $TokenRequest, + [string] $VariableNamePrefix = 'GH_TOKEN' + ) + + $tokenRequestBody = @{} + if ($TokenRequest) { + $tokenRequestBody = ConvertFrom-Json -InputObject $TokenRequest -AsHashtable + if ($tokenRequestBody -isnot [System.Collections.IDictionary]) { + throw 'TokenRequest must be a JSON object.' + } + } + Write-Host "Generating GitHub App JWT by signing via Azure Key Vault (no key export)..." $jwt = New-GitHubAppJwt -VaultName $KeyVaultName -KeyName $KeyName -AppId $GitHubAppId @@ -232,7 +274,7 @@ function Invoke-LoginToGitHub { Write-Host "Installation ID resolved: $installationId" Write-Host "Exchanging JWT for installation access token..." - $installationToken = New-GitHubInstallationToken -Jwt $jwt -InstallationId $installationId -ApiBase $GitHubApiBaseUrl -ApiVersion $GitHubApiVersion + $installationToken = New-GitHubInstallationToken -Jwt $jwt -InstallationId $installationId -ApiBase $GitHubApiBaseUrl -ApiVersion $GitHubApiVersion -TokenRequest $tokenRequestBody $variableName = $VariableNamePrefix if ($AlwaysUseOwnerSuffix -or $InstallationTokenOwners.Count -gt 1) { @@ -278,4 +320,4 @@ if ($env:PESTER_TEST_RUN -eq 'true') { return } -Invoke-LoginToGitHub +Invoke-LoginToGitHub -TokenRequest $TokenRequest -VariableNamePrefix $VariableNamePrefix From cddd0ee8fe3c0fe2453ee38af71b9c4bf64ae7b5 Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 17:44:06 -0700 Subject: [PATCH 03/35] Update GPT-5.4 evals to GPT-6.1 Sol (#49615) Co-authored-by: helen229 --- .../azsdk-common-apiview-feedback-resolution/evals/eval.yaml | 2 +- .../evals/trigger.eval.yaml | 2 +- .../skills/azsdk-common-generate-sdk-locally/evals/eval.yaml | 2 +- .../azsdk-common-pipeline-analysis/evals/trigger.eval.yaml | 2 +- .../azsdk-common-pipeline-fixer/evals/trigger.eval.yaml | 4 ++-- .../skills/azsdk-common-prepare-release-plan/evals/eval.yaml | 2 +- .../evals/schedule-risk.eval.yaml | 2 +- .../azsdk-common-prepare-release-plan/evals/trigger.eval.yaml | 2 +- .github/skills/azsdk-common-sdk-release/evals/eval.yaml | 2 +- .../skills/azsdk-common-sdk-release/evals/trigger.eval.yaml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml b/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml index c464c3109cf2..22daf2988b0a 100644 --- a/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml +++ b/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml @@ -11,7 +11,7 @@ tags: config: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-apiview-feedback-resolution/evals/trigger.eval.yaml b/.github/skills/azsdk-common-apiview-feedback-resolution/evals/trigger.eval.yaml index 4baee7fd21fd..b7684015c912 100644 --- a/.github/skills/azsdk-common-apiview-feedback-resolution/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-apiview-feedback-resolution/evals/trigger.eval.yaml @@ -11,7 +11,7 @@ tags: defaults: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml b/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml index ca7f153a1cc7..3ce10aed89b6 100644 --- a/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml +++ b/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml @@ -11,7 +11,7 @@ tags: config: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-pipeline-analysis/evals/trigger.eval.yaml b/.github/skills/azsdk-common-pipeline-analysis/evals/trigger.eval.yaml index ec7e3d5c3dc7..68e32d14c6f9 100644 --- a/.github/skills/azsdk-common-pipeline-analysis/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-pipeline-analysis/evals/trigger.eval.yaml @@ -11,7 +11,7 @@ tags: defaults: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-pipeline-fixer/evals/trigger.eval.yaml b/.github/skills/azsdk-common-pipeline-fixer/evals/trigger.eval.yaml index 1c769875c35f..f87c05ffbde8 100644 --- a/.github/skills/azsdk-common-pipeline-fixer/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-pipeline-fixer/evals/trigger.eval.yaml @@ -11,11 +11,11 @@ tags: defaults: runs: 1 # Stimuli with a resolvable build reference (URL or build ID) make the agent - # run the full analyze→fix→verify workflow (~90-180s under gpt-5.4), + # run the full analyze→fix→verify workflow (~90-180s under gpt-6.1-sol), # so the per-stimulus cap matches the Vally scenario evals (5m). Non-build-ref # routing prompts still complete in ~10-20s. timeout: "5m" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml b/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml index ea7ed3db1968..548a435dd598 100644 --- a/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml +++ b/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml @@ -11,7 +11,7 @@ tags: config: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml b/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml index 145576bec41c..bc5e8a9bca30 100644 --- a/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml +++ b/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml @@ -11,7 +11,7 @@ tags: defaults: runs: 1 timeout: "120s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-prepare-release-plan/evals/trigger.eval.yaml b/.github/skills/azsdk-common-prepare-release-plan/evals/trigger.eval.yaml index 02141eaea26f..919bfa214259 100644 --- a/.github/skills/azsdk-common-prepare-release-plan/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-prepare-release-plan/evals/trigger.eval.yaml @@ -11,7 +11,7 @@ tags: defaults: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-sdk-release/evals/eval.yaml b/.github/skills/azsdk-common-sdk-release/evals/eval.yaml index e910ffc92eb8..e4604b9e2b05 100644 --- a/.github/skills/azsdk-common-sdk-release/evals/eval.yaml +++ b/.github/skills/azsdk-common-sdk-release/evals/eval.yaml @@ -11,7 +11,7 @@ tags: config: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: diff --git a/.github/skills/azsdk-common-sdk-release/evals/trigger.eval.yaml b/.github/skills/azsdk-common-sdk-release/evals/trigger.eval.yaml index a6fb4544cc66..629b6f6ebc01 100644 --- a/.github/skills/azsdk-common-sdk-release/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-sdk-release/evals/trigger.eval.yaml @@ -11,7 +11,7 @@ tags: defaults: runs: 1 timeout: "90s" - model: gpt-5.4 + model: gpt-6.1-sol executor: copilot-sdk scoring: From fa8851d0ccdcdbbad68b7bb39d837226c64dcecf Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 12:38:38 -0400 Subject: [PATCH 04/35] [AutoPR azure-mgmt-horizondb]-generated-from-SDK Generation - Python-6964259 (#49570) * Configurations: 'specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb/tspconfig.yaml', and CommitSHA: '90e63e5fe2c596e8bd807aad7dd9d62cee1746dd' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6964259 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md --------- Co-authored-by: azure-sdk Co-authored-by: Chenxi Jiang <119990644+ChenxiJiang333@users.noreply.github.com> --- .../azure-mgmt-horizondb/CHANGELOG.md | 209 + .../azure-mgmt-horizondb/_metadata.json | 10 +- sdk/horizondb/azure-mgmt-horizondb/api.md | 5764 +++++-- .../azure-mgmt-horizondb/api.metadata.yml | 5 +- .../apiview-properties.json | 425 +- .../azure/mgmt/horizondb/_client.py | 149 +- .../azure/mgmt/horizondb/_configuration.py | 4 +- .../azure/mgmt/horizondb/_utils/utils.py | 40 + .../azure/mgmt/horizondb/_validation.py | 66 - .../azure/mgmt/horizondb/_version.py | 2 +- .../azure/mgmt/horizondb/aio/_client.py | 151 +- .../mgmt/horizondb/aio/_configuration.py | 4 +- .../mgmt/horizondb/aio/operations/__init__.py | 58 +- .../horizondb/aio/operations/_operations.py | 10147 ++++++++++-- .../azure/mgmt/horizondb/models/__init__.py | 350 +- .../azure/mgmt/horizondb/models/_enums.py | 559 +- .../azure/mgmt/horizondb/models/_models.py | 4655 +++++- .../mgmt/horizondb/operations/__init__.py | 58 +- .../mgmt/horizondb/operations/_operations.py | 13116 +++++++++++++--- .../azure/mgmt/horizondb/types.py | 2106 ++- ...rators_list.py => authentications_list.py} | 10 +- .../generated_samples/capabilities_get.py | 41 + .../generated_samples/capabilities_list.py | 42 + ..._capture_capabilities_create_or_replace.py | 43 + ...hange_data_capture_capabilities_delete.py} | 12 +- ...> change_data_capture_capabilities_get.py} | 12 +- ... change_data_capture_capabilities_list.py} | 10 +- ...hange_data_capture_capabilities_update.py} | 14 +- ...apture_configurations_create_or_replace.py | 52 + ...ange_data_capture_configurations_delete.py | 42 + .../change_data_capture_configurations_get.py | 43 + ...change_data_capture_configurations_list.py | 43 + ...ange_data_capture_configurations_update.py | 44 + ..._capture_destinations_activate_identity.py | 50 + ...capture_destinations_create_or_replace.py} | 28 +- ...hange_data_capture_destinations_delete.py} | 12 +- .../change_data_capture_destinations_get.py | 43 + .../change_data_capture_destinations_list.py | 43 + ...hange_data_capture_destinations_update.py} | 15 +- .../clusters_create_or_replace.py | 58 + ...lace_cross_region_point_in_time_restore.py | 54 + ...ters_create_or_replace_minimum_defaults.py | 46 + ...create_or_replace_point_in_time_restore.py | 53 + ..._create_or_replace_with_data_encryption.py | 61 + .../generated_samples/clusters_delete.py | 8 +- .../generated_samples/clusters_failover.py | 42 + .../generated_samples/clusters_get.py | 8 +- ...t_after_pool_creation_on_empty_cluster.py} | 11 +- .../clusters_get_minimum_defaults.py | 42 + .../clusters_list_by_resource_group.py | 6 +- .../clusters_list_by_subscription.py | 4 +- .../generated_samples/clusters_update.py | 12 +- .../clusters_update_data_encryption.py | 49 + .../default_parameter_groups_get.py | 42 + ...st.py => default_parameter_groups_list.py} | 10 +- .../generated_samples/endpoints_get.py | 43 + .../endpoints_get_read_only.py | 43 + .../generated_samples/endpoints_list.py | 43 + ...py => firewall_rules_create_or_replace.py} | 18 +- .../firewall_rules_delete.py | 12 +- .../generated_samples/firewall_rules_get.py | 12 +- .../generated_samples/firewall_rules_list.py | 10 +- .../identity_assignments_create_or_replace.py | 50 + .../identity_assignments_delete.py | 43 + .../identity_assignments_get.py | 44 + .../identity_assignments_list.py | 44 + .../log_capture_configurations_get.py | 43 + .../log_capture_configurations_list.py | 43 + .../log_capture_configurations_update.py | 44 + .../generated_samples/log_files_get.py | 43 + .../generated_samples/log_files_list.py | 43 + .../log_files_list_download_urls.py | 43 + .../maintenance_events_apply_now.py | 44 + .../maintenance_events_get.py | 44 + .../maintenance_events_list.py | 44 + .../maintenance_events_list_with_filter.py | 44 + .../maintenance_events_reschedule.py | 45 + ..._entra_administrators_create_or_replace.py | 50 + .../microsoft_entra_administrators_delete.py | 42 + .../microsoft_entra_administrators_get.py | 43 + .../microsoft_entra_administrators_list.py | 43 + ...hentications_create_or_replace_disabled.py | 43 + ...thentications_create_or_replace_enabled.py | 43 + ...microsoft_entra_authentications_disable.py | 43 + .../microsoft_entra_authentications_enable.py | 43 + .../microsoft_entra_authentications_get.py | 42 + .../generated_samples/nodes_get.py | 44 + .../generated_samples/nodes_list.py | 44 + .../generated_samples/operations_list.py | 2 +- ... => parameter_groups_create_or_replace.py} | 27 +- .../parameter_groups_delete.py | 8 +- .../generated_samples/parameter_groups_get.py | 8 +- ...parameter_groups_list_by_resource_group.py | 6 +- .../parameter_groups_list_by_subscription.py | 4 +- .../parameter_groups_list_connections.py | 8 +- .../parameter_groups_update.py | 20 +- ...word_authentications_create_or_replace.py} | 17 +- .../password_authentications_disable.py | 43 + .../password_authentications_enable.py | 43 + .../password_authentications_get.py | 42 + ...password_authentications_reset_password.py | 43 + .../pools_create_or_replace.py | 56 + .../generated_samples/pools_delete.py | 42 + .../generated_samples/pools_get.py | 10 +- .../generated_samples/pools_list.py | 8 +- .../{clusters_start.py => pools_restart.py} | 8 +- .../{clusters_stop.py => pools_start.py} | 8 +- .../{clusters_restart.py => pools_stop.py} | 8 +- .../generated_samples/pools_update.py | 49 + .../pools_update_high_availability_mode.py | 44 + .../pools_update_parameter_group_default.py | 52 + .../pools_update_parameter_group_immediate.py | 52 + ...s_update_parameter_group_pending_reboot.py | 52 + ...endpoint_connections_approve_or_reject.py} | 16 +- .../private_endpoint_connections_delete.py | 10 +- .../private_endpoint_connections_get.py | 10 +- ...t_disconnected_after_last_pool_deletion.py | 43 + .../private_endpoint_connections_list.py | 8 +- .../private_link_resources_get.py | 10 +- .../private_link_resources_list.py | 8 +- ...izon_db_mgmt_authentications_operations.py | 30 + ...b_mgmt_authentications_operations_async.py | 31 + ...horizon_db_mgmt_capabilities_operations.py | 39 + ...n_db_mgmt_capabilities_operations_async.py | 40 + ...e_data_capture_capabilities_operations.py} | 65 +- ..._capture_capabilities_operations_async.py} | 65 +- ..._data_capture_configurations_operations.py | 115 + ...capture_configurations_operations_async.py | 122 + ...ge_data_capture_destinations_operations.py | 117 + ...a_capture_destinations_operations_async.py | 126 + ...est_horizon_db_mgmt_clusters_operations.py | 148 + ...rizon_db_mgmt_clusters_operations_async.py | 161 + ...gmt_default_parameter_groups_operations.py | 40 + ...fault_parameter_groups_operations_async.py | 41 + ...st_horizon_db_mgmt_endpoints_operations.py | 42 + ...izon_db_mgmt_endpoints_operations_async.py | 43 + ...izon_db_mgmt_firewall_rules_operations.py} | 18 +- ...b_mgmt_firewall_rules_operations_async.py} | 18 +- ...db_mgmt_identity_assignments_operations.py | 104 + ...t_identity_assignments_operations_async.py | 109 + ...t_log_capture_configurations_operations.py | 55 + ...capture_configurations_operations_async.py | 58 + ...st_horizon_db_mgmt_log_files_operations.py | 54 + ...izon_db_mgmt_log_files_operations_async.py | 55 + ...n_db_mgmt_maintenance_events_operations.py | 71 + ...gmt_maintenance_events_operations_async.py | 76 + ...rosoft_entra_administrators_operations.py} | 18 +- ..._entra_administrators_operations_async.py} | 18 +- ...rosoft_entra_authentications_operations.py | 67 + ..._entra_authentications_operations_async.py | 72 + ... test_horizon_db_mgmt_nodes_operations.py} | 12 +- ...horizon_db_mgmt_nodes_operations_async.py} | 12 +- ...on_db_mgmt_parameter_groups_operations.py} | 50 +- ...mgmt_parameter_groups_operations_async.py} | 50 +- ...gmt_password_authentications_operations.py | 72 + ...ssword_authentications_operations_async.py | 77 + ... test_horizon_db_mgmt_pools_operations.py} | 97 +- ...horizon_db_mgmt_pools_operations_async.py} | 101 +- ...rivate_endpoint_connections_operations.py} | 20 +- ..._endpoint_connections_operations_async.py} | 70 +- ...mgmt_private_link_resources_operations.py} | 10 +- ...rivate_link_resources_operations_async.py} | 10 +- .../azure-mgmt-horizondb/tsp-location.yaml | 2 +- 163 files changed, 36320 insertions(+), 7351 deletions(-) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/utils.py delete mode 100644 sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{administrators_list.py => authentications_list.py} (83%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_create_or_replace.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{replicas_delete.py => change_data_capture_capabilities_delete.py} (80%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{replicas_get.py => change_data_capture_capabilities_get.py} (80%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{parameter_groups_list_versions.py => change_data_capture_capabilities_list.py} (81%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{replicas_update.py => change_data_capture_capabilities_update.py} (77%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_create_or_replace.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_delete.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_update.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_activate_identity.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{clusters_create_or_update.py => change_data_capture_destinations_create_or_replace.py} (66%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{administrators_delete.py => change_data_capture_destinations_delete.py} (78%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_list.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{replicas_create_or_update.py => change_data_capture_destinations_update.py} (75%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_cross_region_point_in_time_restore.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_minimum_defaults.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_point_in_time_restore.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_with_data_encryption.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_failover.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{administrators_get.py => clusters_get_after_pool_creation_on_empty_cluster.py} (80%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_minimum_defaults.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update_data_encryption.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_get.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{replicas_list.py => default_parameter_groups_list.py} (82%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get_read_only.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_list.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{firewall_rules_create_or_update.py => firewall_rules_create_or_replace.py} (73%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_create_or_replace.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_delete.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_update.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list_download_urls.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_apply_now.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list_with_filter.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_reschedule.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_create_or_replace.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_delete.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_list.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_disabled.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_enabled.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_disable.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_enable.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_list.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{parameter_groups_create_or_update.py => parameter_groups_create_or_replace.py} (61%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{administrators_create_or_update.py => password_authentications_create_or_replace.py} (72%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_disable.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_enable.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_get.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_reset_password.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_create_or_replace.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_delete.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{clusters_start.py => pools_restart.py} (87%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{clusters_stop.py => pools_start.py} (87%) rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{clusters_restart.py => pools_stop.py} (88%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_high_availability_mode.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_default.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_immediate.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_pending_reboot.py rename sdk/horizondb/azure-mgmt-horizondb/generated_samples/{private_endpoint_connections_update_status.py => private_endpoint_connections_approve_or_reject.py} (72%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get_disconnected_after_last_pool_deletion.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations_async.py rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_replicas_operations.py => test_horizon_db_mgmt_change_data_capture_capabilities_operations.py} (65%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_replicas_operations_async.py => test_horizon_db_mgmt_change_data_capture_capabilities_operations_async.py} (66%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations_async.py rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_firewall_rules_operations.py => test_horizon_db_mgmt_firewall_rules_operations.py} (82%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_firewall_rules_operations_async.py => test_horizon_db_mgmt_firewall_rules_operations_async.py} (83%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations_async.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations_async.py rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_administrators_operations.py => test_horizon_db_mgmt_microsoft_entra_administrators_operations.py} (76%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_administrators_operations_async.py => test_horizon_db_mgmt_microsoft_entra_administrators_operations_async.py} (76%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations_async.py rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_pools_operations.py => test_horizon_db_mgmt_nodes_operations.py} (82%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_pools_operations_async.py => test_horizon_db_mgmt_nodes_operations_async.py} (82%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_parameter_groups_operations.py => test_horizon_db_mgmt_parameter_groups_operations.py} (73%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_parameter_groups_operations_async.py => test_horizon_db_mgmt_parameter_groups_operations_async.py} (74%) create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations.py create mode 100644 sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations_async.py rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_clusters_operations.py => test_horizon_db_mgmt_pools_operations.py} (52%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_clusters_operations_async.py => test_horizon_db_mgmt_pools_operations_async.py} (54%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py => test_horizon_db_mgmt_private_endpoint_connections_operations.py} (79%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py => test_horizon_db_mgmt_private_endpoint_connections_operations_async.py} (52%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_private_link_resources_operations.py => test_horizon_db_mgmt_private_link_resources_operations.py} (78%) rename sdk/horizondb/azure-mgmt-horizondb/generated_tests/{test_horizon_db_mgmt_horizon_db_private_link_resources_operations_async.py => test_horizon_db_mgmt_private_link_resources_operations_async.py} (78%) diff --git a/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md b/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md index c9415bcbc6d8..bb6359ceea93 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md +++ b/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md @@ -1,5 +1,214 @@ # Release History +## 1.0.0b3 (2026-10-15) + +### Features Added + + - Model `ParameterProperties` added property `default_value` + - Model `ParameterProperties` added property `value_source` + - Added model `ActivateChangeDataCaptureIdentityRequest` + - Added model `ActivateChangeDataCaptureIdentityResult` + - Added enum `AiModelManagementStatus` + - Added model `Authentication` + - Added enum `AuthenticationName` + - Added model `AuthenticationProperties` + - Added model `BackupProperties` + - Added model `BackupPropertiesForPatchUpdate` + - Added model `Capability` + - Added model `CapabilityProperties` + - Added model `ChangeDataCaptureCapability` + - Added model `ChangeDataCaptureCapabilityForPatchUpdate` + - Added model `ChangeDataCaptureCapabilityProperties` + - Added model `ChangeDataCaptureCapabilityPropertiesForPatchUpdate` + - Added model `ChangeDataCaptureConfiguration` + - Added model `ChangeDataCaptureConfigurationForPatchUpdate` + - Added model `ChangeDataCaptureConfigurationProperties` + - Added model `ChangeDataCaptureConfigurationPropertiesForPatchUpdate` + - Added enum `ChangeDataCaptureDesiredState` + - Added model `ChangeDataCaptureDestination` + - Added model `ChangeDataCaptureDestinationDetails` + - Added enum `ChangeDataCaptureDestinationEffectiveState` + - Added model `ChangeDataCaptureDestinationForPatchUpdate` + - Added model `ChangeDataCaptureDestinationProperties` + - Added model `ChangeDataCaptureDestinationPropertiesForPatchUpdate` + - Added enum `ChangeDataCaptureDestinationType` + - Added enum `ChangeDataCaptureEffectiveState` + - Added enum `ChangeDataCaptureEngineConfigurationState` + - Added enum `ChangeDataCaptureExtensionState` + - Added model `ChangeDataCaptureExtensionStatus` + - Added enum `ChangeDataCaptureIdentityActivationState` + - Added model `ChangeDataCaptureIdentityAssignmentProperties` + - Added enum `ChangeDataCaptureIdentityAssignmentState` + - Added enum `ChangeDataCaptureIdentityValidationState` + - Added model `ChangeDataCapturePrerequisiteStatus` + - Added enum `ChangeDataCaptureProtocol` + - Added enum `ChangeDataCaptureReadWriteEndpointState` + - Added enum `ChangeDataCaptureReplicationArchitecture` + - Added enum `ChangeDataCaptureReplicationState` + - Added model `ChangeDataCaptureReplicationStatus` + - Added model `ChangeDataCaptureStatus` + - Added enum `ChangeDataCaptureTopologyBindingState` + - Added model `ChangeDataCaptureTopologyBindingStatus` + - Added enum `ChangeDataCaptureUsageProfile` + - Added model `Cluster` + - Added model `ClusterCapability` + - Added enum `ClusterCreateMode` + - Added model `ClusterFeatureCapability` + - Added model `ClusterForPatchUpdate` + - Added model `ClusterProperties` + - Added model `ClusterPropertiesForPatchUpdate` + - Added enum `ClusterState` + - Added model `ComputeGenerationCapability` + - Added model `ComputeModelCapability` + - Added model `ComputeProcessorCapability` + - Added enum `ComputeProcessorType` + - Added model `ComputeSizeCapability` + - Added model `DefaultParameterGroup` + - Added model `DefaultParameterGroupProperties` + - Added model `Endpoint` + - Added model `EndpointProperties` + - Added enum `EndpointRole` + - Added enum `EndpointScope` + - Added model `FabricDestinationDetails` + - Added model `FirewallRule` + - Added model `FirewallRuleProperties` + - Added enum `GeoRedundancyState` + - Added model `HorizonDbClusterDataEncryption` + - Added model `HorizonDbClusterDataEncryptionForPatchUpdate` + - Added enum `HorizonDbClusterDataEncryptionType` + - Added enum `HorizonDbClusterEncryptionKeyStatus` + - Added enum `HorizonDbClusterIdentityType` + - Added model `HorizonDbClusterManagedServiceIdentity` + - Added model `IdentityAssignment` + - Added model `IdentityValidationStatus` + - Added model `LogCaptureConfiguration` + - Added model `LogCaptureConfigurationForPatchUpdate` + - Added model `LogCaptureConfigurationProperties` + - Added model `LogCaptureConfigurationPropertiesForPatchUpdate` + - Added enum `LogCaptureState` + - Added model `LogFile` + - Added model `LogFileDownloadUrl` + - Added model `LogFileProperties` + - Added enum `LogFileType` + - Added model `MaintenanceEvent` + - Added model `MaintenanceEventActionResponse` + - Added model `MaintenanceEventProperties` + - Added model `MaintenanceEventRescheduleRequest` + - Added enum `MaintenanceEventStatus` + - Added enum `MaintenanceType` + - Added model `MicrosoftEntraAdministrator` + - Added model `MicrosoftEntraAdministratorAdd` + - Added model `MicrosoftEntraAdministratorProperties` + - Added model `MicrosoftEntraAdministratorPropertiesForAdd` + - Added model `MicrosoftEntraAuthentication` + - Added model `MicrosoftEntraAuthenticationForPatchUpdate` + - Added enum `MicrosoftEntraAuthenticationName` + - Added model `MicrosoftEntraAuthenticationProperties` + - Added model `MicrosoftEntraAuthenticationPropertiesForPatchUpdate` + - Added model `NetworkForPatchUpdate` + - Added model `Node` + - Added model `NodeProperties` + - Added enum `NodeRole` + - Added enum `ParameterApplyMethod` + - Added model `ParameterGroup` + - Added model `ParameterGroupConnectionProperties` + - Added model `ParameterGroupForPatchUpdate` + - Added model `ParameterGroupProperties` + - Added model `ParameterGroupPropertiesForPatchUpdate` + - Added enum `ParameterGroupSyncStatus` + - Added enum `ParameterValueSource` + - Added model `PasswordAuthentication` + - Added model `PasswordAuthenticationForPatchUpdate` + - Added enum `PasswordAuthenticationName` + - Added model `PasswordAuthenticationProperties` + - Added model `PasswordAuthenticationPropertiesForPatchUpdate` + - Added model `Pool` + - Added model `PoolCapability` + - Added model `PoolComputeModel` + - Added model `PoolComputeModelForPatchUpdate` + - Added enum `PoolComputeModelType` + - Added model `PoolFeatureCapability` + - Added model `PoolForPatchUpdate` + - Added model `PoolHighAvailability` + - Added enum `PoolHighAvailabilityMode` + - Added model `PoolHighAvailabilityPatch` + - Added model `PoolParameterGroupReference` + - Added model `PoolParameterGroupReferenceForPatchUpdate` + - Added model `PoolProperties` + - Added model `PoolPropertiesForPatchUpdate` + - Added enum `PoolState` + - Added enum `PostgreSqlCapabilityVersion` + - Added enum `PostgreSqlVersion` + - Added model `PostgreSqlVersionCapability` + - Added model `PrivateLinkResource` + - Added model `ProvisionedComputeModelCapability` + - Added model `ReadWritePoolProperties` + - Added enum `ScheduledMaintenanceManagementType` + - Added model `ScheduledMaintenanceProperties` + - Added model `ScheduledMaintenancePropertiesForPatchUpdate` + - Added model `SystemScheduledMaintenanceProperties` + - Added operation group `AuthenticationsOperations` + - Added operation group `CapabilitiesOperations` + - Added operation group `ChangeDataCaptureCapabilitiesOperations` + - Added operation group `ChangeDataCaptureConfigurationsOperations` + - Added operation group `ChangeDataCaptureDestinationsOperations` + - Added operation group `DefaultParameterGroupsOperations` + - Added operation group `EndpointsOperations` + - Added operation group `IdentityAssignmentsOperations` + - Added operation group `LogCaptureConfigurationsOperations` + - Added operation group `LogFilesOperations` + - Added operation group `MaintenanceEventsOperations` + - Added operation group `MicrosoftEntraAdministratorsOperations` + - Added operation group `MicrosoftEntraAuthenticationsOperations` + - Added operation group `NodesOperations` + - Added operation group `PasswordAuthenticationsOperations` + +### Breaking Changes + + - Model `Network` deleted or renamed its instance variable `public_network_access` + - Deleted or renamed model `CreateModeCluster` + - Deleted or renamed model `CreateModePool` + - Deleted or renamed model `HorizonDbAdministrator` + - Deleted or renamed model `HorizonDbAdministratorAdd` + - Deleted or renamed model `HorizonDbAdministratorProperties` + - Deleted or renamed model `HorizonDbAdministratorPropertiesForAdd` + - Deleted or renamed model `HorizonDbCluster` + - Deleted or renamed model `HorizonDbClusterAuthConfig` + - Deleted or renamed model `HorizonDbClusterForPatchUpdate` + - Deleted or renamed model `HorizonDbClusterMirroring` + - Deleted or renamed model `HorizonDbClusterParameterGroupConnectionProperties` + - Deleted or renamed model `HorizonDbClusterProperties` + - Deleted or renamed model `HorizonDbClusterPropertiesForPatchUpdate` + - Deleted or renamed model `HorizonDbComputeModel` + - Deleted or renamed model `HorizonDbComputeModelType` + - Deleted or renamed model `HorizonDbFirewallRule` + - Deleted or renamed model `HorizonDbFirewallRuleProperties` + - Deleted or renamed model `HorizonDbParameterGroup` + - Deleted or renamed model `HorizonDbParameterGroupConnectionProperties` + - Deleted or renamed model `HorizonDbParameterGroupForPatchUpdate` + - Deleted or renamed model `HorizonDbParameterGroupProperties` + - Deleted or renamed model `HorizonDbParameterGroupPropertiesForPatchUpdate` + - Deleted or renamed model `HorizonDbPool` + - Deleted or renamed model `HorizonDbPoolProperties` + - Deleted or renamed model `HorizonDbPrivateLinkResource` + - Deleted or renamed model `HorizonDbReplica` + - Deleted or renamed model `HorizonDbReplicaForPatchUpdate` + - Deleted or renamed model `HorizonDbReplicaProperties` + - Deleted or renamed model `HorizonDbReplicaPropertiesForPatchUpdate` + - Deleted or renamed model `ManagedServiceIdentity` + - Deleted or renamed model `ManagedServiceIdentityType` + - Deleted or renamed model `ReplicaRole` + - Deleted or renamed model `State` + - Deleted or renamed model `ZonePlacementPolicy` + - Deleted or renamed operation group `HorizonDbAdministratorsOperations` + - Deleted or renamed operation group `HorizonDbReplicasOperations` + - Renamed operation group `HorizonDbClustersOperations` to `ClustersOperations` + - Renamed operation group `HorizonDbFirewallRulesOperations` to `FirewallRulesOperations` + - Renamed operation group `HorizonDbParameterGroupsOperations` to `ParameterGroupsOperations` + - Renamed operation group `HorizonDbPoolsOperations` to `PoolsOperations` + - Renamed operation group `HorizonDbPrivateEndpointConnectionsOperations` to `PrivateEndpointConnectionsOperations` + - Renamed operation group `HorizonDbPrivateLinkResourcesOperations` to `PrivateLinkResourcesOperations` + ## 1.0.0b2 (2026-08-20) ### Features Added diff --git a/sdk/horizondb/azure-mgmt-horizondb/_metadata.json b/sdk/horizondb/azure-mgmt-horizondb/_metadata.json index a3dab37ec4cc..1ab3e828929a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/_metadata.json +++ b/sdk/horizondb/azure-mgmt-horizondb/_metadata.json @@ -1,11 +1,11 @@ { - "apiVersion": "2026-05-01-preview", + "apiVersion": "2026-10-01-preview", "apiVersions": { - "Microsoft.HorizonDb": "2026-05-01-preview" + "Microsoft.HorizonDb": "2026-10-01-preview" }, - "commit": "f868cf045de6223d605ed9b7bf2a9ce2947c808f", + "commit": "90e63e5fe2c596e8bd807aad7dd9d62cee1746dd", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb", - "emitterVersion": "0.63.5", - "httpClientPythonVersion": "^0.36.0" + "emitterVersion": "0.63.10", + "httpClientPythonVersion": "0.39.0" } \ No newline at end of file diff --git a/sdk/horizondb/azure-mgmt-horizondb/api.md b/sdk/horizondb/azure-mgmt-horizondb/api.md index dc547cdd3eaf..b498141cfb80 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/api.md +++ b/sdk/horizondb/azure-mgmt-horizondb/api.md @@ -2,15 +2,28 @@ namespace azure.mgmt.horizondb class azure.mgmt.horizondb.HorizonDBMgmtClient: implements ContextManager - horizon_db_administrators: HorizonDbAdministratorsOperations - horizon_db_clusters: HorizonDbClustersOperations - horizon_db_firewall_rules: HorizonDbFirewallRulesOperations - horizon_db_parameter_groups: HorizonDbParameterGroupsOperations - horizon_db_pools: HorizonDbPoolsOperations - horizon_db_private_endpoint_connections: HorizonDbPrivateEndpointConnectionsOperations - horizon_db_private_link_resources: HorizonDbPrivateLinkResourcesOperations - horizon_db_replicas: HorizonDbReplicasOperations + authentications: AuthenticationsOperations + capabilities: CapabilitiesOperations + change_data_capture_capabilities: ChangeDataCaptureCapabilitiesOperations + change_data_capture_configurations: ChangeDataCaptureConfigurationsOperations + change_data_capture_destinations: ChangeDataCaptureDestinationsOperations + clusters: ClustersOperations + default_parameter_groups: DefaultParameterGroupsOperations + endpoints: EndpointsOperations + firewall_rules: FirewallRulesOperations + identity_assignments: IdentityAssignmentsOperations + log_capture_configurations: LogCaptureConfigurationsOperations + log_files: LogFilesOperations + maintenance_events: MaintenanceEventsOperations + microsoft_entra_administrators: MicrosoftEntraAdministratorsOperations + microsoft_entra_authentications: MicrosoftEntraAuthenticationsOperations + nodes: NodesOperations operations: Operations + parameter_groups: ParameterGroupsOperations + password_authentications: PasswordAuthenticationsOperations + pools: PoolsOperations + private_endpoint_connections: PrivateEndpointConnectionsOperations + private_link_resources: PrivateLinkResourcesOperations def __init__( self, @@ -38,15 +51,28 @@ namespace azure.mgmt.horizondb namespace azure.mgmt.horizondb.aio class azure.mgmt.horizondb.aio.HorizonDBMgmtClient: implements AsyncContextManager - horizon_db_administrators: HorizonDbAdministratorsOperations - horizon_db_clusters: HorizonDbClustersOperations - horizon_db_firewall_rules: HorizonDbFirewallRulesOperations - horizon_db_parameter_groups: HorizonDbParameterGroupsOperations - horizon_db_pools: HorizonDbPoolsOperations - horizon_db_private_endpoint_connections: HorizonDbPrivateEndpointConnectionsOperations - horizon_db_private_link_resources: HorizonDbPrivateLinkResourcesOperations - horizon_db_replicas: HorizonDbReplicasOperations + authentications: AuthenticationsOperations + capabilities: CapabilitiesOperations + change_data_capture_capabilities: ChangeDataCaptureCapabilitiesOperations + change_data_capture_configurations: ChangeDataCaptureConfigurationsOperations + change_data_capture_destinations: ChangeDataCaptureDestinationsOperations + clusters: ClustersOperations + default_parameter_groups: DefaultParameterGroupsOperations + endpoints: EndpointsOperations + firewall_rules: FirewallRulesOperations + identity_assignments: IdentityAssignmentsOperations + log_capture_configurations: LogCaptureConfigurationsOperations + log_files: LogFilesOperations + maintenance_events: MaintenanceEventsOperations + microsoft_entra_administrators: MicrosoftEntraAdministratorsOperations + microsoft_entra_authentications: MicrosoftEntraAuthenticationsOperations + nodes: NodesOperations operations: Operations + parameter_groups: ParameterGroupsOperations + password_authentications: PasswordAuthenticationsOperations + pools: PoolsOperations + private_endpoint_connections: PrivateEndpointConnectionsOperations + private_link_resources: PrivateLinkResourcesOperations def __init__( self, @@ -73,7 +99,7 @@ namespace azure.mgmt.horizondb.aio namespace azure.mgmt.horizondb.aio.operations - class azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations: + class azure.mgmt.horizondb.aio.operations.AuthenticationsOperations: def __init__( self, @@ -81,73 +107,39 @@ namespace azure.mgmt.horizondb.aio.operations **kwargs ) -> None: ... - @overload - async def begin_create_or_update( + @distributed_trace + def list( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: HorizonDbAdministratorAdd, - *, - content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbAdministrator]: ... + ) -> AsyncItemPaged[Authentication]: ... - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - object_id: str, - resource: HorizonDbAdministratorAdd, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[HorizonDbAdministrator]: ... - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - object_id: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[HorizonDbAdministrator]: ... + class azure.mgmt.horizondb.aio.operations.CapabilitiesOperations: - @distributed_trace_async - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id']}, api_versions_list=['2026-05-01-preview']) - async def begin_delete( + def __init__( self, - resource_group_name: str, - cluster_name: str, - object_id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + *args, + **kwargs + ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id', 'accept']}, api_versions_list=['2026-05-01-preview']) async def get( self, - resource_group_name: str, - cluster_name: str, - object_id: str, + location: str, **kwargs: Any - ) -> HorizonDbAdministrator: ... + ) -> Capability: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) def list( self, - resource_group_name: str, - cluster_name: str, + location: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbAdministrator]: ... + ) -> AsyncItemPaged[Capability]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations: + class azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations: def __init__( self, @@ -156,29 +148,29 @@ namespace azure.mgmt.horizondb.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: HorizonDbCluster, + resource: ChangeDataCaptureCapability, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbCluster]: ... + ) -> AsyncLROPoller[ChangeDataCaptureCapability]: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: HorizonDbCluster, + resource: ChangeDataCaptureCapability, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbCluster]: ... + ) -> AsyncLROPoller[ChangeDataCaptureCapability]: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, @@ -186,7 +178,7 @@ namespace azure.mgmt.horizondb.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbCluster]: ... + ) -> AsyncLROPoller[ChangeDataCaptureCapability]: ... @distributed_trace_async async def begin_delete( @@ -196,54 +188,27 @@ namespace azure.mgmt.horizondb.aio.operations **kwargs: Any ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) - async def begin_restart( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) - async def begin_start( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) - async def begin_stop( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - @overload async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: HorizonDbClusterForPatchUpdate, + properties: ChangeDataCaptureCapabilityForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbCluster]: ... + ) -> AsyncLROPoller[ChangeDataCaptureCapability]: ... @overload async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: HorizonDbClusterForPatchUpdate, + properties: ChangeDataCaptureCapabilityForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbCluster]: ... + ) -> AsyncLROPoller[ChangeDataCaptureCapability]: ... @overload async def begin_update( @@ -254,7 +219,7 @@ namespace azure.mgmt.horizondb.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbCluster]: ... + ) -> AsyncLROPoller[ChangeDataCaptureCapability]: ... @distributed_trace_async async def get( @@ -262,20 +227,18 @@ namespace azure.mgmt.horizondb.aio.operations resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> HorizonDbCluster: ... + ) -> ChangeDataCaptureCapability: ... @distributed_trace - def list_by_resource_group( + def list( self, resource_group_name: str, + cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbCluster]: ... - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[HorizonDbCluster]: ... + ) -> AsyncItemPaged[ChangeDataCaptureCapability]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations: + class azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations: def __init__( self, @@ -284,75 +247,105 @@ namespace azure.mgmt.horizondb.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: HorizonDbFirewallRule, + configuration_name: str, + resource: ChangeDataCaptureConfiguration, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbFirewallRule]: ... + ) -> AsyncLROPoller[ChangeDataCaptureConfiguration]: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: HorizonDbFirewallRule, + configuration_name: str, + resource: ChangeDataCaptureConfiguration, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbFirewallRule]: ... + ) -> AsyncLROPoller[ChangeDataCaptureConfiguration]: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, + configuration_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbFirewallRule]: ... + ) -> AsyncLROPoller[ChangeDataCaptureConfiguration]: ... @distributed_trace_async async def begin_delete( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, + configuration_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: ChangeDataCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ChangeDataCaptureConfiguration]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: ChangeDataCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ChangeDataCaptureConfiguration]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ChangeDataCaptureConfiguration]: ... + @distributed_trace_async async def get( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, + configuration_name: str, **kwargs: Any - ) -> HorizonDbFirewallRule: ... + ) -> ChangeDataCaptureConfiguration: ... @distributed_trace def list( self, resource_group_name: str, cluster_name: str, - pool_name: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbFirewallRule]: ... + ) -> AsyncItemPaged[ChangeDataCaptureConfiguration]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations: + class azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations: def __init__( self, @@ -361,43 +354,89 @@ namespace azure.mgmt.horizondb.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_activate_identity( self, resource_group_name: str, - parameter_group_name: str, - resource: HorizonDbParameterGroup, + cluster_name: str, + destination_name: str, + body: ActivateChangeDataCaptureIdentityRequest, *, content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, **kwargs: Any - ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + ) -> AsyncLROPoller[ActivateChangeDataCaptureIdentityResult]: ... @overload - async def begin_create_or_update( + async def begin_activate_identity( self, resource_group_name: str, - parameter_group_name: str, - resource: HorizonDbParameterGroup, + cluster_name: str, + destination_name: str, + body: ActivateChangeDataCaptureIdentityRequest, *, content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, **kwargs: Any - ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + ) -> AsyncLROPoller[ActivateChangeDataCaptureIdentityResult]: ... @overload - async def begin_create_or_update( + async def begin_activate_identity( self, resource_group_name: str, - parameter_group_name: str, + cluster_name: str, + destination_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[ActivateChangeDataCaptureIdentityResult]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ChangeDataCaptureDestination]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ChangeDataCaptureDestination]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + ) -> AsyncLROPoller[ChangeDataCaptureDestination]: ... @distributed_trace_async async def begin_delete( self, resource_group_name: str, - parameter_group_name: str, + cluster_name: str, + destination_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @@ -405,73 +444,57 @@ namespace azure.mgmt.horizondb.aio.operations async def begin_update( self, resource_group_name: str, - parameter_group_name: str, - properties: HorizonDbParameterGroupForPatchUpdate, + cluster_name: str, + destination_name: str, + properties: ChangeDataCaptureDestinationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + ) -> AsyncLROPoller[ChangeDataCaptureDestination]: ... @overload async def begin_update( self, resource_group_name: str, - parameter_group_name: str, - properties: HorizonDbParameterGroupForPatchUpdate, + cluster_name: str, + destination_name: str, + properties: ChangeDataCaptureDestinationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + ) -> AsyncLROPoller[ChangeDataCaptureDestination]: ... @overload async def begin_update( self, resource_group_name: str, - parameter_group_name: str, + cluster_name: str, + destination_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + ) -> AsyncLROPoller[ChangeDataCaptureDestination]: ... @distributed_trace_async async def get( self, resource_group_name: str, - parameter_group_name: str, - **kwargs: Any - ) -> HorizonDbParameterGroup: ... - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncItemPaged[HorizonDbParameterGroup]: ... - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[HorizonDbParameterGroup]: ... - - @distributed_trace - def list_connections( - self, - resource_group_name: str, - parameter_group_name: str, + cluster_name: str, + destination_name: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbParameterGroupConnectionProperties]: ... + ) -> ChangeDataCaptureDestination: ... @distributed_trace - def list_versions( + def list( self, resource_group_name: str, - parameter_group_name: str, - *, - version: Optional[int] = ..., + cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbParameterGroup]: ... + ) -> AsyncItemPaged[ChangeDataCaptureDestination]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbPoolsOperations: + class azure.mgmt.horizondb.aio.operations.ClustersOperations: def __init__( self, @@ -479,96 +502,132 @@ namespace azure.mgmt.horizondb.aio.operations **kwargs ) -> None: ... - @distributed_trace_async - async def get( + @overload + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, + resource: Cluster, + *, + content_type: str = "application/json", **kwargs: Any - ) -> HorizonDbPool: ... + ) -> AsyncLROPoller[Cluster]: ... - @distributed_trace - def list( + @overload + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, + resource: Cluster, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[HorizonDbPool]: ... - + ) -> AsyncLROPoller[Cluster]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations: - - def __init__( + @overload + async def begin_create_or_replace( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Cluster]: ... @distributed_trace_async async def begin_delete( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def get( + async def begin_failover( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> AsyncLROPoller[Cluster]: ... - @distributed_trace - def list( + @overload + async def begin_update( self, resource_group_name: str, cluster_name: str, + properties: ClusterForPatchUpdate, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[PrivateEndpointConnectionResource]: ... + ) -> AsyncLROPoller[Cluster]: ... @overload - async def update_status( + async def begin_update( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: PrivateEndpointConnectionResource, + properties: ClusterForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> AsyncLROPoller[Cluster]: ... @overload - async def update_status( + async def begin_update( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: PrivateEndpointConnectionResource, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> AsyncLROPoller[Cluster]: ... - @overload - async def update_status( + @distributed_trace_async + async def get( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> Cluster: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Cluster]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Cluster]: ... + + + class azure.mgmt.horizondb.aio.operations.DefaultParameterGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + location: str, + name: str, + **kwargs: Any + ) -> DefaultParameterGroup: ... + + @distributed_trace + def list_by_subscription_and_region( + self, + location: str, + **kwargs: Any + ) -> AsyncItemPaged[DefaultParameterGroup]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbPrivateLinkResourcesOperations: + class azure.mgmt.horizondb.aio.operations.EndpointsOperations: def __init__( self, @@ -581,9 +640,9 @@ namespace azure.mgmt.horizondb.aio.operations self, resource_group_name: str, cluster_name: str, - group_name: str, + endpoint_name: str, **kwargs: Any - ) -> HorizonDbPrivateLinkResource: ... + ) -> Endpoint: ... @distributed_trace def list( @@ -591,10 +650,10 @@ namespace azure.mgmt.horizondb.aio.operations resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbPrivateLinkResource]: ... + ) -> AsyncItemPaged[Endpoint]: ... - class azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations: + class azure.mgmt.horizondb.aio.operations.FirewallRulesOperations: def __init__( self, @@ -603,43 +662,43 @@ namespace azure.mgmt.horizondb.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, - resource: HorizonDbReplica, + firewall_rule_name: str, + resource: FirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbReplica]: ... + ) -> AsyncLROPoller[FirewallRule]: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, - resource: HorizonDbReplica, + firewall_rule_name: str, + resource: FirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbReplica]: ... + ) -> AsyncLROPoller[FirewallRule]: ... @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, + firewall_rule_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbReplica]: ... + ) -> AsyncLROPoller[FirewallRule]: ... @distributed_trace_async async def begin_delete( @@ -647,70 +706,108 @@ namespace azure.mgmt.horizondb.aio.operations resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, + firewall_rule_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... - @overload - async def begin_update( + @distributed_trace_async + async def get( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, - properties: HorizonDbReplicaForPatchUpdate, + firewall_rule_name: str, + **kwargs: Any + ) -> FirewallRule: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncItemPaged[FirewallRule]: ... + + + class azure.mgmt.horizondb.aio.operations.IdentityAssignmentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: IdentityAssignment, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbReplica]: ... + ) -> AsyncLROPoller[IdentityAssignment]: ... @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: HorizonDbReplicaForPatchUpdate, + destination_name: str, + assignment_name: str, + resource: IdentityAssignment, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbReplica]: ... + ) -> AsyncLROPoller[IdentityAssignment]: ... @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: IO[bytes], + destination_name: str, + assignment_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[HorizonDbReplica]: ... + ) -> AsyncLROPoller[IdentityAssignment]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... @distributed_trace_async async def get( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, + destination_name: str, + assignment_name: str, **kwargs: Any - ) -> HorizonDbReplica: ... + ) -> IdentityAssignment: ... @distributed_trace def list( self, resource_group_name: str, cluster_name: str, - pool_name: str, + destination_name: str, **kwargs: Any - ) -> AsyncItemPaged[HorizonDbReplica]: ... + ) -> AsyncItemPaged[IdentityAssignment]: ... - class azure.mgmt.horizondb.aio.operations.Operations: + class azure.mgmt.horizondb.aio.operations.LogCaptureConfigurationsOperations: def __init__( self, @@ -718,692 +815,834 @@ namespace azure.mgmt.horizondb.aio.operations **kwargs ) -> None: ... - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... - - -namespace azure.mgmt.horizondb.models - - class azure.mgmt.horizondb.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INTERNAL = "Internal" - - - class azure.mgmt.horizondb.models.AuthenticationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.horizondb.models.CreateModeCluster(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE = "Create" - POINT_IN_TIME_RESTORE = "PointInTimeRestore" - UPDATE = "Update" - - - class azure.mgmt.horizondb.models.CreateModePool(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE = "Create" - UPDATE = "Update" - - - class azure.mgmt.horizondb.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - APPLICATION = "Application" - KEY = "Key" - MANAGED_IDENTITY = "ManagedIdentity" - USER = "User" - - - class azure.mgmt.horizondb.models.ErrorAdditionalInfo(_Model): - info: Optional[Any] - type: Optional[str] - - - class azure.mgmt.horizondb.models.ErrorDetail(_Model): - additional_info: Optional[list[ErrorAdditionalInfo]] - code: Optional[str] - details: Optional[list[ErrorDetail]] - message: Optional[str] - target: Optional[str] - - - class azure.mgmt.horizondb.models.ErrorResponse(_Model): - error: Optional[ErrorDetail] - @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: LogCaptureConfigurationForPatchUpdate, *, - error: Optional[ErrorDetail] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[LogCaptureConfiguration]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbAdministrator(ProxyResource): - id: str - name: str - properties: Optional[HorizonDbAdministratorProperties] - system_data: SystemData - type: str + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: LogCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[LogCaptureConfiguration]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: IO[bytes], *, - properties: Optional[HorizonDbAdministratorProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[LogCaptureConfiguration]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + **kwargs: Any + ) -> LogCaptureConfiguration: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[LogCaptureConfiguration]: ... - class azure.mgmt.horizondb.models.HorizonDbAdministratorAdd(_Model): - properties: HorizonDbAdministratorPropertiesForAdd + class azure.mgmt.horizondb.aio.operations.LogFilesOperations: - @overload def __init__( self, - *, - properties: HorizonDbAdministratorPropertiesForAdd + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbAdministratorProperties(_Model): - object_id: Optional[str] - principal_name: str - principal_type: Union[str, PrincipalTypes] - provisioning_state: Optional[Union[str, ProvisioningState]] - tenant_id: Optional[str] + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + log_file_name: str, + **kwargs: Any + ) -> LogFile: ... - @overload - def __init__( + @distributed_trace + def list( self, - *, - principal_name: str, - principal_type: Union[str, PrincipalTypes], - tenant_id: Optional[str] = ... - ) -> None: ... + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[LogFile]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def list_download_urls( + self, + resource_group_name: str, + cluster_name: str, + log_file_name: str, + **kwargs: Any + ) -> LogFileDownloadUrl: ... - class azure.mgmt.horizondb.models.HorizonDbAdministratorPropertiesForAdd(_Model): - principal_name: str - principal_type: Union[str, PrincipalTypes] - tenant_id: Optional[str] + class azure.mgmt.horizondb.aio.operations.MaintenanceEventsOperations: - @overload def __init__( self, - *, - principal_name: str, - principal_type: Union[str, PrincipalTypes], - tenant_id: Optional[str] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbCluster(TrackedResource): - id: str - identity: Optional[ManagedServiceIdentity] - location: str - name: str - properties: Optional[HorizonDbClusterProperties] - system_data: SystemData - tags: dict[str, str] - type: str + @distributed_trace_async + async def begin_apply_now( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + **kwargs: Any + ) -> AsyncLROPoller[MaintenanceEventActionResponse]: ... @overload - def __init__( + async def begin_reschedule( self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: MaintenanceEventRescheduleRequest, *, - identity: Optional[ManagedServiceIdentity] = ..., - location: str, - properties: Optional[HorizonDbClusterProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig(_Model): - entra_id_auth: Optional[Union[str, AuthenticationState]] - password_auth: Optional[Union[str, AuthenticationState]] - tenant_id: Optional[str] + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MaintenanceEventActionResponse]: ... @overload - def __init__( + async def begin_reschedule( self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: MaintenanceEventRescheduleRequest, *, - entra_id_auth: Optional[Union[str, AuthenticationState]] = ..., - password_auth: Optional[Union[str, AuthenticationState]] = ..., - tenant_id: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MaintenanceEventActionResponse]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + async def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MaintenanceEventActionResponse]: ... - class azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate(_Model): - identity: Optional[ManagedServiceIdentity] - properties: Optional[HorizonDbClusterPropertiesForPatchUpdate] - tags: Optional[dict[str, str]] + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + **kwargs: Any + ) -> MaintenanceEvent: ... - @overload - def __init__( + @distributed_trace + def list( self, + resource_group_name: str, + cluster_name: str, + pool_name: str, *, - identity: Optional[ManagedServiceIdentity] = ..., - properties: Optional[HorizonDbClusterPropertiesForPatchUpdate] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + filter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[MaintenanceEvent]: ... - class azure.mgmt.horizondb.models.HorizonDbClusterMirroring(_Model): - database_names: Optional[list[str]] - user_assigned_identity_id: Optional[str] + class azure.mgmt.horizondb.aio.operations.MicrosoftEntraAdministratorsOperations: - @overload def __init__( self, - *, - database_names: Optional[list[str]] = ..., - user_assigned_identity_id: Optional[str] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties(_Model): - apply_immediately: Optional[bool] - id: Optional[str] - sync_status: Optional[str] - - @overload - def __init__( + async def begin_create_or_replace( self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: MicrosoftEntraAdministratorAdd, *, - apply_immediately: Optional[bool] = ..., - id: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAdministrator]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbClusterProperties(_Model): - administrator_login: str - administrator_login_password: Optional[str] - auth_config: Optional[HorizonDbClusterAuthConfig] - compute_model: Optional[HorizonDbComputeModel] - create_mode: Optional[Union[str, CreateModeCluster]] - fully_qualified_domain_name: Optional[str] - mirroring: Optional[HorizonDbClusterMirroring] - network: Optional[Network] - parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] - point_in_time_utc: Optional[datetime] - pool_name: Optional[str] - processor_type: Optional[str] - provisioning_state: Optional[Union[str, ProvisioningState]] - readonly_endpoint: Optional[str] - replica_count: Optional[int] - source_cluster_resource_id: Optional[str] - state: Optional[Union[str, State]] - v_cores: Optional[int] - version: Optional[str] - zone_placement_policy: Optional[Union[str, ZonePlacementPolicy]] + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: MicrosoftEntraAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAdministrator]: ... @overload - def __init__( + async def begin_create_or_replace( self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: IO[bytes], *, - administrator_login: str, - administrator_login_password: Optional[str] = ..., - auth_config: Optional[HorizonDbClusterAuthConfig] = ..., - compute_model: Optional[HorizonDbComputeModel] = ..., - create_mode: Optional[Union[str, CreateModeCluster]] = ..., - mirroring: Optional[HorizonDbClusterMirroring] = ..., - network: Optional[Network] = ..., - parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] = ..., - point_in_time_utc: Optional[datetime] = ..., - pool_name: Optional[str] = ..., - processor_type: Optional[str] = ..., - replica_count: Optional[int] = ..., - source_cluster_resource_id: Optional[str] = ..., - v_cores: Optional[int] = ..., - version: Optional[str] = ..., - zone_placement_policy: Optional[Union[str, ZonePlacementPolicy]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAdministrator]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + **kwargs: Any + ) -> MicrosoftEntraAdministrator: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[MicrosoftEntraAdministrator]: ... - class azure.mgmt.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate(_Model): - administrator_login_password: Optional[str] - auth_config: Optional[HorizonDbClusterAuthConfig] - compute_model: Optional[HorizonDbComputeModel] - mirroring: Optional[HorizonDbClusterMirroring] - parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] - v_cores: Optional[int] + class azure.mgmt.horizondb.aio.operations.MicrosoftEntraAuthenticationsOperations: - @overload def __init__( self, - *, - administrator_login_password: Optional[str] = ..., - auth_config: Optional[HorizonDbClusterAuthConfig] = ..., - compute_model: Optional[HorizonDbComputeModel] = ..., - mirroring: Optional[HorizonDbClusterMirroring] = ..., - parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] = ..., - v_cores: Optional[int] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbComputeModel(_Model): - maxv_cores: Optional[float] - minv_cores: Optional[float] - type: Optional[Union[str, HorizonDbComputeModelType]] - v_cores: Optional[int] + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: MicrosoftEntraAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAuthentication]: ... @overload - def __init__( + async def begin_create_or_replace( self, + resource_group_name: str, + cluster_name: str, + resource: MicrosoftEntraAuthentication, *, - maxv_cores: Optional[float] = ..., - minv_cores: Optional[float] = ..., - type: Optional[Union[str, HorizonDbComputeModelType]] = ..., - v_cores: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAuthentication]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbComputeModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PROVISIONED = "Provisioned" - SERVERLESS = "Serverless" - - - class azure.mgmt.horizondb.models.HorizonDbFirewallRule(ProxyResource): - id: str - name: str - properties: Optional[HorizonDbFirewallRuleProperties] - system_data: SystemData - type: str + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAuthentication]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + properties: MicrosoftEntraAuthenticationForPatchUpdate, *, - properties: Optional[HorizonDbFirewallRuleProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAuthentication]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbFirewallRuleProperties(_Model): - description: Optional[str] - end_ip_address: str - provisioning_state: Optional[Union[str, ProvisioningState]] - start_ip_address: str + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: MicrosoftEntraAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAuthentication]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], *, - description: Optional[str] = ..., - end_ip_address: str, - start_ip_address: str - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[MicrosoftEntraAuthentication]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> MicrosoftEntraAuthentication: ... - class azure.mgmt.horizondb.models.HorizonDbParameterGroup(TrackedResource): - id: str - location: str - name: str - properties: Optional[HorizonDbParameterGroupProperties] - system_data: SystemData - tags: dict[str, str] - type: str + class azure.mgmt.horizondb.aio.operations.NodesOperations: - @overload def __init__( self, - *, - location: str, - properties: Optional[HorizonDbParameterGroupProperties] = ..., - tags: Optional[dict[str, str]] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + node_name: str, + **kwargs: Any + ) -> Node: ... - class azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties(_Model): - id: Optional[str] - name: Optional[str] - type: Optional[str] + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Node]: ... - class azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate(_Model): - properties: Optional[HorizonDbParameterGroupPropertiesForPatchUpdate] - tags: Optional[dict[str, str]] + class azure.mgmt.horizondb.aio.operations.Operations: - @overload def __init__( self, - *, - properties: Optional[HorizonDbParameterGroupPropertiesForPatchUpdate] = ..., - tags: Optional[dict[str, str]] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... - class azure.mgmt.horizondb.models.HorizonDbParameterGroupProperties(_Model): - apply_immediately: Optional[bool] - description: Optional[str] - parameters: Optional[list[ParameterProperties]] - pg_version: Optional[int] - provisioning_state: Optional[Union[str, ProvisioningState]] - version: Optional[int] + class azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations: - @overload def __init__( self, - *, - apply_immediately: Optional[bool] = ..., - description: Optional[str] = ..., - parameters: Optional[list[ParameterProperties]] = ..., - pg_version: Optional[int] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate(_Model): - apply_immediately: Optional[bool] - description: Optional[str] - parameters: Optional[list[ParameterProperties]] + async def begin_create_or_replace( + self, + resource_group_name: str, + parameter_group_name: str, + resource: ParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ParameterGroup]: ... @overload - def __init__( + async def begin_create_or_replace( self, + resource_group_name: str, + parameter_group_name: str, + resource: ParameterGroup, *, - apply_immediately: Optional[bool] = ..., - description: Optional[str] = ..., - parameters: Optional[list[ParameterProperties]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ParameterGroup]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + async def begin_create_or_replace( + self, + resource_group_name: str, + parameter_group_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ParameterGroup]: ... - class azure.mgmt.horizondb.models.HorizonDbPool(ProxyResource): - id: str - name: str - properties: Optional[HorizonDbPoolProperties] - system_data: SystemData - tags: Optional[dict[str, str]] - type: str + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + parameter_group_name: str, + properties: ParameterGroupForPatchUpdate, *, - properties: Optional[HorizonDbPoolProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbPoolProperties(_Model): - create_mode: Optional[Union[str, CreateModePool]] - location: Optional[str] - provisioning_state: Optional[Union[str, ProvisioningState]] - replica_count: Optional[int] - state: Optional[Union[str, State]] - version: Optional[str] + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ParameterGroup]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + parameter_group_name: str, + properties: ParameterGroupForPatchUpdate, *, - location: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ParameterGroup]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ParameterGroup]: ... - class azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource(ProxyResource): - id: str - name: str - properties: Optional[PrivateLinkResourceProperties] - system_data: SystemData - type: str + @distributed_trace_async + async def get( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> ParameterGroup: ... - @overload - def __init__( + @distributed_trace + def list_by_resource_group( self, - *, - properties: Optional[PrivateLinkResourceProperties] = ... - ) -> None: ... + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ParameterGroup]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[ParameterGroup]: ... + + @distributed_trace + def list_connections( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ParameterGroupConnectionProperties]: ... - class azure.mgmt.horizondb.models.HorizonDbReplica(ProxyResource): - id: str - name: str - properties: Optional[HorizonDbReplicaProperties] - system_data: SystemData - type: str + class azure.mgmt.horizondb.aio.operations.PasswordAuthenticationsOperations: - @overload def __init__( self, - *, - properties: Optional[HorizonDbReplicaProperties] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate(_Model): - properties: Optional[HorizonDbReplicaPropertiesForPatchUpdate] + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: PasswordAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PasswordAuthentication]: ... @overload - def __init__( + async def begin_create_or_replace( self, + resource_group_name: str, + cluster_name: str, + resource: PasswordAuthentication, *, - properties: Optional[HorizonDbReplicaPropertiesForPatchUpdate] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PasswordAuthentication]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbReplicaProperties(_Model): - availability_zone: Optional[str] - fully_qualified_domain_name: Optional[str] - provisioning_state: Optional[Union[str, ProvisioningState]] - role: Optional[Union[str, ReplicaRole]] - status: Optional[Union[str, State]] + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PasswordAuthentication]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + properties: PasswordAuthenticationForPatchUpdate, *, - availability_zone: Optional[str] = ..., - role: Optional[Union[str, ReplicaRole]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PasswordAuthentication]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate(_Model): - role: Optional[Union[str, ReplicaRole]] + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PasswordAuthentication]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], *, - role: Optional[Union[str, ReplicaRole]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PasswordAuthentication]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> PasswordAuthentication: ... - class azure.mgmt.horizondb.models.ManagedServiceIdentity(_Model): - principal_id: Optional[str] - tenant_id: Optional[str] - type: Union[str, ManagedServiceIdentityType] - user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + class azure.mgmt.horizondb.aio.operations.PoolsOperations: - @overload def __init__( self, - *, - type: Union[str, ManagedServiceIdentityType], - user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: Pool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: Pool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... - class azure.mgmt.horizondb.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - USER_ASSIGNED = "UserAssigned" + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... - class azure.mgmt.horizondb.models.Network(_Model): - public_network_access: Optional[Union[str, PublicNetworkAccessState]] + @distributed_trace_async + async def begin_restart( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... + @distributed_trace_async + async def begin_start( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... - class azure.mgmt.horizondb.models.Operation(_Model): - action_type: Optional[Union[str, ActionType]] - display: Optional[OperationDisplay] - is_data_action: Optional[bool] - name: Optional[str] - origin: Optional[Union[str, Origin]] + @distributed_trace_async + async def begin_stop( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... @overload - def __init__( + async def begin_update( self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: PoolForPatchUpdate, *, - display: Optional[OperationDisplay] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: PoolForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... - class azure.mgmt.horizondb.models.OperationDisplay(_Model): - description: Optional[str] - operation: Optional[str] - provider: Optional[str] - resource: Optional[str] + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pool]: ... + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> Pool: ... - class azure.mgmt.horizondb.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SYSTEM = "system" - USER = "user" - USER_SYSTEM = "user,system" + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Pool]: ... - class azure.mgmt.horizondb.models.ParameterProperties(_Model): - allowed_values: Optional[str] - data_type: Optional[str] - description: Optional[str] - documentation_link: Optional[str] - is_dynamic: Optional[bool] - is_read_only: Optional[bool] - name: Optional[str] - unit: Optional[str] - value: Optional[str] + class azure.mgmt.horizondb.aio.operations.PrivateEndpointConnectionsOperations: - @overload def __init__( self, - *, - name: Optional[str] = ..., - value: Optional[str] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + async def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnectionResource]: ... - class azure.mgmt.horizondb.models.PrincipalTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GROUP = "Group" - SERVICE_PRINCIPAL = "ServicePrincipal" - UNKNOWN = "Unknown" - USER = "User" + @overload + async def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnectionResource]: ... + + @overload + async def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnectionResource]: ... + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... - class azure.mgmt.horizondb.models.PrivateEndpoint(_Model): - id: Optional[str] + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PrivateEndpointConnectionResource]: ... + + + class azure.mgmt.horizondb.aio.operations.PrivateLinkResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + group_name: str, + **kwargs: Any + ) -> PrivateLinkResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PrivateLinkResource]: ... + + +namespace azure.mgmt.horizondb.models + + class azure.mgmt.horizondb.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" - class azure.mgmt.horizondb.models.PrivateEndpointConnectionProperties(_Model): - group_ids: Optional[list[str]] - private_endpoint: Optional[PrivateEndpoint] - private_link_service_connection_state: PrivateLinkServiceConnectionState - provisioning_state: Optional[Union[str, PrivateEndpointConnectionProvisioningState]] + + class azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityRequest(_Model): + drain_existing_sessions: Optional[bool] + identity_assignment_resource_id: str @overload def __init__( self, *, - private_endpoint: Optional[PrivateEndpoint] = ..., - private_link_service_connection_state: PrivateLinkServiceConnectionState + drain_existing_sessions: Optional[bool] = ..., + identity_assignment_resource_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" + class azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult(_Model): + previous_identity_assignment_resource_id: Optional[str] + status: Literal["Succeeded"] + target_identity_assignment_resource_id: str + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.mgmt.horizondb.models.PrivateEndpointConnectionResource(Resource): + + class azure.mgmt.horizondb.models.AiModelManagementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.Authentication(ProxyResource): id: str name: str - properties: Optional[PrivateEndpointConnectionProperties] + properties: Optional[AuthenticationProperties] system_data: SystemData type: str @@ -1411,155 +1650,2862 @@ namespace azure.mgmt.horizondb.models def __init__( self, *, - properties: Optional[PrivateEndpointConnectionProperties] = ... + properties: Optional[AuthenticationProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" + class azure.mgmt.horizondb.models.AuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MICROSOFT_ENTRA = "microsoftEntra" + PASSWORD_METHOD = "passwordMethod" - class azure.mgmt.horizondb.models.PrivateLinkResourceProperties(_Model): - group_id: Optional[str] - required_members: Optional[list[str]] - required_zone_names: Optional[list[str]] + class azure.mgmt.horizondb.models.AuthenticationProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + state: Union[str, AuthenticationState] + + + class azure.mgmt.horizondb.models.AuthenticationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.BackupProperties(_Model): + earliest_restore_point_utc: Optional[datetime] + geo_redundancy: Union[str, GeoRedundancyState] + retention_days: Optional[int] @overload def __init__( self, *, - required_zone_names: Optional[list[str]] = ... + geo_redundancy: Union[str, GeoRedundancyState], + retention_days: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.PrivateLinkServiceConnectionState(_Model): - actions_required: Optional[str] - description: Optional[str] - status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] + class azure.mgmt.horizondb.models.BackupPropertiesForPatchUpdate(_Model): + retention_days: Optional[int] @overload def __init__( self, *, - actions_required: Optional[str] = ..., - description: Optional[str] = ..., - status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] = ... + retention_days: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - PROVISIONING = "Provisioning" - SUCCEEDED = "Succeeded" + class azure.mgmt.horizondb.models.Capability(ProxyResource): + id: str + name: str + properties: Optional[CapabilityProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[CapabilityProperties] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.ProxyResource(Resource): + + class azure.mgmt.horizondb.models.CapabilityProperties(_Model): + cluster_capabilities: ClusterCapability + pool_capabilities: PoolCapability + provisioning_state: Optional[Union[str, ProvisioningState]] + + + class azure.mgmt.horizondb.models.ChangeDataCaptureCapability(ProxyResource): + e_tag: Optional[str] id: str name: str + properties: Optional[ChangeDataCaptureCapabilityProperties] system_data: SystemData type: str + @overload + def __init__( + self, + *, + properties: Optional[ChangeDataCaptureCapabilityProperties] = ... + ) -> None: ... - class azure.mgmt.horizondb.models.PublicNetworkAccessState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.ReplicaRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - READ = "Read" - READ_WRITE = "ReadWrite" + class azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityForPatchUpdate(_Model): + properties: Optional[ChangeDataCaptureCapabilityPropertiesForPatchUpdate] + @overload + def __init__( + self, + *, + properties: Optional[ChangeDataCaptureCapabilityPropertiesForPatchUpdate] = ... + ) -> None: ... - class azure.mgmt.horizondb.models.Resource(_Model): - id: Optional[str] - name: Optional[str] - system_data: Optional[SystemData] - type: Optional[str] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.State(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - DROPPING = "Dropping" - HEALTHY = "Healthy" - READY = "Ready" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - UPGRADING = "Upgrading" + class azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityProperties(_Model): + auto_upgrade_extension: Optional[bool] + configuration_count: int + desired_state: Union[str, ChangeDataCaptureDesiredState] + destination_count: int + effective_state: Union[str, ChangeDataCaptureEffectiveState] + extension: ChangeDataCaptureExtensionStatus + prerequisites: ChangeDataCapturePrerequisiteStatus + provisioning_state: Optional[Union[str, ProvisioningState]] + replication_architecture: Union[str, ChangeDataCaptureReplicationArchitecture] + status: ChangeDataCaptureStatus + @overload + def __init__( + self, + *, + auto_upgrade_extension: Optional[bool] = ..., + desired_state: Union[str, ChangeDataCaptureDesiredState] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.SystemData(_Model): - created_at: Optional[datetime] - created_by: Optional[str] - created_by_type: Optional[Union[str, CreatedByType]] - last_modified_at: Optional[datetime] - last_modified_by: Optional[str] - last_modified_by_type: Optional[Union[str, CreatedByType]] + + class azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityPropertiesForPatchUpdate(_Model): + auto_upgrade_extension: Optional[bool] + desired_state: Optional[Union[str, ChangeDataCaptureDesiredState]] @overload def __init__( self, *, - created_at: Optional[datetime] = ..., - created_by: Optional[str] = ..., - created_by_type: Optional[Union[str, CreatedByType]] = ..., - last_modified_at: Optional[datetime] = ..., - last_modified_by: Optional[str] = ..., - last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + auto_upgrade_extension: Optional[bool] = ..., + desired_state: Optional[Union[str, ChangeDataCaptureDesiredState]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.TrackedResource(Resource): + class azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration(ProxyResource): + e_tag: Optional[str] id: str - location: str name: str + properties: Optional[ChangeDataCaptureConfigurationProperties] system_data: SystemData - tags: Optional[dict[str, str]] type: str @overload def __init__( self, *, - location: str, - tags: Optional[dict[str, str]] = ... + properties: Optional[ChangeDataCaptureConfigurationProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.horizondb.models.UserAssignedIdentity(_Model): - client_id: Optional[str] - principal_id: Optional[str] + class azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationForPatchUpdate(_Model): + properties: Optional[ChangeDataCaptureConfigurationPropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + properties: Optional[ChangeDataCaptureConfigurationPropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationProperties(_Model): + database_name: str + desired_state: Union[str, ChangeDataCaptureDesiredState] + destination_resource_id: str + effective_state: Union[str, ChangeDataCaptureEffectiveState] + extension: ChangeDataCaptureExtensionStatus + logical_stream_id: str + provisioning_state: Optional[Union[str, ProvisioningState]] + replication: ChangeDataCaptureReplicationStatus + status: ChangeDataCaptureStatus + topology: ChangeDataCaptureTopologyBindingStatus + usage_profile: Union[str, ChangeDataCaptureUsageProfile] + + @overload + def __init__( + self, + *, + database_name: str, + desired_state: Union[str, ChangeDataCaptureDesiredState], + destination_resource_id: str, + usage_profile: Union[str, ChangeDataCaptureUsageProfile] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationPropertiesForPatchUpdate(_Model): + desired_state: Optional[Union[str, ChangeDataCaptureDesiredState]] + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, ChangeDataCaptureDesiredState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestination(ProxyResource): + e_tag: Optional[str] + id: str + name: str + properties: Optional[ChangeDataCaptureDestinationProperties] + system_data: SystemData + type: str + @overload + def __init__( + self, + *, + properties: Optional[ChangeDataCaptureDestinationProperties] = ... + ) -> None: ... - class azure.mgmt.horizondb.models.ZonePlacementPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BEST_EFFORT = "BestEffort" - STRICT = "Strict" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestinationDetails(_Model): + destination_type: str + protocol: Union[str, ChangeDataCaptureProtocol] + + @overload + def __init__( + self, + *, + destination_type: str, + protocol: Union[str, ChangeDataCaptureProtocol] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestinationEffectiveState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEGRADED = "Degraded" + DISABLED = "Disabled" + DISABLING = "Disabling" + ENABLED = "Enabled" + ENABLING = "Enabling" + FAILED = "Failed" + WAITING_FOR_IDENTITY = "WaitingForIdentity" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestinationForPatchUpdate(_Model): + properties: Optional[ChangeDataCaptureDestinationPropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + properties: Optional[ChangeDataCaptureDestinationPropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestinationProperties(_Model): + active_identity_assignment_resource_id: Optional[str] + configuration_count: int + desired_state: Union[str, ChangeDataCaptureDesiredState] + destination: ChangeDataCaptureDestinationDetails + effective_state: Union[str, ChangeDataCaptureDestinationEffectiveState] + provisioning_state: Optional[Union[str, ProvisioningState]] + status: ChangeDataCaptureStatus + + @overload + def __init__( + self, + *, + desired_state: Union[str, ChangeDataCaptureDesiredState], + destination: ChangeDataCaptureDestinationDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestinationPropertiesForPatchUpdate(_Model): + desired_state: Optional[Union[str, ChangeDataCaptureDesiredState]] + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, ChangeDataCaptureDesiredState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FABRIC = "Fabric" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureEffectiveState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEGRADED = "Degraded" + DISABLED = "Disabled" + DISABLING = "Disabling" + ENABLED = "Enabled" + ENABLING = "Enabling" + FAILED = "Failed" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureEngineConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + NOT_READY = "NotReady" + READY = "Ready" + RECONCILING = "Reconciling" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + INSTALLING = "Installing" + NOT_INSTALLED = "NotInstalled" + READY = "Ready" + REMOVING = "Removing" + UPGRADING = "Upgrading" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureExtensionStatus(_Model): + name: str + state: Union[str, ChangeDataCaptureExtensionState] + version: str + + + class azure.mgmt.horizondb.models.ChangeDataCaptureIdentityActivationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVATING = "Activating" + ACTIVE = "Active" + DEACTIVATING = "Deactivating" + FAILED = "Failed" + INACTIVE = "Inactive" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureIdentityAssignmentProperties(_Model): + activation_state: Union[str, ChangeDataCaptureIdentityActivationState] + effective_state: Union[str, ChangeDataCaptureIdentityAssignmentState] + identity_resource_id: str + principal_id: str + provisioning_state: Optional[Union[str, ProvisioningState]] + status: ChangeDataCaptureStatus + tenant_id: str + validation: IdentityValidationStatus + + @overload + def __init__( + self, + *, + identity_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ChangeDataCaptureIdentityAssignmentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSIGNED = "Assigned" + ASSIGNING = "Assigning" + FAILED = "Failed" + REMOVING = "Removing" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureIdentityValidationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + NOT_STARTED = "NotStarted" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.horizondb.models.ChangeDataCapturePrerequisiteStatus(_Model): + engine_configuration_state: Union[str, ChangeDataCaptureEngineConfigurationState] + read_write_endpoint_state: Union[str, ChangeDataCaptureReadWriteEndpointState] + + + class azure.mgmt.horizondb.models.ChangeDataCaptureProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NATIVE = "Native" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureReadWriteEndpointState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READY = "Ready" + UNAVAILABLE = "Unavailable" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureReplicationArchitecture(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPUTE_BASED = "ComputeBased" + HYBRID = "Hybrid" + STORAGE_BASED = "StorageBased" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONNECTING = "Connecting" + DEGRADED = "Degraded" + FAILED = "Failed" + NOT_APPLICABLE = "NotApplicable" + NOT_CONNECTED = "NotConnected" + PAUSED = "Paused" + RECONNECTING = "Reconnecting" + REPLICATING = "Replicating" + STOPPING = "Stopping" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureReplicationStatus(_Model): + external_artifact_id: Optional[str] + last_connected_at_utc: Optional[datetime] + state: Union[str, ChangeDataCaptureReplicationState] + + + class azure.mgmt.horizondb.models.ChangeDataCaptureStatus(_Model): + code: str + message: str + + + class azure.mgmt.horizondb.models.ChangeDataCaptureTopologyBindingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + CONFLICT = "Conflict" + REBIND_REQUIRED = "RebindRequired" + RECONCILING = "Reconciling" + SUPERSEDED = "Superseded" + + + class azure.mgmt.horizondb.models.ChangeDataCaptureTopologyBindingStatus(_Model): + active_cluster_resource_id: str + generation: int + replacement_configuration_resource_id: Optional[str] + state: Union[str, ChangeDataCaptureTopologyBindingState] + + + class azure.mgmt.horizondb.models.ChangeDataCaptureUsageProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MIRRORING = "Mirroring" + + + class azure.mgmt.horizondb.models.Cluster(TrackedResource): + id: str + identity: Optional[HorizonDbClusterManagedServiceIdentity] + location: str + name: str + properties: Optional[ClusterProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[HorizonDbClusterManagedServiceIdentity] = ..., + location: str, + properties: Optional[ClusterProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ClusterCapability(_Model): + recommended_postgre_sql_version: Union[str, PostgreSqlCapabilityVersion] + supported_features: list[ClusterFeatureCapability] + supported_postgre_sql_versions: list[PostgreSqlVersionCapability] + + + class azure.mgmt.horizondb.models.ClusterCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "Create" + POINT_IN_TIME_RESTORE = "PointInTimeRestore" + + + class azure.mgmt.horizondb.models.ClusterFeatureCapability(_Model): + name: str + + + class azure.mgmt.horizondb.models.ClusterForPatchUpdate(_Model): + identity: Optional[HorizonDbClusterManagedServiceIdentity] + properties: Optional[ClusterPropertiesForPatchUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[HorizonDbClusterManagedServiceIdentity] = ..., + properties: Optional[ClusterPropertiesForPatchUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ClusterProperties(_Model): + ai_model_management: Optional[Union[str, AiModelManagementStatus]] + backup: Optional[BackupProperties] + creation_mode: Optional[Union[str, ClusterCreateMode]] + creation_source_cluster_location: Optional[str] + creation_source_cluster_resource_id: Optional[str] + data_encryption: Optional[HorizonDbClusterDataEncryption] + network: Optional[Network] + point_in_time_utc: Optional[datetime] + postgre_sql_version: Optional[Union[str, PostgreSqlVersion]] + provisioning_state: Union[str, ProvisioningState] + read_write_pool: ReadWritePoolProperties + state: Union[str, ClusterState] + + @overload + def __init__( + self, + *, + ai_model_management: Optional[Union[str, AiModelManagementStatus]] = ..., + backup: Optional[BackupProperties] = ..., + creation_mode: Optional[Union[str, ClusterCreateMode]] = ..., + creation_source_cluster_location: Optional[str] = ..., + creation_source_cluster_resource_id: Optional[str] = ..., + data_encryption: Optional[HorizonDbClusterDataEncryption] = ..., + network: Optional[Network] = ..., + point_in_time_utc: Optional[datetime] = ..., + postgre_sql_version: Optional[Union[str, PostgreSqlVersion]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ClusterPropertiesForPatchUpdate(_Model): + ai_model_management: Optional[Union[str, AiModelManagementStatus]] + backup: Optional[BackupPropertiesForPatchUpdate] + data_encryption: Optional[HorizonDbClusterDataEncryptionForPatchUpdate] + network: Optional[NetworkForPatchUpdate] + + @overload + def __init__( + self, + *, + ai_model_management: Optional[Union[str, AiModelManagementStatus]] = ..., + backup: Optional[BackupPropertiesForPatchUpdate] = ..., + data_encryption: Optional[HorizonDbClusterDataEncryptionForPatchUpdate] = ..., + network: Optional[NetworkForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ClusterState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELETING = "Deleting" + INACCESSIBLE = "Inaccessible" + PROVISIONING = "Provisioning" + READY = "Ready" + UPDATING = "Updating" + + + class azure.mgmt.horizondb.models.ComputeGenerationCapability(_Model): + compute_generation: int + recommended_compute_model_type: Union[str, PoolComputeModelType] + supported_compute_models: list[ComputeModelCapability] + + + class azure.mgmt.horizondb.models.ComputeModelCapability(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ComputeProcessorCapability(_Model): + name: Union[str, ComputeProcessorType] + supported_generations: list[ComputeGenerationCapability] + + + class azure.mgmt.horizondb.models.ComputeProcessorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AMD = "AMD" + INTEL = "Intel" + + + class azure.mgmt.horizondb.models.ComputeSizeCapability(_Model): + memory_per_v_core_in_mb: int + v_cores: int + + + class azure.mgmt.horizondb.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.horizondb.models.DefaultParameterGroup(ProxyResource): + id: str + name: str + properties: Optional[DefaultParameterGroupProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[DefaultParameterGroupProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.DefaultParameterGroupProperties(_Model): + description: Optional[str] + parameters: list[ParameterProperties] + postgre_sql_version: Union[str, PostgreSqlVersion] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + parameters: list[ParameterProperties], + postgre_sql_version: Union[str, PostgreSqlVersion] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.Endpoint(ProxyResource): + id: str + name: str + properties: Optional[EndpointProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[EndpointProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.EndpointProperties(_Model): + associated_resource_id: str + fully_qualified_domain_name: str + role: Union[str, EndpointRole] + scope: Union[str, EndpointScope] + + + class azure.mgmt.horizondb.models.EndpointRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + + + class azure.mgmt.horizondb.models.EndpointScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLUSTER = "Cluster" + POOL = "Pool" + + + class azure.mgmt.horizondb.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.horizondb.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.horizondb.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.FabricDestinationDetails(ChangeDataCaptureDestinationDetails, discriminator='Fabric'): + destination_type: Literal[ChangeDataCaptureDestinationType.FABRIC] + protocol: Literal[ChangeDataCaptureProtocol.NATIVE] + workspace_id: str + + @overload + def __init__( + self, + *, + protocol: Literal[ChangeDataCaptureProtocol.NATIVE], + workspace_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.FirewallRule(ProxyResource): + id: str + name: str + properties: Optional[FirewallRuleProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[FirewallRuleProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.FirewallRuleProperties(_Model): + description: Optional[str] + end_ip_address: str + provisioning_state: Optional[Union[str, ProvisioningState]] + start_ip_address: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + end_ip_address: str, + start_ip_address: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.GeoRedundancyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.HorizonDbClusterDataEncryption(_Model): + primary_encryption_key_current_version: Optional[str] + primary_encryption_key_status: Optional[Union[str, HorizonDbClusterEncryptionKeyStatus]] + primary_key_uri: Optional[str] + primary_user_assigned_identity_id: Optional[str] + type: Optional[Union[str, HorizonDbClusterDataEncryptionType]] + + @overload + def __init__( + self, + *, + primary_key_uri: Optional[str] = ..., + primary_user_assigned_identity_id: Optional[str] = ..., + type: Optional[Union[str, HorizonDbClusterDataEncryptionType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionForPatchUpdate(_Model): + primary_key_uri: Optional[str] + primary_user_assigned_identity_id: Optional[str] + type: Optional[Union[str, HorizonDbClusterDataEncryptionType]] + + @overload + def __init__( + self, + *, + primary_key_uri: Optional[str] = ..., + primary_user_assigned_identity_id: Optional[str] = ..., + type: Optional[Union[str, HorizonDbClusterDataEncryptionType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_KEY_VAULT = "AzureKeyVault" + SYSTEM_MANAGED = "SystemManaged" + + + class azure.mgmt.horizondb.models.HorizonDbClusterEncryptionKeyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVALID = "Invalid" + VALID = "Valid" + + + class azure.mgmt.horizondb.models.HorizonDbClusterIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.horizondb.models.HorizonDbClusterManagedServiceIdentity(_Model): + type: Union[str, HorizonDbClusterIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, HorizonDbClusterIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.IdentityAssignment(ProxyResource): + e_tag: Optional[str] + id: str + name: str + properties: Optional[ChangeDataCaptureIdentityAssignmentProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[ChangeDataCaptureIdentityAssignmentProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.IdentityValidationStatus(_Model): + error: Optional[ErrorDetail] + state: Union[str, ChangeDataCaptureIdentityValidationState] + validated_at_utc: Optional[datetime] + + + class azure.mgmt.horizondb.models.LogCaptureConfiguration(ProxyResource): + id: str + name: str + properties: Optional[LogCaptureConfigurationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[LogCaptureConfigurationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.LogCaptureConfigurationForPatchUpdate(_Model): + properties: Optional[LogCaptureConfigurationPropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + properties: Optional[LogCaptureConfigurationPropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.LogCaptureConfigurationProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + retention_days: int + state: Union[str, LogCaptureState] + + @overload + def __init__( + self, + *, + retention_days: int, + state: Union[str, LogCaptureState] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.LogCaptureConfigurationPropertiesForPatchUpdate(_Model): + retention_days: Optional[int] + state: Optional[Union[str, LogCaptureState]] + + @overload + def __init__( + self, + *, + retention_days: Optional[int] = ..., + state: Optional[Union[str, LogCaptureState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.LogCaptureState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.LogFile(ProxyResource): + id: str + name: str + properties: Optional[LogFileProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[LogFileProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.LogFileDownloadUrl(_Model): + download_uri: str + expires_at_utc: datetime + + @overload + def __init__( + self, + *, + download_uri: str, + expires_at_utc: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.LogFileProperties(_Model): + created_at_utc: datetime + is_mutable: bool + last_modified_at_utc: datetime + log_type: Union[str, LogFileType] + node: str + pool: str + retention_expires_at_utc: datetime + role: Union[str, NodeRole] + size_in_kilobytes: int + + + class azure.mgmt.horizondb.models.LogFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + POSTGRE_SQL_SERVER = "PostgreSqlServer" + + + class azure.mgmt.horizondb.models.MaintenanceEvent(ProxyResource): + id: str + name: str + properties: Optional[MaintenanceEventProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[MaintenanceEventProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MaintenanceEventActionResponse(_Model): + applied_now: Optional[bool] + last_updated_time_utc: Optional[datetime] + maintenance_event_id: Optional[str] + planned_end_time_utc: Optional[datetime] + planned_start_time_utc: Optional[datetime] + pool_resource_id: Optional[str] + status: Optional[Union[str, MaintenanceEventStatus]] + + @overload + def __init__( + self, + *, + applied_now: Optional[bool] = ..., + last_updated_time_utc: Optional[datetime] = ..., + maintenance_event_id: Optional[str] = ..., + planned_end_time_utc: Optional[datetime] = ..., + planned_start_time_utc: Optional[datetime] = ..., + pool_resource_id: Optional[str] = ..., + status: Optional[Union[str, MaintenanceEventStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MaintenanceEventProperties(_Model): + deferrable: bool + deferral_deadline_utc: Optional[datetime] + description: Optional[str] + end_time_utc: datetime + estimated_downtime: Optional[timedelta] + last_updated_time_utc: Optional[datetime] + maintenance_event_id: Optional[str] + maintenance_type: Union[str, MaintenanceType] + original_start_time_utc: datetime + rescheduled_from_utc: Optional[datetime] + start_time_utc: datetime + status: Union[str, MaintenanceEventStatus] + + + class azure.mgmt.horizondb.models.MaintenanceEventRescheduleRequest(_Model): + postpone_to_date_time_utc: datetime + + @overload + def __init__( + self, + *, + postpone_to_date_time_utc: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MaintenanceEventStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + COMPLETE = "Complete" + IN_PROGRESS = "InProgress" + PLANNED = "Planned" + RESCHEDULED = "Rescheduled" + + + class azure.mgmt.horizondb.models.MaintenanceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PLANNED_MAINTENANCE = "PlannedMaintenance" + + + class azure.mgmt.horizondb.models.MicrosoftEntraAdministrator(ProxyResource): + id: str + name: str + properties: Optional[MicrosoftEntraAdministratorProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[MicrosoftEntraAdministratorProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAdministratorAdd(_Model): + properties: MicrosoftEntraAdministratorPropertiesForAdd + + @overload + def __init__( + self, + *, + properties: MicrosoftEntraAdministratorPropertiesForAdd + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAdministratorProperties(_Model): + object_id: Optional[str] + principal_name: str + principal_type: Union[str, PrincipalTypes] + provisioning_state: Optional[Union[str, ProvisioningState]] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, PrincipalTypes], + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAdministratorPropertiesForAdd(_Model): + principal_name: str + principal_type: Union[str, PrincipalTypes] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, PrincipalTypes], + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAuthentication(ProxyResource): + id: str + name: str + properties: Optional[MicrosoftEntraAuthenticationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[MicrosoftEntraAuthenticationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationForPatchUpdate(_Model): + properties: Optional[MicrosoftEntraAuthenticationPropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + properties: Optional[MicrosoftEntraAuthenticationPropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MICROSOFT_ENTRA = "microsoftEntra" + + + class azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + state: Union[str, AuthenticationState] + + @overload + def __init__( + self, + *, + state: Union[str, AuthenticationState] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationPropertiesForPatchUpdate(_Model): + state: Optional[Union[str, AuthenticationState]] + + @overload + def __init__( + self, + *, + state: Optional[Union[str, AuthenticationState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.Network(_Model): + public_access: Optional[Union[str, PublicNetworkAccessState]] + + @overload + def __init__( + self, + *, + public_access: Optional[Union[str, PublicNetworkAccessState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.NetworkForPatchUpdate(_Model): + public_access: Optional[Union[str, PublicNetworkAccessState]] + + @overload + def __init__( + self, + *, + public_access: Optional[Union[str, PublicNetworkAccessState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.Node(ProxyResource): + id: str + name: str + properties: Optional[NodeProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[NodeProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.NodeProperties(_Model): + availability_zone: str + role: Union[str, NodeRole] + + + class azure.mgmt.horizondb.models.NodeRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + UNASSIGNED = "Unassigned" + + + class azure.mgmt.horizondb.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.horizondb.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.horizondb.models.ParameterApplyMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMMEDIATE = "Immediate" + PENDING_REBOOT = "PendingReboot" + + + class azure.mgmt.horizondb.models.ParameterGroup(TrackedResource): + id: str + location: str + name: str + properties: Optional[ParameterGroupProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[ParameterGroupProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ParameterGroupConnectionProperties(_Model): + pool_resource_id: str + + + class azure.mgmt.horizondb.models.ParameterGroupForPatchUpdate(_Model): + properties: Optional[ParameterGroupPropertiesForPatchUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[ParameterGroupPropertiesForPatchUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ParameterGroupProperties(_Model): + description: Optional[str] + parameters: Optional[list[ParameterProperties]] + postgre_sql_version: Union[str, PostgreSqlVersion] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + parameters: Optional[list[ParameterProperties]] = ..., + postgre_sql_version: Union[str, PostgreSqlVersion] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ParameterGroupPropertiesForPatchUpdate(_Model): + description: Optional[str] + parameters: Optional[list[ParameterProperties]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + parameters: Optional[list[ParameterProperties]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ParameterGroupSyncStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLYING = "Applying" + FAILED_TO_APPLY = "FailedToApply" + IN_SYNC = "InSync" + PENDING_REBOOT = "PendingReboot" + + + class azure.mgmt.horizondb.models.ParameterProperties(_Model): + allowed_values: Optional[str] + data_type: Optional[str] + default_value: Optional[str] + description: Optional[str] + documentation_link: Optional[str] + is_dynamic: Optional[bool] + is_read_only: Optional[bool] + name: Optional[str] + unit: Optional[str] + value: Optional[str] + value_source: Optional[Union[str, ParameterValueSource]] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ParameterValueSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM_DEFAULT = "SystemDefault" + USER_OVERRIDE = "UserOverride" + + + class azure.mgmt.horizondb.models.PasswordAuthentication(ProxyResource): + id: str + name: str + properties: Optional[PasswordAuthenticationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PasswordAuthenticationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PasswordAuthenticationForPatchUpdate(_Model): + properties: Optional[PasswordAuthenticationPropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + properties: Optional[PasswordAuthenticationPropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PasswordAuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PASSWORD_METHOD = "passwordMethod" + + + class azure.mgmt.horizondb.models.PasswordAuthenticationProperties(_Model): + administrator_login: Optional[str] + administrator_login_password: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + state: Union[str, AuthenticationState] + + @overload + def __init__( + self, + *, + administrator_login: Optional[str] = ..., + administrator_login_password: Optional[str] = ..., + state: Union[str, AuthenticationState] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PasswordAuthenticationPropertiesForPatchUpdate(_Model): + administrator_login_password: Optional[str] + state: Optional[Union[str, AuthenticationState]] + + @overload + def __init__( + self, + *, + administrator_login_password: Optional[str] = ..., + state: Optional[Union[str, AuthenticationState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.Pool(ProxyResource): + id: str + name: str + properties: Optional[PoolProperties] + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PoolProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolCapability(_Model): + recommended_compute_processor: Union[str, ComputeProcessorType] + supported_features: list[PoolFeatureCapability] + supported_processors: list[ComputeProcessorCapability] + + + class azure.mgmt.horizondb.models.PoolComputeModel(_Model): + compute_generation: int + compute_processor: Union[str, ComputeProcessorType] + type: Union[str, PoolComputeModelType] + v_cores: int + + @overload + def __init__( + self, + *, + compute_generation: int, + compute_processor: Union[str, ComputeProcessorType], + type: Union[str, PoolComputeModelType], + v_cores: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolComputeModelForPatchUpdate(_Model): + compute_generation: Optional[int] + compute_processor: Optional[Union[str, ComputeProcessorType]] + type: Optional[Union[str, PoolComputeModelType]] + v_cores: Optional[int] + + @overload + def __init__( + self, + *, + compute_generation: Optional[int] = ..., + compute_processor: Optional[Union[str, ComputeProcessorType]] = ..., + type: Optional[Union[str, PoolComputeModelType]] = ..., + v_cores: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolComputeModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PROVISIONED = "Provisioned" + + + class azure.mgmt.horizondb.models.PoolFeatureCapability(_Model): + name: str + + + class azure.mgmt.horizondb.models.PoolForPatchUpdate(_Model): + properties: Optional[PoolPropertiesForPatchUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[PoolPropertiesForPatchUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolHighAvailability(_Model): + mode: Union[str, PoolHighAvailabilityMode] + + @overload + def __init__( + self, + *, + mode: Union[str, PoolHighAvailabilityMode] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolHighAvailabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANY_ZONE = "AnyZone" + DISABLED = "Disabled" + ZONE_REDUNDANT = "ZoneRedundant" + + + class azure.mgmt.horizondb.models.PoolHighAvailabilityPatch(_Model): + mode: Optional[Union[str, PoolHighAvailabilityMode]] + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, PoolHighAvailabilityMode]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolParameterGroupReference(_Model): + apply_method: Union[str, ParameterApplyMethod] + parameter_group_resource_id: str + sync_status: Optional[Union[str, ParameterGroupSyncStatus]] + + @overload + def __init__( + self, + *, + apply_method: Union[str, ParameterApplyMethod], + parameter_group_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolParameterGroupReferenceForPatchUpdate(_Model): + apply_method: Optional[Union[str, ParameterApplyMethod]] + parameter_group_resource_id: Optional[str] + + @overload + def __init__( + self, + *, + apply_method: Optional[Union[str, ParameterApplyMethod]] = ..., + parameter_group_resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolProperties(_Model): + compute_model: PoolComputeModel + high_availability: PoolHighAvailability + node_count: int + parameter_group: PoolParameterGroupReference + provisioning_state: Optional[Union[str, ProvisioningState]] + scheduled_maintenance: Optional[ScheduledMaintenanceProperties] + state: Optional[Union[str, PoolState]] + + @overload + def __init__( + self, + *, + compute_model: PoolComputeModel, + high_availability: PoolHighAvailability, + node_count: int, + parameter_group: PoolParameterGroupReference, + scheduled_maintenance: Optional[ScheduledMaintenanceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolPropertiesForPatchUpdate(_Model): + compute_model: Optional[PoolComputeModelForPatchUpdate] + high_availability: Optional[PoolHighAvailabilityPatch] + node_count: Optional[int] + parameter_group: Optional[PoolParameterGroupReferenceForPatchUpdate] + scheduled_maintenance: Optional[ScheduledMaintenancePropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + compute_model: Optional[PoolComputeModelForPatchUpdate] = ..., + high_availability: Optional[PoolHighAvailabilityPatch] = ..., + node_count: Optional[int] = ..., + parameter_group: Optional[PoolParameterGroupReferenceForPatchUpdate] = ..., + scheduled_maintenance: Optional[ScheduledMaintenancePropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PoolState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELETING = "Deleting" + INACCESSIBLE = "Inaccessible" + PROVISIONING = "Provisioning" + READY = "Ready" + RESTARTING = "Restarting" + STARTING = "Starting" + STOPPED = "Stopped" + STOPPING = "Stopping" + UPDATING = "Updating" + + + class azure.mgmt.horizondb.models.PostgreSqlCapabilityVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + V17 = "17" + V18 = "18" + + + class azure.mgmt.horizondb.models.PostgreSqlVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + V17 = "17" + V18 = "18" + + + class azure.mgmt.horizondb.models.PostgreSqlVersionCapability(_Model): + name: Union[str, PostgreSqlCapabilityVersion] + supported_versions_to_upgrade: list[Union[str, PostgreSqlCapabilityVersion]] + + + class azure.mgmt.horizondb.models.PrincipalTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GROUP = "Group" + SERVICE_PRINCIPAL = "ServicePrincipal" + UNKNOWN = "Unknown" + USER = "User" + + + class azure.mgmt.horizondb.models.PrivateEndpoint(_Model): + id: Optional[str] + + + class azure.mgmt.horizondb.models.PrivateEndpointConnectionProperties(_Model): + group_ids: Optional[list[str]] + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: PrivateLinkServiceConnectionState + provisioning_state: Optional[Union[str, PrivateEndpointConnectionProvisioningState]] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: PrivateLinkServiceConnectionState + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.horizondb.models.PrivateEndpointConnectionResource(Resource): + id: str + name: str + properties: Optional[PrivateEndpointConnectionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateEndpointConnectionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + PENDING = "Pending" + REJECTED = "Rejected" + + + class azure.mgmt.horizondb.models.PrivateLinkResource(ProxyResource): + id: str + name: str + properties: Optional[PrivateLinkResourceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateLinkResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateLinkResourceProperties(_Model): + group_id: Optional[str] + required_members: Optional[list[str]] + required_zone_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + required_zone_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateLinkServiceConnectionState(_Model): + actions_required: Optional[str] + description: Optional[str] + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] + + @overload + def __init__( + self, + *, + actions_required: Optional[str] = ..., + description: Optional[str] = ..., + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ProvisionedComputeModelCapability(ComputeModelCapability, discriminator='Provisioned'): + recommended_v_core_count: int + supported_compute_sizes: list[ComputeSizeCapability] + type: Literal[PoolComputeModelType.PROVISIONED] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + PROVISIONING = "Provisioning" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.horizondb.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.horizondb.models.PublicNetworkAccessState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.ReadWritePoolProperties(_Model): + designated_pool_resource_id: Optional[str] + + + class azure.mgmt.horizondb.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.horizondb.models.ScheduledMaintenanceManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "System" + + + class azure.mgmt.horizondb.models.ScheduledMaintenanceProperties(_Model): + maintenance_management_type: str + + @overload + def __init__( + self, + *, + maintenance_management_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ScheduledMaintenancePropertiesForPatchUpdate(_Model): + maintenance_management_type: Optional[Union[str, ScheduledMaintenanceManagementType]] + + @overload + def __init__( + self, + *, + maintenance_management_type: Optional[Union[str, ScheduledMaintenanceManagementType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.SystemScheduledMaintenanceProperties(ScheduledMaintenanceProperties, discriminator='System'): + maintenance_management_type: Literal[ScheduledMaintenanceManagementType.SYSTEM] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + +namespace azure.mgmt.horizondb.operations + + class azure.mgmt.horizondb.operations.AuthenticationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[Authentication]: ... + + + class azure.mgmt.horizondb.operations.CapabilitiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + location: str, + **kwargs: Any + ) -> Capability: ... + + @distributed_trace + def list( + self, + location: str, + **kwargs: Any + ) -> ItemPaged[Capability]: ... + + + class azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: ChangeDataCaptureCapability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureCapability]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: ChangeDataCaptureCapability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureCapability]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureCapability]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: ChangeDataCaptureCapabilityForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureCapability]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: ChangeDataCaptureCapabilityForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureCapability]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureCapability]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ChangeDataCaptureCapability: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[ChangeDataCaptureCapability]: ... + + + class azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: ChangeDataCaptureConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureConfiguration]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: ChangeDataCaptureConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureConfiguration]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureConfiguration]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: ChangeDataCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureConfiguration]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: ChangeDataCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureConfiguration]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureConfiguration]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + **kwargs: Any + ) -> ChangeDataCaptureConfiguration: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[ChangeDataCaptureConfiguration]: ... + + + class azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: ActivateChangeDataCaptureIdentityRequest, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[ActivateChangeDataCaptureIdentityResult]: ... + + @overload + def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: ActivateChangeDataCaptureIdentityRequest, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[ActivateChangeDataCaptureIdentityResult]: ... + + @overload + def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[ActivateChangeDataCaptureIdentityResult]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureDestination]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureDestination]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureDestination]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: ChangeDataCaptureDestinationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureDestination]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: ChangeDataCaptureDestinationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureDestination]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ChangeDataCaptureDestination]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + **kwargs: Any + ) -> ChangeDataCaptureDestination: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[ChangeDataCaptureDestination]: ... + + + class azure.mgmt.horizondb.operations.ClustersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def begin_failover( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: ClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: ClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cluster]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> Cluster: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Cluster]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Cluster]: ... + + + class azure.mgmt.horizondb.operations.DefaultParameterGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + location: str, + name: str, + **kwargs: Any + ) -> DefaultParameterGroup: ... + + @distributed_trace + def list_by_subscription_and_region( + self, + location: str, + **kwargs: Any + ) -> ItemPaged[DefaultParameterGroup]: ... + + + class azure.mgmt.horizondb.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + endpoint_name: str, + **kwargs: Any + ) -> Endpoint: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[Endpoint]: ... + + + class azure.mgmt.horizondb.operations.FirewallRulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FirewallRule]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FirewallRule]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FirewallRule]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + **kwargs: Any + ) -> FirewallRule: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> ItemPaged[FirewallRule]: ... + + + class azure.mgmt.horizondb.operations.IdentityAssignmentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: IdentityAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[IdentityAssignment]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: IdentityAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[IdentityAssignment]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[IdentityAssignment]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + **kwargs: Any + ) -> IdentityAssignment: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + **kwargs: Any + ) -> ItemPaged[IdentityAssignment]: ... + + + class azure.mgmt.horizondb.operations.LogCaptureConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: LogCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[LogCaptureConfiguration]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: LogCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[LogCaptureConfiguration]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[LogCaptureConfiguration]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + **kwargs: Any + ) -> LogCaptureConfiguration: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[LogCaptureConfiguration]: ... + + + class azure.mgmt.horizondb.operations.LogFilesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + log_file_name: str, + **kwargs: Any + ) -> LogFile: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[LogFile]: ... + + @distributed_trace + def list_download_urls( + self, + resource_group_name: str, + cluster_name: str, + log_file_name: str, + **kwargs: Any + ) -> LogFileDownloadUrl: ... + + + class azure.mgmt.horizondb.operations.MaintenanceEventsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_apply_now( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + **kwargs: Any + ) -> LROPoller[MaintenanceEventActionResponse]: ... + + @overload + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[MaintenanceEventActionResponse]: ... + + @overload + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[MaintenanceEventActionResponse]: ... + + @overload + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[MaintenanceEventActionResponse]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + **kwargs: Any + ) -> MaintenanceEvent: ... + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + *, + filter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[MaintenanceEvent]: ... -namespace azure.mgmt.horizondb.operations - class azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations: + class azure.mgmt.horizondb.operations.MicrosoftEntraAdministratorsOperations: def __init__( self, @@ -1568,31 +4514,31 @@ namespace azure.mgmt.horizondb.operations ) -> None: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, object_id: str, - resource: HorizonDbAdministratorAdd, + resource: MicrosoftEntraAdministratorAdd, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbAdministrator]: ... + ) -> LROPoller[MicrosoftEntraAdministrator]: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, object_id: str, - resource: HorizonDbAdministratorAdd, + resource: MicrosoftEntraAdministratorAdd, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbAdministrator]: ... + ) -> LROPoller[MicrosoftEntraAdministrator]: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, @@ -1601,10 +4547,9 @@ namespace azure.mgmt.horizondb.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbAdministrator]: ... + ) -> LROPoller[MicrosoftEntraAdministrator]: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id']}, api_versions_list=['2026-05-01-preview']) def begin_delete( self, resource_group_name: str, @@ -1614,26 +4559,24 @@ namespace azure.mgmt.horizondb.operations ) -> LROPoller[None]: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id', 'accept']}, api_versions_list=['2026-05-01-preview']) def get( self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> HorizonDbAdministrator: ... + ) -> MicrosoftEntraAdministrator: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged[HorizonDbAdministrator]: ... + ) -> ItemPaged[MicrosoftEntraAdministrator]: ... - class azure.mgmt.horizondb.operations.HorizonDbClustersOperations: + class azure.mgmt.horizondb.operations.MicrosoftEntraAuthenticationsOperations: def __init__( self, @@ -1642,29 +4585,29 @@ namespace azure.mgmt.horizondb.operations ) -> None: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: HorizonDbCluster, + resource: MicrosoftEntraAuthentication, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbCluster]: ... + ) -> LROPoller[MicrosoftEntraAuthentication]: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: HorizonDbCluster, + resource: MicrosoftEntraAuthentication, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbCluster]: ... + ) -> LROPoller[MicrosoftEntraAuthentication]: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, @@ -1672,64 +4615,29 @@ namespace azure.mgmt.horizondb.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbCluster]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) - def begin_restart( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) - def begin_start( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) - def begin_stop( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[MicrosoftEntraAuthentication]: ... @overload def begin_update( self, resource_group_name: str, cluster_name: str, - properties: HorizonDbClusterForPatchUpdate, + properties: MicrosoftEntraAuthenticationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbCluster]: ... + ) -> LROPoller[MicrosoftEntraAuthentication]: ... @overload def begin_update( self, resource_group_name: str, cluster_name: str, - properties: HorizonDbClusterForPatchUpdate, + properties: MicrosoftEntraAuthenticationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbCluster]: ... + ) -> LROPoller[MicrosoftEntraAuthentication]: ... @overload def begin_update( @@ -1740,7 +4648,7 @@ namespace azure.mgmt.horizondb.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbCluster]: ... + ) -> LROPoller[MicrosoftEntraAuthentication]: ... @distributed_trace def get( @@ -1748,20 +4656,10 @@ namespace azure.mgmt.horizondb.operations resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> HorizonDbCluster: ... - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> ItemPaged[HorizonDbCluster]: ... - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged[HorizonDbCluster]: ... + ) -> MicrosoftEntraAuthentication: ... - class azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations: + class azure.mgmt.horizondb.operations.NodesOperations: def __init__( self, @@ -1769,76 +4667,39 @@ namespace azure.mgmt.horizondb.operations **kwargs ) -> None: ... - @overload - def begin_create_or_update( + @distributed_trace + def get( self, resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, - resource: HorizonDbFirewallRule, - *, - content_type: str = "application/json", + node_name: str, **kwargs: Any - ) -> LROPoller[HorizonDbFirewallRule]: ... + ) -> Node: ... - @overload - def begin_create_or_update( + @distributed_trace + def list( self, resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, - resource: HorizonDbFirewallRule, - *, - content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbFirewallRule]: ... + ) -> ItemPaged[Node]: ... - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[HorizonDbFirewallRule]: ... - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - firewall_rule_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... + class azure.mgmt.horizondb.operations.Operations: - @distributed_trace - def get( + def __init__( self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - firewall_rule_name: str, - **kwargs: Any - ) -> HorizonDbFirewallRule: ... + *args, + **kwargs + ) -> None: ... @distributed_trace - def list( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - **kwargs: Any - ) -> ItemPaged[HorizonDbFirewallRule]: ... + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... - class azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations: + class azure.mgmt.horizondb.operations.ParameterGroupsOperations: def __init__( self, @@ -1847,29 +4708,29 @@ namespace azure.mgmt.horizondb.operations ) -> None: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, - resource: HorizonDbParameterGroup, + resource: ParameterGroup, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbParameterGroup]: ... + ) -> LROPoller[ParameterGroup]: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, - resource: HorizonDbParameterGroup, + resource: ParameterGroup, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbParameterGroup]: ... + ) -> LROPoller[ParameterGroup]: ... @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, @@ -1877,7 +4738,7 @@ namespace azure.mgmt.horizondb.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbParameterGroup]: ... + ) -> LROPoller[ParameterGroup]: ... @distributed_trace def begin_delete( @@ -1892,22 +4753,22 @@ namespace azure.mgmt.horizondb.operations self, resource_group_name: str, parameter_group_name: str, - properties: HorizonDbParameterGroupForPatchUpdate, + properties: ParameterGroupForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbParameterGroup]: ... + ) -> LROPoller[ParameterGroup]: ... @overload def begin_update( self, resource_group_name: str, parameter_group_name: str, - properties: HorizonDbParameterGroupForPatchUpdate, + properties: ParameterGroupForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbParameterGroup]: ... + ) -> LROPoller[ParameterGroup]: ... @overload def begin_update( @@ -1918,7 +4779,7 @@ namespace azure.mgmt.horizondb.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbParameterGroup]: ... + ) -> LROPoller[ParameterGroup]: ... @distributed_trace def get( @@ -1926,17 +4787,17 @@ namespace azure.mgmt.horizondb.operations resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> HorizonDbParameterGroup: ... + ) -> ParameterGroup: ... @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged[HorizonDbParameterGroup]: ... + ) -> ItemPaged[ParameterGroup]: ... @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged[HorizonDbParameterGroup]: ... + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[ParameterGroup]: ... @distributed_trace def list_connections( @@ -1944,20 +4805,10 @@ namespace azure.mgmt.horizondb.operations resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> ItemPaged[HorizonDbParameterGroupConnectionProperties]: ... - - @distributed_trace - def list_versions( - self, - resource_group_name: str, - parameter_group_name: str, - *, - version: Optional[int] = ..., - **kwargs: Any - ) -> ItemPaged[HorizonDbParameterGroup]: ... + ) -> ItemPaged[ParameterGroupConnectionProperties]: ... - class azure.mgmt.horizondb.operations.HorizonDbPoolsOperations: + class azure.mgmt.horizondb.operations.PasswordAuthenticationsOperations: def __init__( self, @@ -1965,238 +4816,287 @@ namespace azure.mgmt.horizondb.operations **kwargs ) -> None: ... - @distributed_trace - def get( + @overload + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, + resource: PasswordAuthentication, + *, + content_type: str = "application/json", **kwargs: Any - ) -> HorizonDbPool: ... + ) -> LROPoller[PasswordAuthentication]: ... - @distributed_trace - def list( + @overload + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, + resource: PasswordAuthentication, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[HorizonDbPool]: ... - + ) -> LROPoller[PasswordAuthentication]: ... - class azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations: + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PasswordAuthentication]: ... - def __init__( + @overload + def begin_update( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + cluster_name: str, + properties: PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PasswordAuthentication]: ... - @distributed_trace - def begin_delete( + @overload + def begin_update( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, + properties: PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[PasswordAuthentication]: ... - @distributed_trace - def get( + @overload + def begin_update( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> LROPoller[PasswordAuthentication]: ... @distributed_trace - def list( + def get( self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged[PrivateEndpointConnectionResource]: ... + ) -> PasswordAuthentication: ... + + + class azure.mgmt.horizondb.operations.PoolsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @overload - def update_status( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: PrivateEndpointConnectionResource, + pool_name: str, + resource: Pool, *, content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> LROPoller[Pool]: ... @overload - def update_status( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: PrivateEndpointConnectionResource, + pool_name: str, + resource: Pool, *, content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> LROPoller[Pool]: ... @overload - def update_status( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, + pool_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> PrivateEndpointConnectionResource: ... + ) -> LROPoller[Pool]: ... - - class azure.mgmt.horizondb.operations.HorizonDbPrivateLinkResourcesOperations: - - def __init__( + @distributed_trace + def begin_delete( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @distributed_trace - def get( + def begin_restart( self, resource_group_name: str, cluster_name: str, - group_name: str, + pool_name: str, **kwargs: Any - ) -> HorizonDbPrivateLinkResource: ... + ) -> LROPoller[Pool]: ... @distributed_trace - def list( + def begin_start( self, resource_group_name: str, cluster_name: str, + pool_name: str, **kwargs: Any - ) -> ItemPaged[HorizonDbPrivateLinkResource]: ... + ) -> LROPoller[Pool]: ... - - class azure.mgmt.horizondb.operations.HorizonDbReplicasOperations: - - def __init__( + @distributed_trace + def begin_stop( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> LROPoller[Pool]: ... @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, - resource: HorizonDbReplica, + properties: PoolForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbReplica]: ... + ) -> LROPoller[Pool]: ... @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, - resource: HorizonDbReplica, + properties: PoolForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbReplica]: ... + ) -> LROPoller[Pool]: ... @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, - resource: IO[bytes], + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbReplica]: ... + ) -> LROPoller[Pool]: ... @distributed_trace - def begin_delete( + def get( self, resource_group_name: str, cluster_name: str, pool_name: str, - replica_name: str, **kwargs: Any - ) -> LROPoller[None]: ... + ) -> Pool: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[Pool]: ... + + + class azure.mgmt.horizondb.operations.PrivateEndpointConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @overload - def begin_update( + def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: HorizonDbReplicaForPatchUpdate, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbReplica]: ... + ) -> LROPoller[PrivateEndpointConnectionResource]: ... @overload - def begin_update( + def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: HorizonDbReplicaForPatchUpdate, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbReplica]: ... + ) -> LROPoller[PrivateEndpointConnectionResource]: ... @overload - def begin_update( + def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: IO[bytes], + private_endpoint_connection_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[HorizonDbReplica]: ... + ) -> LROPoller[PrivateEndpointConnectionResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @distributed_trace def get( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, + private_endpoint_connection_name: str, **kwargs: Any - ) -> HorizonDbReplica: ... + ) -> PrivateEndpointConnectionResource: ... @distributed_trace def list( self, resource_group_name: str, cluster_name: str, - pool_name: str, **kwargs: Any - ) -> ItemPaged[HorizonDbReplica]: ... + ) -> ItemPaged[PrivateEndpointConnectionResource]: ... - class azure.mgmt.horizondb.operations.Operations: + class azure.mgmt.horizondb.operations.PrivateLinkResourcesOperations: def __init__( self, @@ -2205,158 +5105,372 @@ namespace azure.mgmt.horizondb.operations ) -> None: ... @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + def get( + self, + resource_group_name: str, + cluster_name: str, + group_name: str, + **kwargs: Any + ) -> PrivateLinkResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[PrivateLinkResource]: ... namespace azure.mgmt.horizondb.types - class azure.mgmt.horizondb.types.HorizonDbAdministratorAdd(TypedDict, total=False): - key "properties": Required[HorizonDbAdministratorPropertiesForAdd] - properties: HorizonDbAdministratorPropertiesForAdd + class azure.mgmt.horizondb.types.ActivateChangeDataCaptureIdentityRequest(TypedDict, total=False): + key "drainExistingSessions": bool + key "identityAssignmentResourceId": Required[str] + drainExistingSessions: bool + identityAssignmentResourceId: str - class azure.mgmt.horizondb.types.HorizonDbAdministratorPropertiesForAdd(TypedDict, total=False): - key "principalName": Required[str] - key "principalType": Required[Union[str, PrincipalTypes]] - key "tenantId": str - principalName: str - principalType: Union[str, PrincipalTypes] - tenantId: str + class azure.mgmt.horizondb.types.BackupProperties(TypedDict, total=False): + key "earliestRestorePointUtc": str + key "geoRedundancy": Required[Union[str, GeoRedundancyState]] + key "retentionDays": int + earliestRestorePointUtc: str + geoRedundancy: Union[str, GeoRedundancyState] + retentionDays: int + + class azure.mgmt.horizondb.types.BackupPropertiesForPatchUpdate(TypedDict, total=False): + key "retentionDays": int + retentionDays: int - class azure.mgmt.horizondb.types.HorizonDbCluster(TrackedResource): + + class azure.mgmt.horizondb.types.ChangeDataCaptureCapability(ProxyResource): + key "eTag": str key "id": str - key "identity": ForwardRef('ManagedServiceIdentity', module='types') - key "location": Required[str] key "name": str - key "properties": ForwardRef('HorizonDbClusterProperties', module='types') + key "properties": ForwardRef('ChangeDataCaptureCapabilityProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str + eTag: str id: str - identity: ManagedServiceIdentity - location: str name: str - properties: HorizonDbClusterProperties + properties: ChangeDataCaptureCapabilityProperties systemData: SystemData - tags: dict[str, str] type: str - class azure.mgmt.horizondb.types.HorizonDbClusterAuthConfig(TypedDict, total=False): - key "entraIdAuth": Union[str, AuthenticationState] - key "passwordAuth": Union[str, AuthenticationState] - key "tenantId": str - entraIdAuth: Union[str, AuthenticationState] - passwordAuth: Union[str, AuthenticationState] + class azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('ChangeDataCaptureCapabilityPropertiesForPatchUpdate', module='types') + properties: ChangeDataCaptureCapabilityPropertiesForPatchUpdate + + + class azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityProperties(TypedDict, total=False): + key "autoUpgradeExtension": bool + key "configurationCount": Required[int] + key "desiredState": Required[Union[str, ChangeDataCaptureDesiredState]] + key "destinationCount": Required[int] + key "effectiveState": Required[Union[str, ChangeDataCaptureEffectiveState]] + key "extension": Required[ChangeDataCaptureExtensionStatus] + key "prerequisites": Required[ChangeDataCapturePrerequisiteStatus] + key "provisioningState": Union[str, ProvisioningState] + key "replicationArchitecture": Required[Union[str, ChangeDataCaptureReplicationArchitecture]] + key "status": Required[ChangeDataCaptureStatus] + autoUpgradeExtension: bool + configurationCount: int + desiredState: Union[str, ChangeDataCaptureDesiredState] + destinationCount: int + effectiveState: Union[str, ChangeDataCaptureEffectiveState] + extension: ChangeDataCaptureExtensionStatus + prerequisites: ChangeDataCapturePrerequisiteStatus + provisioningState: Union[str, ProvisioningState] + replicationArchitecture: Union[str, ChangeDataCaptureReplicationArchitecture] + status: ChangeDataCaptureStatus + + + class azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityPropertiesForPatchUpdate(TypedDict, total=False): + key "autoUpgradeExtension": bool + key "desiredState": Union[str, ChangeDataCaptureDesiredState] + autoUpgradeExtension: bool + desiredState: Union[str, ChangeDataCaptureDesiredState] + + + class azure.mgmt.horizondb.types.ChangeDataCaptureConfiguration(ProxyResource): + key "eTag": str + key "id": str + key "name": str + key "properties": ForwardRef('ChangeDataCaptureConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + eTag: str + id: str + name: str + properties: ChangeDataCaptureConfigurationProperties + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('ChangeDataCaptureConfigurationPropertiesForPatchUpdate', module='types') + properties: ChangeDataCaptureConfigurationPropertiesForPatchUpdate + + + class azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationProperties(TypedDict, total=False): + key "databaseName": Required[str] + key "desiredState": Required[Union[str, ChangeDataCaptureDesiredState]] + key "destinationResourceId": Required[str] + key "effectiveState": Required[Union[str, ChangeDataCaptureEffectiveState]] + key "extension": Required[ChangeDataCaptureExtensionStatus] + key "logicalStreamId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "replication": Required[ChangeDataCaptureReplicationStatus] + key "status": Required[ChangeDataCaptureStatus] + key "topology": Required[ChangeDataCaptureTopologyBindingStatus] + key "usageProfile": Required[Union[str, ChangeDataCaptureUsageProfile]] + databaseName: str + desiredState: Union[str, ChangeDataCaptureDesiredState] + destinationResourceId: str + effectiveState: Union[str, ChangeDataCaptureEffectiveState] + extension: ChangeDataCaptureExtensionStatus + logicalStreamId: str + provisioningState: Union[str, ProvisioningState] + replication: ChangeDataCaptureReplicationStatus + status: ChangeDataCaptureStatus + topology: ChangeDataCaptureTopologyBindingStatus + usageProfile: Union[str, ChangeDataCaptureUsageProfile] + + + class azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationPropertiesForPatchUpdate(TypedDict, total=False): + key "desiredState": Union[str, ChangeDataCaptureDesiredState] + desiredState: Union[str, ChangeDataCaptureDesiredState] + + + class azure.mgmt.horizondb.types.ChangeDataCaptureDestination(ProxyResource): + key "eTag": str + key "id": str + key "name": str + key "properties": ForwardRef('ChangeDataCaptureDestinationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + eTag: str + id: str + name: str + properties: ChangeDataCaptureDestinationProperties + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.ChangeDataCaptureDestinationDetails(TypedDict, total=False): + key "destinationType": Required[Literal[ChangeDataCaptureDestinationType.FABRIC]] + key "protocol": Required[Literal[ChangeDataCaptureProtocol.NATIVE]] + key "workspaceId": Required[str] + destinationType: Literal[ChangeDataCaptureDestinationType.FABRIC] + protocol: Literal[ChangeDataCaptureProtocol.NATIVE] + workspaceId: str + + + class azure.mgmt.horizondb.types.ChangeDataCaptureDestinationForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('ChangeDataCaptureDestinationPropertiesForPatchUpdate', module='types') + properties: ChangeDataCaptureDestinationPropertiesForPatchUpdate + + + class azure.mgmt.horizondb.types.ChangeDataCaptureDestinationProperties(TypedDict, total=False): + key "activeIdentityAssignmentResourceId": str + key "configurationCount": Required[int] + key "desiredState": Required[Union[str, ChangeDataCaptureDesiredState]] + key "destination": Required[ChangeDataCaptureDestinationDetails] + key "effectiveState": Required[Union[str, ChangeDataCaptureDestinationEffectiveState]] + key "provisioningState": Union[str, ProvisioningState] + key "status": Required[ChangeDataCaptureStatus] + activeIdentityAssignmentResourceId: str + configurationCount: int + desiredState: Union[str, ChangeDataCaptureDesiredState] + destination: ChangeDataCaptureDestinationDetails + effectiveState: Union[str, ChangeDataCaptureDestinationEffectiveState] + provisioningState: Union[str, ProvisioningState] + status: ChangeDataCaptureStatus + + + class azure.mgmt.horizondb.types.ChangeDataCaptureDestinationPropertiesForPatchUpdate(TypedDict, total=False): + key "desiredState": Union[str, ChangeDataCaptureDesiredState] + desiredState: Union[str, ChangeDataCaptureDesiredState] + + + class azure.mgmt.horizondb.types.ChangeDataCaptureDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FABRIC = "Fabric" + + + class azure.mgmt.horizondb.types.ChangeDataCaptureExtensionStatus(TypedDict, total=False): + key "name": Required[str] + key "state": Required[Union[str, ChangeDataCaptureExtensionState]] + key "version": Required[str] + name: str + state: Union[str, ChangeDataCaptureExtensionState] + version: str + + + class azure.mgmt.horizondb.types.ChangeDataCaptureIdentityAssignmentProperties(TypedDict, total=False): + key "activationState": Required[Union[str, ChangeDataCaptureIdentityActivationState]] + key "effectiveState": Required[Union[str, ChangeDataCaptureIdentityAssignmentState]] + key "identityResourceId": Required[str] + key "principalId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "status": Required[ChangeDataCaptureStatus] + key "tenantId": Required[str] + key "validation": Required[IdentityValidationStatus] + activationState: Union[str, ChangeDataCaptureIdentityActivationState] + effectiveState: Union[str, ChangeDataCaptureIdentityAssignmentState] + identityResourceId: str + principalId: str + provisioningState: Union[str, ProvisioningState] + status: ChangeDataCaptureStatus tenantId: str + validation: IdentityValidationStatus - class azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate(TypedDict, total=False): - key "identity": ForwardRef('ManagedServiceIdentity', module='types') - key "properties": ForwardRef('HorizonDbClusterPropertiesForPatchUpdate', module='types') - identity: ManagedServiceIdentity - properties: HorizonDbClusterPropertiesForPatchUpdate - tags: dict[str, str] + class azure.mgmt.horizondb.types.ChangeDataCapturePrerequisiteStatus(TypedDict, total=False): + key "engineConfigurationState": Required[Union[str, ChangeDataCaptureEngineConfigurationState]] + key "readWriteEndpointState": Required[Union[str, ChangeDataCaptureReadWriteEndpointState]] + engineConfigurationState: Union[str, ChangeDataCaptureEngineConfigurationState] + readWriteEndpointState: Union[str, ChangeDataCaptureReadWriteEndpointState] + + + class azure.mgmt.horizondb.types.ChangeDataCaptureProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NATIVE = "Native" + + class azure.mgmt.horizondb.types.ChangeDataCaptureReplicationStatus(TypedDict, total=False): + key "externalArtifactId": str + key "lastConnectedAtUtc": str + key "state": Required[Union[str, ChangeDataCaptureReplicationState]] + externalArtifactId: str + lastConnectedAtUtc: str + state: Union[str, ChangeDataCaptureReplicationState] - class azure.mgmt.horizondb.types.HorizonDbClusterMirroring(TypedDict, total=False): - key "userAssignedIdentityId": str - databaseNames: list[str] - userAssignedIdentityId: str + class azure.mgmt.horizondb.types.ChangeDataCaptureStatus(TypedDict, total=False): + key "code": Required[str] + key "message": Required[str] + code: str + message: str - class azure.mgmt.horizondb.types.HorizonDbClusterParameterGroupConnectionProperties(TypedDict, total=False): - key "applyImmediately": bool + + class azure.mgmt.horizondb.types.ChangeDataCaptureTopologyBindingStatus(TypedDict, total=False): + key "activeClusterResourceId": Required[str] + key "generation": Required[int] + key "replacementConfigurationResourceId": str + key "state": Required[Union[str, ChangeDataCaptureTopologyBindingState]] + activeClusterResourceId: str + generation: int + replacementConfigurationResourceId: str + state: Union[str, ChangeDataCaptureTopologyBindingState] + + + class azure.mgmt.horizondb.types.Cluster(TrackedResource): key "id": str - key "syncStatus": str - applyImmediately: bool + key "identity": ForwardRef('HorizonDbClusterManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('ClusterProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str id: str - syncStatus: str + identity: HorizonDbClusterManagedServiceIdentity + location: str + name: str + properties: ClusterProperties + systemData: SystemData + tags: dict[str, str] + type: str - class azure.mgmt.horizondb.types.HorizonDbClusterProperties(TypedDict, total=False): - key "administratorLogin": Required[str] - key "administratorLoginPassword": str - key "authConfig": ForwardRef('HorizonDbClusterAuthConfig', module='types') - key "computeModel": ForwardRef('HorizonDbComputeModel', module='types') - key "createMode": Union[str, CreateModeCluster] - key "fullyQualifiedDomainName": str - key "mirroring": ForwardRef('HorizonDbClusterMirroring', module='types') + class azure.mgmt.horizondb.types.ClusterForPatchUpdate(TypedDict, total=False): + key "identity": ForwardRef('HorizonDbClusterManagedServiceIdentity', module='types') + key "properties": ForwardRef('ClusterPropertiesForPatchUpdate', module='types') + identity: HorizonDbClusterManagedServiceIdentity + properties: ClusterPropertiesForPatchUpdate + tags: dict[str, str] + + + class azure.mgmt.horizondb.types.ClusterProperties(TypedDict, total=False): + key "aiModelManagement": Union[str, AiModelManagementStatus] + key "backup": ForwardRef('BackupProperties', module='types') + key "creationMode": Union[str, ClusterCreateMode] + key "creationSourceClusterLocation": str + key "creationSourceClusterResourceId": str + key "dataEncryption": ForwardRef('HorizonDbClusterDataEncryption', module='types') key "network": ForwardRef('Network', module='types') - key "parameterGroup": ForwardRef('HorizonDbClusterParameterGroupConnectionProperties', module='types') - key "pointInTimeUTC": str - key "poolName": str - key "processorType": str - key "provisioningState": Union[str, ProvisioningState] - key "readonlyEndpoint": str - key "replicaCount": int - key "sourceClusterResourceId": str - key "state": Union[str, State] - key "vCores": int - key "version": str - key "zonePlacementPolicy": Union[str, ZonePlacementPolicy] - administratorLogin: str - administratorLoginPassword: str - authConfig: HorizonDbClusterAuthConfig - computeModel: HorizonDbComputeModel - createMode: Union[str, CreateModeCluster] - fullyQualifiedDomainName: str - mirroring: HorizonDbClusterMirroring + key "pointInTimeUtc": str + key "postgreSqlVersion": Union[str, PostgreSqlVersion] + key "provisioningState": Required[Union[str, ProvisioningState]] + key "readWritePool": Required[ReadWritePoolProperties] + key "state": Required[Union[str, ClusterState]] + aiModelManagement: Union[str, AiModelManagementStatus] + backup: BackupProperties + creationMode: Union[str, ClusterCreateMode] + creationSourceClusterLocation: str + creationSourceClusterResourceId: str + dataEncryption: HorizonDbClusterDataEncryption network: Network - parameterGroup: HorizonDbClusterParameterGroupConnectionProperties - pointInTimeUTC: str - poolName: str - processorType: str + pointInTimeUtc: str + postgreSqlVersion: Union[str, PostgreSqlVersion] provisioningState: Union[str, ProvisioningState] - readonlyEndpoint: str - replicaCount: int - sourceClusterResourceId: str - state: Union[str, State] - vCores: int - version: str - zonePlacementPolicy: Union[str, ZonePlacementPolicy] + readWritePool: ReadWritePoolProperties + state: Union[str, ClusterState] - class azure.mgmt.horizondb.types.HorizonDbClusterPropertiesForPatchUpdate(TypedDict, total=False): - key "administratorLoginPassword": str - key "authConfig": ForwardRef('HorizonDbClusterAuthConfig', module='types') - key "computeModel": ForwardRef('HorizonDbComputeModel', module='types') - key "mirroring": ForwardRef('HorizonDbClusterMirroring', module='types') - key "parameterGroup": ForwardRef('HorizonDbClusterParameterGroupConnectionProperties', module='types') - key "vCores": int - administratorLoginPassword: str - authConfig: HorizonDbClusterAuthConfig - computeModel: HorizonDbComputeModel - mirroring: HorizonDbClusterMirroring - parameterGroup: HorizonDbClusterParameterGroupConnectionProperties - vCores: int + class azure.mgmt.horizondb.types.ClusterPropertiesForPatchUpdate(TypedDict, total=False): + key "aiModelManagement": Union[str, AiModelManagementStatus] + key "backup": ForwardRef('BackupPropertiesForPatchUpdate', module='types') + key "dataEncryption": ForwardRef('HorizonDbClusterDataEncryptionForPatchUpdate', module='types') + key "network": ForwardRef('NetworkForPatchUpdate', module='types') + aiModelManagement: Union[str, AiModelManagementStatus] + backup: BackupPropertiesForPatchUpdate + dataEncryption: HorizonDbClusterDataEncryptionForPatchUpdate + network: NetworkForPatchUpdate - class azure.mgmt.horizondb.types.HorizonDbComputeModel(TypedDict, total=False): - key "maxvCores": float - key "minvCores": float - key "type": Union[str, HorizonDbComputeModelType] - key "vCores": int - maxvCores: float - minvCores: float - type: Union[str, HorizonDbComputeModelType] - vCores: int + class azure.mgmt.horizondb.types.ErrorAdditionalInfo(TypedDict, total=False): + key "info": Any + key "type": str + info: Any + type: str + + + class azure.mgmt.horizondb.types.ErrorDetail(TypedDict, total=False): + key "code": str + key "message": str + key "target": str + additionalInfo: list[ErrorAdditionalInfo] + code: str + details: list[ErrorDetail] + message: str + target: str - class azure.mgmt.horizondb.types.HorizonDbFirewallRule(ProxyResource): + class azure.mgmt.horizondb.types.FabricDestinationDetails(TypedDict, total=False): + key "destinationType": Required[Literal[ChangeDataCaptureDestinationType.FABRIC]] + key "protocol": Required[Literal[ChangeDataCaptureProtocol.NATIVE]] + key "workspaceId": Required[str] + destinationType: Literal[ChangeDataCaptureDestinationType.FABRIC] + protocol: Literal[ChangeDataCaptureProtocol.NATIVE] + workspaceId: str + + + class azure.mgmt.horizondb.types.FirewallRule(ProxyResource): key "id": str key "name": str - key "properties": ForwardRef('HorizonDbFirewallRuleProperties', module='types') + key "properties": ForwardRef('FirewallRuleProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str id: str name: str - properties: HorizonDbFirewallRuleProperties + properties: FirewallRuleProperties systemData: SystemData type: str - class azure.mgmt.horizondb.types.HorizonDbFirewallRuleProperties(TypedDict, total=False): + class azure.mgmt.horizondb.types.FirewallRuleProperties(TypedDict, total=False): key "description": str key "endIpAddress": Required[str] key "provisioningState": Union[str, ProvisioningState] @@ -2367,104 +5481,171 @@ namespace azure.mgmt.horizondb.types startIpAddress: str - class azure.mgmt.horizondb.types.HorizonDbParameterGroup(TrackedResource): + class azure.mgmt.horizondb.types.HorizonDbClusterDataEncryption(TypedDict, total=False): + key "primaryEncryptionKeyCurrentVersion": str + key "primaryEncryptionKeyStatus": Union[str, HorizonDbClusterEncryptionKeyStatus] + key "primaryKeyUri": str + key "primaryUserAssignedIdentityId": str + key "type": Union[str, HorizonDbClusterDataEncryptionType] + primaryEncryptionKeyCurrentVersion: str + primaryEncryptionKeyStatus: Union[str, HorizonDbClusterEncryptionKeyStatus] + primaryKeyUri: str + primaryUserAssignedIdentityId: str + type: Union[str, HorizonDbClusterDataEncryptionType] + + + class azure.mgmt.horizondb.types.HorizonDbClusterDataEncryptionForPatchUpdate(TypedDict, total=False): + key "primaryKeyUri": str + key "primaryUserAssignedIdentityId": str + key "type": Union[str, HorizonDbClusterDataEncryptionType] + primaryKeyUri: str + primaryUserAssignedIdentityId: str + type: Union[str, HorizonDbClusterDataEncryptionType] + + + class azure.mgmt.horizondb.types.HorizonDbClusterManagedServiceIdentity(TypedDict, total=False): + key "type": Required[Union[str, HorizonDbClusterIdentityType]] + type: Union[str, HorizonDbClusterIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.horizondb.types.IdentityAssignment(ProxyResource): + key "eTag": str key "id": str - key "location": Required[str] key "name": str - key "properties": ForwardRef('HorizonDbParameterGroupProperties', module='types') + key "properties": ForwardRef('ChangeDataCaptureIdentityAssignmentProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str + eTag: str id: str - location: str name: str - properties: HorizonDbParameterGroupProperties + properties: ChangeDataCaptureIdentityAssignmentProperties systemData: SystemData - tags: dict[str, str] type: str - class azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate(TypedDict, total=False): - key "properties": ForwardRef('HorizonDbParameterGroupPropertiesForPatchUpdate', module='types') - properties: HorizonDbParameterGroupPropertiesForPatchUpdate - tags: dict[str, str] + class azure.mgmt.horizondb.types.IdentityValidationStatus(TypedDict, total=False): + key "error": ForwardRef('ErrorDetail', module='types') + key "state": Required[Union[str, ChangeDataCaptureIdentityValidationState]] + key "validatedAtUtc": str + error: ErrorDetail + state: Union[str, ChangeDataCaptureIdentityValidationState] + validatedAtUtc: str - class azure.mgmt.horizondb.types.HorizonDbParameterGroupProperties(TypedDict, total=False): - key "applyImmediately": bool - key "description": str - key "pgVersion": int - key "provisioningState": Union[str, ProvisioningState] - key "version": int - applyImmediately: bool - description: str - parameters: list[ParameterProperties] - pgVersion: int - provisioningState: Union[str, ProvisioningState] - version: int + class azure.mgmt.horizondb.types.LogCaptureConfigurationForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('LogCaptureConfigurationPropertiesForPatchUpdate', module='types') + properties: LogCaptureConfigurationPropertiesForPatchUpdate - class azure.mgmt.horizondb.types.HorizonDbParameterGroupPropertiesForPatchUpdate(TypedDict, total=False): - key "applyImmediately": bool - key "description": str - applyImmediately: bool - description: str - parameters: list[ParameterProperties] + class azure.mgmt.horizondb.types.LogCaptureConfigurationPropertiesForPatchUpdate(TypedDict, total=False): + key "retentionDays": int + key "state": Union[str, LogCaptureState] + retentionDays: int + state: Union[str, LogCaptureState] + + + class azure.mgmt.horizondb.types.MaintenanceEventRescheduleRequest(TypedDict, total=False): + key "postponeToDateTimeUtc": Required[str] + postponeToDateTimeUtc: str + + class azure.mgmt.horizondb.types.MicrosoftEntraAdministratorAdd(TypedDict, total=False): + key "properties": Required[MicrosoftEntraAdministratorPropertiesForAdd] + properties: MicrosoftEntraAdministratorPropertiesForAdd - class azure.mgmt.horizondb.types.HorizonDbReplica(ProxyResource): + + class azure.mgmt.horizondb.types.MicrosoftEntraAdministratorPropertiesForAdd(TypedDict, total=False): + key "principalName": Required[str] + key "principalType": Required[Union[str, PrincipalTypes]] + key "tenantId": str + principalName: str + principalType: Union[str, PrincipalTypes] + tenantId: str + + + class azure.mgmt.horizondb.types.MicrosoftEntraAuthentication(ProxyResource): key "id": str key "name": str - key "properties": ForwardRef('HorizonDbReplicaProperties', module='types') + key "properties": ForwardRef('MicrosoftEntraAuthenticationProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str id: str name: str - properties: HorizonDbReplicaProperties + properties: MicrosoftEntraAuthenticationProperties systemData: SystemData type: str - class azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate(TypedDict, total=False): - key "properties": ForwardRef('HorizonDbReplicaPropertiesForPatchUpdate', module='types') - properties: HorizonDbReplicaPropertiesForPatchUpdate + class azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('MicrosoftEntraAuthenticationPropertiesForPatchUpdate', module='types') + properties: MicrosoftEntraAuthenticationPropertiesForPatchUpdate - class azure.mgmt.horizondb.types.HorizonDbReplicaProperties(TypedDict, total=False): - key "availabilityZone": str - key "fullyQualifiedDomainName": str + class azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationProperties(TypedDict, total=False): key "provisioningState": Union[str, ProvisioningState] - key "role": Union[str, ReplicaRole] - key "status": Union[str, State] - availabilityZone: str - fullyQualifiedDomainName: str + key "state": Required[Union[str, AuthenticationState]] provisioningState: Union[str, ProvisioningState] - role: Union[str, ReplicaRole] - status: Union[str, State] + state: Union[str, AuthenticationState] - class azure.mgmt.horizondb.types.HorizonDbReplicaPropertiesForPatchUpdate(TypedDict, total=False): - key "role": Union[str, ReplicaRole] - role: Union[str, ReplicaRole] + class azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationPropertiesForPatchUpdate(TypedDict, total=False): + key "state": Union[str, AuthenticationState] + state: Union[str, AuthenticationState] - class azure.mgmt.horizondb.types.ManagedServiceIdentity(TypedDict, total=False): - key "principalId": str - key "tenantId": str - key "type": Required[Union[str, ManagedServiceIdentityType]] - principalId: str - tenantId: str - type: Union[str, ManagedServiceIdentityType] - userAssignedIdentities: dict[str, UserAssignedIdentity] + class azure.mgmt.horizondb.types.Network(TypedDict, total=False): + key "publicAccess": Union[str, PublicNetworkAccessState] + publicAccess: Union[str, PublicNetworkAccessState] - class azure.mgmt.horizondb.types.Network(TypedDict, total=False): - key "publicNetworkAccess": Union[str, PublicNetworkAccessState] - publicNetworkAccess: Union[str, PublicNetworkAccessState] + class azure.mgmt.horizondb.types.NetworkForPatchUpdate(TypedDict, total=False): + key "publicAccess": Union[str, PublicNetworkAccessState] + publicAccess: Union[str, PublicNetworkAccessState] + + + class azure.mgmt.horizondb.types.ParameterGroup(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('ParameterGroupProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: ParameterGroupProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.horizondb.types.ParameterGroupForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('ParameterGroupPropertiesForPatchUpdate', module='types') + properties: ParameterGroupPropertiesForPatchUpdate + tags: dict[str, str] + + + class azure.mgmt.horizondb.types.ParameterGroupProperties(TypedDict, total=False): + key "description": str + key "postgreSqlVersion": Required[Union[str, PostgreSqlVersion]] + key "provisioningState": Union[str, ProvisioningState] + description: str + parameters: list[ParameterProperties] + postgreSqlVersion: Union[str, PostgreSqlVersion] + provisioningState: Union[str, ProvisioningState] + + + class azure.mgmt.horizondb.types.ParameterGroupPropertiesForPatchUpdate(TypedDict, total=False): + key "description": str + description: str + parameters: list[ParameterProperties] class azure.mgmt.horizondb.types.ParameterProperties(TypedDict, total=False): key "allowedValues": str key "dataType": str + key "defaultValue": str key "description": str key "documentationLink": str key "isDynamic": bool @@ -2472,8 +5653,10 @@ namespace azure.mgmt.horizondb.types key "name": str key "unit": str key "value": str + key "valueSource": Union[str, ParameterValueSource] allowedValues: str dataType: str + defaultValue: str description: str documentationLink: str isDynamic: bool @@ -2481,6 +5664,141 @@ namespace azure.mgmt.horizondb.types name: str unit: str value: str + valueSource: Union[str, ParameterValueSource] + + + class azure.mgmt.horizondb.types.PasswordAuthentication(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('PasswordAuthenticationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PasswordAuthenticationProperties + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.PasswordAuthenticationForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('PasswordAuthenticationPropertiesForPatchUpdate', module='types') + properties: PasswordAuthenticationPropertiesForPatchUpdate + + + class azure.mgmt.horizondb.types.PasswordAuthenticationProperties(TypedDict, total=False): + key "administratorLogin": str + key "administratorLoginPassword": str + key "provisioningState": Union[str, ProvisioningState] + key "state": Required[Union[str, AuthenticationState]] + administratorLogin: str + administratorLoginPassword: str + provisioningState: Union[str, ProvisioningState] + state: Union[str, AuthenticationState] + + + class azure.mgmt.horizondb.types.PasswordAuthenticationPropertiesForPatchUpdate(TypedDict, total=False): + key "administratorLoginPassword": str + key "state": Union[str, AuthenticationState] + administratorLoginPassword: str + state: Union[str, AuthenticationState] + + + class azure.mgmt.horizondb.types.Pool(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('PoolProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PoolProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.horizondb.types.PoolComputeModel(TypedDict, total=False): + key "computeGeneration": Required[int] + key "computeProcessor": Required[Union[str, ComputeProcessorType]] + key "type": Required[Union[str, PoolComputeModelType]] + key "vCores": Required[int] + computeGeneration: int + computeProcessor: Union[str, ComputeProcessorType] + type: Union[str, PoolComputeModelType] + vCores: int + + + class azure.mgmt.horizondb.types.PoolComputeModelForPatchUpdate(TypedDict, total=False): + key "computeGeneration": int + key "computeProcessor": Union[str, ComputeProcessorType] + key "type": Union[str, PoolComputeModelType] + key "vCores": int + computeGeneration: int + computeProcessor: Union[str, ComputeProcessorType] + type: Union[str, PoolComputeModelType] + vCores: int + + + class azure.mgmt.horizondb.types.PoolForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('PoolPropertiesForPatchUpdate', module='types') + properties: PoolPropertiesForPatchUpdate + tags: dict[str, str] + + + class azure.mgmt.horizondb.types.PoolHighAvailability(TypedDict, total=False): + key "mode": Required[Union[str, PoolHighAvailabilityMode]] + mode: Union[str, PoolHighAvailabilityMode] + + + class azure.mgmt.horizondb.types.PoolHighAvailabilityPatch(TypedDict, total=False): + key "mode": Union[str, PoolHighAvailabilityMode] + mode: Union[str, PoolHighAvailabilityMode] + + + class azure.mgmt.horizondb.types.PoolParameterGroupReference(TypedDict, total=False): + key "applyMethod": Required[Union[str, ParameterApplyMethod]] + key "parameterGroupResourceId": Required[str] + key "syncStatus": Union[str, ParameterGroupSyncStatus] + applyMethod: Union[str, ParameterApplyMethod] + parameterGroupResourceId: str + syncStatus: Union[str, ParameterGroupSyncStatus] + + + class azure.mgmt.horizondb.types.PoolParameterGroupReferenceForPatchUpdate(TypedDict, total=False): + key "applyMethod": Union[str, ParameterApplyMethod] + key "parameterGroupResourceId": str + applyMethod: Union[str, ParameterApplyMethod] + parameterGroupResourceId: str + + + class azure.mgmt.horizondb.types.PoolProperties(TypedDict, total=False): + key "computeModel": Required[PoolComputeModel] + key "highAvailability": Required[PoolHighAvailability] + key "nodeCount": Required[int] + key "parameterGroup": Required[PoolParameterGroupReference] + key "provisioningState": Union[str, ProvisioningState] + key "scheduledMaintenance": ForwardRef('ScheduledMaintenanceProperties', module='types') + key "state": Union[str, PoolState] + computeModel: PoolComputeModel + highAvailability: PoolHighAvailability + nodeCount: int + parameterGroup: PoolParameterGroupReference + provisioningState: Union[str, ProvisioningState] + scheduledMaintenance: ScheduledMaintenanceProperties + state: Union[str, PoolState] + + + class azure.mgmt.horizondb.types.PoolPropertiesForPatchUpdate(TypedDict, total=False): + key "computeModel": ForwardRef('PoolComputeModelForPatchUpdate', module='types') + key "highAvailability": ForwardRef('PoolHighAvailabilityPatch', module='types') + key "nodeCount": int + key "parameterGroup": ForwardRef('PoolParameterGroupReferenceForPatchUpdate', module='types') + key "scheduledMaintenance": ForwardRef('ScheduledMaintenancePropertiesForPatchUpdate', module='types') + computeModel: PoolComputeModelForPatchUpdate + highAvailability: PoolHighAvailabilityPatch + nodeCount: int + parameterGroup: PoolParameterGroupReferenceForPatchUpdate + scheduledMaintenance: ScheduledMaintenancePropertiesForPatchUpdate class azure.mgmt.horizondb.types.PrivateEndpoint(TypedDict, total=False): @@ -2531,6 +5849,11 @@ namespace azure.mgmt.horizondb.types type: str + class azure.mgmt.horizondb.types.ReadWritePoolProperties(TypedDict, total=False): + key "designatedPoolResourceId": str + designatedPoolResourceId: str + + class azure.mgmt.horizondb.types.Resource(TypedDict, total=False): key "id": str key "name": str @@ -2542,6 +5865,20 @@ namespace azure.mgmt.horizondb.types type: str + class azure.mgmt.horizondb.types.ScheduledMaintenanceManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "System" + + + class azure.mgmt.horizondb.types.ScheduledMaintenanceProperties(TypedDict, total=False): + key "maintenanceManagementType": Required[Literal[ScheduledMaintenanceManagementType.SYSTEM]] + maintenanceManagementType: Literal[ScheduledMaintenanceManagementType.SYSTEM] + + + class azure.mgmt.horizondb.types.ScheduledMaintenancePropertiesForPatchUpdate(TypedDict, total=False): + key "maintenanceManagementType": Union[str, ScheduledMaintenanceManagementType] + maintenanceManagementType: Union[str, ScheduledMaintenanceManagementType] + + class azure.mgmt.horizondb.types.SystemData(TypedDict, total=False): key "createdAt": str key "createdBy": str @@ -2557,6 +5894,11 @@ namespace azure.mgmt.horizondb.types lastModifiedByType: Union[str, CreatedByType] + class azure.mgmt.horizondb.types.SystemScheduledMaintenanceProperties(TypedDict, total=False): + key "maintenanceManagementType": Required[Literal[ScheduledMaintenanceManagementType.SYSTEM]] + maintenanceManagementType: Literal[ScheduledMaintenanceManagementType.SYSTEM] + + class azure.mgmt.horizondb.types.TrackedResource(Resource): key "id": str key "location": Required[str] diff --git a/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml b/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml index 62aae3242a4c..53817744fbb1 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml +++ b/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml @@ -1,3 +1,4 @@ -apiMdSha256: 43d4079cdf72351e9fcb305f2a9aaad1e9576983d33574e229076ab0eafbd541 +apiHash: dbf382e1914bc1e9afc779616d430f2f325f2be28166ab27ca21d53636a05fb3 +packageVersion: 1.0.0b3 parserVersion: 0.3.31 -pythonVersion: 3.13.15 +pythonVersion: 3.13.16 diff --git a/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json b/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json index 32bc7f8f97ab..8b833fad5e0a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json +++ b/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json @@ -1,144 +1,337 @@ { "CrossLanguagePackageId": "Microsoft.HorizonDb", "CrossLanguageDefinitionId": { - "azure.mgmt.horizondb.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", - "azure.mgmt.horizondb.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", - "azure.mgmt.horizondb.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityRequest": "Microsoft.HorizonDb.ActivateChangeDataCaptureIdentityRequest", + "azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult": "Microsoft.HorizonDb.ActivateChangeDataCaptureIdentityResult", "azure.mgmt.horizondb.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.horizondb.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", - "azure.mgmt.horizondb.models.HorizonDbAdministrator": "Microsoft.HorizonDb.HorizonDbAdministrator", - "azure.mgmt.horizondb.models.HorizonDbAdministratorAdd": "Microsoft.HorizonDb.HorizonDbAdministratorAdd", - "azure.mgmt.horizondb.models.HorizonDbAdministratorProperties": "Microsoft.HorizonDb.HorizonDbAdministratorProperties", - "azure.mgmt.horizondb.models.HorizonDbAdministratorPropertiesForAdd": "Microsoft.HorizonDb.HorizonDbAdministratorPropertiesForAdd", + "azure.mgmt.horizondb.models.Authentication": "Microsoft.HorizonDb.Authentication", + "azure.mgmt.horizondb.models.AuthenticationProperties": "Microsoft.HorizonDb.AuthenticationProperties", + "azure.mgmt.horizondb.models.BackupProperties": "Microsoft.HorizonDb.BackupProperties", + "azure.mgmt.horizondb.models.BackupPropertiesForPatchUpdate": "Microsoft.HorizonDb.BackupPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.Capability": "Microsoft.HorizonDb.Capability", + "azure.mgmt.horizondb.models.CapabilityProperties": "Microsoft.HorizonDb.CapabilityProperties", + "azure.mgmt.horizondb.models.ChangeDataCaptureCapability": "Microsoft.HorizonDb.ChangeDataCaptureCapability", + "azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityForPatchUpdate": "Microsoft.HorizonDb.ChangeDataCaptureCapabilityForPatchUpdate", + "azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityProperties": "Microsoft.HorizonDb.ChangeDataCaptureCapabilityProperties", + "azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityPropertiesForPatchUpdate": "Microsoft.HorizonDb.ChangeDataCaptureCapabilityPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration": "Microsoft.HorizonDb.ChangeDataCaptureConfiguration", + "azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationForPatchUpdate": "Microsoft.HorizonDb.ChangeDataCaptureConfigurationForPatchUpdate", + "azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationProperties": "Microsoft.HorizonDb.ChangeDataCaptureConfigurationProperties", + "azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationPropertiesForPatchUpdate": "Microsoft.HorizonDb.ChangeDataCaptureConfigurationPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestination": "Microsoft.HorizonDb.ChangeDataCaptureDestination", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestinationDetails": "Microsoft.HorizonDb.ChangeDataCaptureDestinationDetails", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestinationForPatchUpdate": "Microsoft.HorizonDb.ChangeDataCaptureDestinationForPatchUpdate", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestinationProperties": "Microsoft.HorizonDb.ChangeDataCaptureDestinationProperties", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestinationPropertiesForPatchUpdate": "Microsoft.HorizonDb.ChangeDataCaptureDestinationPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.ChangeDataCaptureExtensionStatus": "Microsoft.HorizonDb.ChangeDataCaptureExtensionStatus", + "azure.mgmt.horizondb.models.ChangeDataCaptureIdentityAssignmentProperties": "Microsoft.HorizonDb.ChangeDataCaptureIdentityAssignmentProperties", + "azure.mgmt.horizondb.models.ChangeDataCapturePrerequisiteStatus": "Microsoft.HorizonDb.ChangeDataCapturePrerequisiteStatus", + "azure.mgmt.horizondb.models.ChangeDataCaptureReplicationStatus": "Microsoft.HorizonDb.ChangeDataCaptureReplicationStatus", + "azure.mgmt.horizondb.models.ChangeDataCaptureStatus": "Microsoft.HorizonDb.ChangeDataCaptureStatus", + "azure.mgmt.horizondb.models.ChangeDataCaptureTopologyBindingStatus": "Microsoft.HorizonDb.ChangeDataCaptureTopologyBindingStatus", "azure.mgmt.horizondb.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", - "azure.mgmt.horizondb.models.HorizonDbCluster": "Microsoft.HorizonDb.HorizonDbCluster", - "azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig": "Microsoft.HorizonDb.HorizonDbClusterAuthConfig", - "azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate": "Microsoft.HorizonDb.HorizonDbClusterForPatchUpdate", - "azure.mgmt.horizondb.models.HorizonDbClusterMirroring": "Microsoft.HorizonDb.HorizonDbClusterMirroring", - "azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties": "Microsoft.HorizonDb.HorizonDbClusterParameterGroupConnectionProperties", - "azure.mgmt.horizondb.models.HorizonDbClusterProperties": "Microsoft.HorizonDb.HorizonDbClusterProperties", - "azure.mgmt.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate": "Microsoft.HorizonDb.HorizonDbClusterPropertiesForPatchUpdate", - "azure.mgmt.horizondb.models.HorizonDbComputeModel": "Microsoft.HorizonDb.HorizonDbComputeModel", - "azure.mgmt.horizondb.models.HorizonDbFirewallRule": "Microsoft.HorizonDb.HorizonDbFirewallRule", - "azure.mgmt.horizondb.models.HorizonDbFirewallRuleProperties": "Microsoft.HorizonDb.HorizonDbFirewallRuleProperties", - "azure.mgmt.horizondb.models.HorizonDbParameterGroup": "Microsoft.HorizonDb.HorizonDbParameterGroup", - "azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties": "Microsoft.HorizonDb.HorizonDbParameterGroupConnectionProperties", - "azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate": "Microsoft.HorizonDb.HorizonDbParameterGroupForPatchUpdate", - "azure.mgmt.horizondb.models.HorizonDbParameterGroupProperties": "Microsoft.HorizonDb.HorizonDbParameterGroupProperties", - "azure.mgmt.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate": "Microsoft.HorizonDb.HorizonDbParameterGroupPropertiesForPatchUpdate", - "azure.mgmt.horizondb.models.HorizonDbPool": "Microsoft.HorizonDb.HorizonDbPool", - "azure.mgmt.horizondb.models.HorizonDbPoolProperties": "Microsoft.HorizonDb.HorizonDbPoolProperties", - "azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource": "Microsoft.HorizonDb.HorizonDbPrivateLinkResource", - "azure.mgmt.horizondb.models.HorizonDbReplica": "Microsoft.HorizonDb.HorizonDbReplica", - "azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate": "Microsoft.HorizonDb.HorizonDbReplicaForPatchUpdate", - "azure.mgmt.horizondb.models.HorizonDbReplicaProperties": "Microsoft.HorizonDb.HorizonDbReplicaProperties", - "azure.mgmt.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate": "Microsoft.HorizonDb.HorizonDbReplicaPropertiesForPatchUpdate", - "azure.mgmt.horizondb.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.horizondb.models.Cluster": "Microsoft.HorizonDb.Cluster", + "azure.mgmt.horizondb.models.ClusterCapability": "Microsoft.HorizonDb.ClusterCapability", + "azure.mgmt.horizondb.models.ClusterFeatureCapability": "Microsoft.HorizonDb.ClusterFeatureCapability", + "azure.mgmt.horizondb.models.ClusterForPatchUpdate": "Microsoft.HorizonDb.ClusterForPatchUpdate", + "azure.mgmt.horizondb.models.ClusterProperties": "Microsoft.HorizonDb.ClusterProperties", + "azure.mgmt.horizondb.models.ClusterPropertiesForPatchUpdate": "Microsoft.HorizonDb.ClusterPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.ComputeGenerationCapability": "Microsoft.HorizonDb.ComputeGenerationCapability", + "azure.mgmt.horizondb.models.ComputeModelCapability": "Microsoft.HorizonDb.ComputeModelCapability", + "azure.mgmt.horizondb.models.ComputeProcessorCapability": "Microsoft.HorizonDb.ComputeProcessorCapability", + "azure.mgmt.horizondb.models.ComputeSizeCapability": "Microsoft.HorizonDb.ComputeSizeCapability", + "azure.mgmt.horizondb.models.DefaultParameterGroup": "Microsoft.HorizonDb.DefaultParameterGroup", + "azure.mgmt.horizondb.models.DefaultParameterGroupProperties": "Microsoft.HorizonDb.DefaultParameterGroupProperties", + "azure.mgmt.horizondb.models.Endpoint": "Microsoft.HorizonDb.Endpoint", + "azure.mgmt.horizondb.models.EndpointProperties": "Microsoft.HorizonDb.EndpointProperties", + "azure.mgmt.horizondb.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.horizondb.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.horizondb.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.horizondb.models.FabricDestinationDetails": "Microsoft.HorizonDb.FabricDestinationDetails", + "azure.mgmt.horizondb.models.FirewallRule": "Microsoft.HorizonDb.FirewallRule", + "azure.mgmt.horizondb.models.FirewallRuleProperties": "Microsoft.HorizonDb.FirewallRuleProperties", + "azure.mgmt.horizondb.models.HorizonDbClusterDataEncryption": "Microsoft.HorizonDb.HorizonDbClusterDataEncryption", + "azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionForPatchUpdate": "Microsoft.HorizonDb.HorizonDbClusterDataEncryptionForPatchUpdate", + "azure.mgmt.horizondb.models.HorizonDbClusterManagedServiceIdentity": "Microsoft.HorizonDb.HorizonDbClusterManagedServiceIdentity", + "azure.mgmt.horizondb.models.IdentityAssignment": "Microsoft.HorizonDb.IdentityAssignment", + "azure.mgmt.horizondb.models.IdentityValidationStatus": "Microsoft.HorizonDb.IdentityValidationStatus", + "azure.mgmt.horizondb.models.LogCaptureConfiguration": "Microsoft.HorizonDb.LogCaptureConfiguration", + "azure.mgmt.horizondb.models.LogCaptureConfigurationForPatchUpdate": "Microsoft.HorizonDb.LogCaptureConfigurationForPatchUpdate", + "azure.mgmt.horizondb.models.LogCaptureConfigurationProperties": "Microsoft.HorizonDb.LogCaptureConfigurationProperties", + "azure.mgmt.horizondb.models.LogCaptureConfigurationPropertiesForPatchUpdate": "Microsoft.HorizonDb.LogCaptureConfigurationPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.LogFile": "Microsoft.HorizonDb.LogFile", + "azure.mgmt.horizondb.models.LogFileDownloadUrl": "Microsoft.HorizonDb.LogFileDownloadUrl", + "azure.mgmt.horizondb.models.LogFileProperties": "Microsoft.HorizonDb.LogFileProperties", + "azure.mgmt.horizondb.models.MaintenanceEvent": "Microsoft.HorizonDb.MaintenanceEvent", + "azure.mgmt.horizondb.models.MaintenanceEventActionResponse": "Microsoft.HorizonDb.MaintenanceEventActionResponse", + "azure.mgmt.horizondb.models.MaintenanceEventProperties": "Microsoft.HorizonDb.MaintenanceEventProperties", + "azure.mgmt.horizondb.models.MaintenanceEventRescheduleRequest": "Microsoft.HorizonDb.MaintenanceEventRescheduleRequest", + "azure.mgmt.horizondb.models.MicrosoftEntraAdministrator": "Microsoft.HorizonDb.MicrosoftEntraAdministrator", + "azure.mgmt.horizondb.models.MicrosoftEntraAdministratorAdd": "Microsoft.HorizonDb.MicrosoftEntraAdministratorAdd", + "azure.mgmt.horizondb.models.MicrosoftEntraAdministratorProperties": "Microsoft.HorizonDb.MicrosoftEntraAdministratorProperties", + "azure.mgmt.horizondb.models.MicrosoftEntraAdministratorPropertiesForAdd": "Microsoft.HorizonDb.MicrosoftEntraAdministratorPropertiesForAdd", + "azure.mgmt.horizondb.models.MicrosoftEntraAuthentication": "Microsoft.HorizonDb.MicrosoftEntraAuthentication", + "azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationForPatchUpdate": "Microsoft.HorizonDb.MicrosoftEntraAuthenticationForPatchUpdate", + "azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationProperties": "Microsoft.HorizonDb.MicrosoftEntraAuthenticationProperties", + "azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationPropertiesForPatchUpdate": "Microsoft.HorizonDb.MicrosoftEntraAuthenticationPropertiesForPatchUpdate", "azure.mgmt.horizondb.models.Network": "Microsoft.HorizonDb.Network", + "azure.mgmt.horizondb.models.NetworkForPatchUpdate": "Microsoft.HorizonDb.NetworkForPatchUpdate", + "azure.mgmt.horizondb.models.Node": "Microsoft.HorizonDb.Node", + "azure.mgmt.horizondb.models.NodeProperties": "Microsoft.HorizonDb.NodeProperties", "azure.mgmt.horizondb.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.horizondb.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.horizondb.models.ParameterGroup": "Microsoft.HorizonDb.ParameterGroup", + "azure.mgmt.horizondb.models.ParameterGroupConnectionProperties": "Microsoft.HorizonDb.ParameterGroupConnectionProperties", + "azure.mgmt.horizondb.models.ParameterGroupForPatchUpdate": "Microsoft.HorizonDb.ParameterGroupForPatchUpdate", + "azure.mgmt.horizondb.models.ParameterGroupProperties": "Microsoft.HorizonDb.ParameterGroupProperties", + "azure.mgmt.horizondb.models.ParameterGroupPropertiesForPatchUpdate": "Microsoft.HorizonDb.ParameterGroupPropertiesForPatchUpdate", "azure.mgmt.horizondb.models.ParameterProperties": "Microsoft.HorizonDb.ParameterProperties", + "azure.mgmt.horizondb.models.PasswordAuthentication": "Microsoft.HorizonDb.PasswordAuthentication", + "azure.mgmt.horizondb.models.PasswordAuthenticationForPatchUpdate": "Microsoft.HorizonDb.PasswordAuthenticationForPatchUpdate", + "azure.mgmt.horizondb.models.PasswordAuthenticationProperties": "Microsoft.HorizonDb.PasswordAuthenticationProperties", + "azure.mgmt.horizondb.models.PasswordAuthenticationPropertiesForPatchUpdate": "Microsoft.HorizonDb.PasswordAuthenticationPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.Pool": "Microsoft.HorizonDb.Pool", + "azure.mgmt.horizondb.models.PoolCapability": "Microsoft.HorizonDb.PoolCapability", + "azure.mgmt.horizondb.models.PoolComputeModel": "Microsoft.HorizonDb.PoolComputeModel", + "azure.mgmt.horizondb.models.PoolComputeModelForPatchUpdate": "Microsoft.HorizonDb.PoolComputeModelForPatchUpdate", + "azure.mgmt.horizondb.models.PoolFeatureCapability": "Microsoft.HorizonDb.PoolFeatureCapability", + "azure.mgmt.horizondb.models.PoolForPatchUpdate": "Microsoft.HorizonDb.PoolForPatchUpdate", + "azure.mgmt.horizondb.models.PoolHighAvailability": "Microsoft.HorizonDb.PoolHighAvailability", + "azure.mgmt.horizondb.models.PoolHighAvailabilityPatch": "Microsoft.HorizonDb.PoolHighAvailabilityPatch", + "azure.mgmt.horizondb.models.PoolParameterGroupReference": "Microsoft.HorizonDb.PoolParameterGroupReference", + "azure.mgmt.horizondb.models.PoolParameterGroupReferenceForPatchUpdate": "Microsoft.HorizonDb.PoolParameterGroupReferenceForPatchUpdate", + "azure.mgmt.horizondb.models.PoolProperties": "Microsoft.HorizonDb.PoolProperties", + "azure.mgmt.horizondb.models.PoolPropertiesForPatchUpdate": "Microsoft.HorizonDb.PoolPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.PostgreSqlVersionCapability": "Microsoft.HorizonDb.PostgreSqlVersionCapability", "azure.mgmt.horizondb.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", "azure.mgmt.horizondb.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", "azure.mgmt.horizondb.models.PrivateEndpointConnectionResource": "Azure.ResourceManager.PrivateEndpointConnectionResource", + "azure.mgmt.horizondb.models.PrivateLinkResource": "Microsoft.HorizonDb.PrivateLinkResource", "azure.mgmt.horizondb.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", "azure.mgmt.horizondb.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", + "azure.mgmt.horizondb.models.ProvisionedComputeModelCapability": "Microsoft.HorizonDb.ProvisionedComputeModelCapability", + "azure.mgmt.horizondb.models.ReadWritePoolProperties": "Microsoft.HorizonDb.ReadWritePoolProperties", + "azure.mgmt.horizondb.models.ScheduledMaintenanceProperties": "Microsoft.HorizonDb.ScheduledMaintenanceProperties", + "azure.mgmt.horizondb.models.ScheduledMaintenancePropertiesForPatchUpdate": "Microsoft.HorizonDb.ScheduledMaintenancePropertiesForPatchUpdate", "azure.mgmt.horizondb.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.horizondb.models.SystemScheduledMaintenanceProperties": "Microsoft.HorizonDb.SystemScheduledMaintenanceProperties", "azure.mgmt.horizondb.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.horizondb.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.horizondb.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.horizondb.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", - "azure.mgmt.horizondb.models.CreateModeCluster": "Microsoft.HorizonDb.CreateModeCluster", - "azure.mgmt.horizondb.models.PublicNetworkAccessState": "Microsoft.HorizonDb.PublicNetworkAccessState", - "azure.mgmt.horizondb.models.State": "Microsoft.HorizonDb.State", "azure.mgmt.horizondb.models.ProvisioningState": "Microsoft.HorizonDb.ProvisioningState", - "azure.mgmt.horizondb.models.ZonePlacementPolicy": "Microsoft.HorizonDb.ZonePlacementPolicy", - "azure.mgmt.horizondb.models.AuthenticationState": "Microsoft.HorizonDb.AuthenticationState", - "azure.mgmt.horizondb.models.HorizonDbComputeModelType": "Microsoft.HorizonDb.HorizonDbComputeModelType", - "azure.mgmt.horizondb.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", - "azure.mgmt.horizondb.models.CreateModePool": "Microsoft.HorizonDb.CreateModePool", - "azure.mgmt.horizondb.models.ReplicaRole": "Microsoft.HorizonDb.ReplicaRole", + "azure.mgmt.horizondb.models.PostgreSqlCapabilityVersion": "Microsoft.HorizonDb.PostgreSqlCapabilityVersion", + "azure.mgmt.horizondb.models.ComputeProcessorType": "Microsoft.HorizonDb.ComputeProcessorType", + "azure.mgmt.horizondb.models.PoolComputeModelType": "Microsoft.HorizonDb.PoolComputeModelType", + "azure.mgmt.horizondb.models.PostgreSqlVersion": "Microsoft.HorizonDb.PostgreSqlVersion", + "azure.mgmt.horizondb.models.ClusterCreateMode": "Microsoft.HorizonDb.ClusterCreateMode", + "azure.mgmt.horizondb.models.PublicNetworkAccessState": "Microsoft.HorizonDb.PublicNetworkAccessState", + "azure.mgmt.horizondb.models.GeoRedundancyState": "Microsoft.HorizonDb.GeoRedundancyState", + "azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionType": "Microsoft.HorizonDb.HorizonDbClusterDataEncryptionType", + "azure.mgmt.horizondb.models.HorizonDbClusterEncryptionKeyStatus": "Microsoft.HorizonDb.HorizonDbClusterEncryptionKeyStatus", + "azure.mgmt.horizondb.models.AiModelManagementStatus": "Microsoft.HorizonDb.AiModelManagementStatus", + "azure.mgmt.horizondb.models.ClusterState": "Microsoft.HorizonDb.ClusterState", + "azure.mgmt.horizondb.models.HorizonDbClusterIdentityType": "Microsoft.HorizonDb.HorizonDbClusterIdentityType", + "azure.mgmt.horizondb.models.PoolState": "Microsoft.HorizonDb.PoolState", + "azure.mgmt.horizondb.models.PoolHighAvailabilityMode": "Microsoft.HorizonDb.PoolHighAvailabilityMode", + "azure.mgmt.horizondb.models.ParameterApplyMethod": "Microsoft.HorizonDb.ParameterApplyMethod", + "azure.mgmt.horizondb.models.ParameterGroupSyncStatus": "Microsoft.HorizonDb.ParameterGroupSyncStatus", + "azure.mgmt.horizondb.models.ScheduledMaintenanceManagementType": "Microsoft.HorizonDb.ScheduledMaintenanceManagementType", "azure.mgmt.horizondb.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", "azure.mgmt.horizondb.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "azure.mgmt.horizondb.models.ParameterValueSource": "Microsoft.HorizonDb.ParameterValueSource", "azure.mgmt.horizondb.models.PrincipalTypes": "Microsoft.HorizonDb.PrincipalTypes", + "azure.mgmt.horizondb.models.AuthenticationState": "Microsoft.HorizonDb.AuthenticationState", + "azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState": "Microsoft.HorizonDb.ChangeDataCaptureDesiredState", + "azure.mgmt.horizondb.models.ChangeDataCaptureEffectiveState": "Microsoft.HorizonDb.ChangeDataCaptureEffectiveState", + "azure.mgmt.horizondb.models.ChangeDataCaptureReplicationArchitecture": "Microsoft.HorizonDb.ChangeDataCaptureReplicationArchitecture", + "azure.mgmt.horizondb.models.ChangeDataCaptureExtensionState": "Microsoft.HorizonDb.ChangeDataCaptureExtensionState", + "azure.mgmt.horizondb.models.ChangeDataCaptureEngineConfigurationState": "Microsoft.HorizonDb.ChangeDataCaptureEngineConfigurationState", + "azure.mgmt.horizondb.models.ChangeDataCaptureReadWriteEndpointState": "Microsoft.HorizonDb.ChangeDataCaptureReadWriteEndpointState", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestinationType": "Microsoft.HorizonDb.ChangeDataCaptureDestinationType", + "azure.mgmt.horizondb.models.ChangeDataCaptureProtocol": "Microsoft.HorizonDb.ChangeDataCaptureProtocol", + "azure.mgmt.horizondb.models.ChangeDataCaptureDestinationEffectiveState": "Microsoft.HorizonDb.ChangeDataCaptureDestinationEffectiveState", + "azure.mgmt.horizondb.models.ChangeDataCaptureIdentityAssignmentState": "Microsoft.HorizonDb.ChangeDataCaptureIdentityAssignmentState", + "azure.mgmt.horizondb.models.ChangeDataCaptureIdentityActivationState": "Microsoft.HorizonDb.ChangeDataCaptureIdentityActivationState", + "azure.mgmt.horizondb.models.ChangeDataCaptureIdentityValidationState": "Microsoft.HorizonDb.ChangeDataCaptureIdentityValidationState", + "azure.mgmt.horizondb.models.ChangeDataCaptureUsageProfile": "Microsoft.HorizonDb.ChangeDataCaptureUsageProfile", + "azure.mgmt.horizondb.models.ChangeDataCaptureReplicationState": "Microsoft.HorizonDb.ChangeDataCaptureReplicationState", + "azure.mgmt.horizondb.models.ChangeDataCaptureTopologyBindingState": "Microsoft.HorizonDb.ChangeDataCaptureTopologyBindingState", + "azure.mgmt.horizondb.models.EndpointScope": "Microsoft.HorizonDb.EndpointScope", + "azure.mgmt.horizondb.models.EndpointRole": "Microsoft.HorizonDb.EndpointRole", + "azure.mgmt.horizondb.models.MaintenanceType": "Microsoft.HorizonDb.MaintenanceType", + "azure.mgmt.horizondb.models.MaintenanceEventStatus": "Microsoft.HorizonDb.MaintenanceEventStatus", + "azure.mgmt.horizondb.models.NodeRole": "Microsoft.HorizonDb.NodeRole", + "azure.mgmt.horizondb.models.LogCaptureState": "Microsoft.HorizonDb.LogCaptureState", + "azure.mgmt.horizondb.models.LogFileType": "Microsoft.HorizonDb.LogFileType", + "azure.mgmt.horizondb.models.AuthenticationName": "Microsoft.HorizonDb.AuthenticationName", + "azure.mgmt.horizondb.models.PasswordAuthenticationName": "Microsoft.HorizonDb.PasswordAuthenticationName", + "azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationName": "Microsoft.HorizonDb.MicrosoftEntraAuthenticationName", "azure.mgmt.horizondb.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.horizondb.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.get": "Microsoft.HorizonDb.HorizonDbClusters.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.get": "Microsoft.HorizonDb.HorizonDbClusters.get", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_update": "Microsoft.HorizonDb.HorizonDbClusters.update", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_update": "Microsoft.HorizonDb.HorizonDbClusters.update", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbClusters.delete", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbClusters.delete", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.list_by_resource_group": "Microsoft.HorizonDb.HorizonDbClusters.listByResourceGroup", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.list_by_resource_group": "Microsoft.HorizonDb.HorizonDbClusters.listByResourceGroup", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.list_by_subscription": "Microsoft.HorizonDb.HorizonDbClusters.listBySubscription", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.list_by_subscription": "Microsoft.HorizonDb.HorizonDbClusters.listBySubscription", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_start": "Microsoft.HorizonDb.HorizonDbClusters.start", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_start": "Microsoft.HorizonDb.HorizonDbClusters.start", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_stop": "Microsoft.HorizonDb.HorizonDbClusters.stop", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_stop": "Microsoft.HorizonDb.HorizonDbClusters.stop", - "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_restart": "Microsoft.HorizonDb.HorizonDbClusters.restart", - "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_restart": "Microsoft.HorizonDb.HorizonDbClusters.restart", - "azure.mgmt.horizondb.operations.HorizonDbPoolsOperations.get": "Microsoft.HorizonDb.HorizonDbPools.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbPoolsOperations.get": "Microsoft.HorizonDb.HorizonDbPools.get", - "azure.mgmt.horizondb.operations.HorizonDbPoolsOperations.list": "Microsoft.HorizonDb.HorizonDbPools.list", - "azure.mgmt.horizondb.aio.operations.HorizonDbPoolsOperations.list": "Microsoft.HorizonDb.HorizonDbPools.list", - "azure.mgmt.horizondb.operations.HorizonDbReplicasOperations.get": "Microsoft.HorizonDb.HorizonDbReplicas.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations.get": "Microsoft.HorizonDb.HorizonDbReplicas.get", - "azure.mgmt.horizondb.operations.HorizonDbReplicasOperations.list": "Microsoft.HorizonDb.HorizonDbReplicas.list", - "azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations.list": "Microsoft.HorizonDb.HorizonDbReplicas.list", - "azure.mgmt.horizondb.operations.HorizonDbReplicasOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate", - "azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate", - "azure.mgmt.horizondb.operations.HorizonDbReplicasOperations.begin_update": "Microsoft.HorizonDb.HorizonDbReplicas.update", - "azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations.begin_update": "Microsoft.HorizonDb.HorizonDbReplicas.update", - "azure.mgmt.horizondb.operations.HorizonDbReplicasOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbReplicas.delete", - "azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbReplicas.delete", - "azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations.get": "Microsoft.HorizonDb.HorizonDbFirewallRules.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations.get": "Microsoft.HorizonDb.HorizonDbFirewallRules.get", - "azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations.list": "Microsoft.HorizonDb.HorizonDbFirewallRules.list", - "azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations.list": "Microsoft.HorizonDb.HorizonDbFirewallRules.list", - "azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate", - "azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate", - "azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbFirewallRules.delete", - "azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbFirewallRules.delete", - "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.get": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.get": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get", - "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.list": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.list", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.list": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.list", - "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.update_status": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.updateStatus", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.update_status": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.updateStatus", - "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete", - "azure.mgmt.horizondb.operations.HorizonDbPrivateLinkResourcesOperations.get": "Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateLinkResourcesOperations.get": "Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get", - "azure.mgmt.horizondb.operations.HorizonDbPrivateLinkResourcesOperations.list": "Microsoft.HorizonDb.HorizonDbPrivateLinkResources.list", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateLinkResourcesOperations.list": "Microsoft.HorizonDb.HorizonDbPrivateLinkResources.list", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.get": "Microsoft.HorizonDb.HorizonDbParameterGroups.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.get": "Microsoft.HorizonDb.HorizonDbParameterGroups.get", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.begin_update": "Microsoft.HorizonDb.HorizonDbParameterGroups.update", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.begin_update": "Microsoft.HorizonDb.HorizonDbParameterGroups.update", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbParameterGroups.delete", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbParameterGroups.delete", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.list_by_resource_group": "Microsoft.HorizonDb.HorizonDbParameterGroups.listByResourceGroup", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_by_resource_group": "Microsoft.HorizonDb.HorizonDbParameterGroups.listByResourceGroup", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.list_by_subscription": "Microsoft.HorizonDb.HorizonDbParameterGroups.listBySubscription", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_by_subscription": "Microsoft.HorizonDb.HorizonDbParameterGroups.listBySubscription", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.list_connections": "Microsoft.HorizonDb.HorizonDbParameterGroups.listConnections", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_connections": "Microsoft.HorizonDb.HorizonDbParameterGroups.listConnections", - "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.list_versions": "Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_versions": "Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions", - "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.get": "Microsoft.HorizonDb.HorizonDbAdministrators.get", - "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.get": "Microsoft.HorizonDb.HorizonDbAdministrators.get", - "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbAdministrators.createOrUpdate", - "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbAdministrators.createOrUpdate", - "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbAdministrators.delete", - "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbAdministrators.delete", - "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.list": "Microsoft.HorizonDb.HorizonDbAdministrators.list", - "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.list": "Microsoft.HorizonDb.HorizonDbAdministrators.list" + "azure.mgmt.horizondb.operations.CapabilitiesOperations.get": "Microsoft.HorizonDb.Capabilities.get", + "azure.mgmt.horizondb.aio.operations.CapabilitiesOperations.get": "Microsoft.HorizonDb.Capabilities.get", + "azure.mgmt.horizondb.operations.CapabilitiesOperations.list": "Microsoft.HorizonDb.Capabilities.list", + "azure.mgmt.horizondb.aio.operations.CapabilitiesOperations.list": "Microsoft.HorizonDb.Capabilities.list", + "azure.mgmt.horizondb.operations.ClustersOperations.get": "Microsoft.HorizonDb.Clusters.get", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.get": "Microsoft.HorizonDb.Clusters.get", + "azure.mgmt.horizondb.operations.ClustersOperations.begin_create_or_replace": "Microsoft.HorizonDb.Clusters.createOrReplace", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.begin_create_or_replace": "Microsoft.HorizonDb.Clusters.createOrReplace", + "azure.mgmt.horizondb.operations.ClustersOperations.begin_update": "Microsoft.HorizonDb.Clusters.update", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.begin_update": "Microsoft.HorizonDb.Clusters.update", + "azure.mgmt.horizondb.operations.ClustersOperations.begin_delete": "Microsoft.HorizonDb.Clusters.delete", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.begin_delete": "Microsoft.HorizonDb.Clusters.delete", + "azure.mgmt.horizondb.operations.ClustersOperations.list_by_resource_group": "Microsoft.HorizonDb.Clusters.listByResourceGroup", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.list_by_resource_group": "Microsoft.HorizonDb.Clusters.listByResourceGroup", + "azure.mgmt.horizondb.operations.ClustersOperations.list_by_subscription": "Microsoft.HorizonDb.Clusters.listBySubscription", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.list_by_subscription": "Microsoft.HorizonDb.Clusters.listBySubscription", + "azure.mgmt.horizondb.operations.ClustersOperations.begin_failover": "Microsoft.HorizonDb.Clusters.failover", + "azure.mgmt.horizondb.aio.operations.ClustersOperations.begin_failover": "Microsoft.HorizonDb.Clusters.failover", + "azure.mgmt.horizondb.operations.PoolsOperations.get": "Microsoft.HorizonDb.Pools.get", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.get": "Microsoft.HorizonDb.Pools.get", + "azure.mgmt.horizondb.operations.PoolsOperations.begin_create_or_replace": "Microsoft.HorizonDb.Pools.createOrReplace", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.begin_create_or_replace": "Microsoft.HorizonDb.Pools.createOrReplace", + "azure.mgmt.horizondb.operations.PoolsOperations.begin_update": "Microsoft.HorizonDb.Pools.update", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.begin_update": "Microsoft.HorizonDb.Pools.update", + "azure.mgmt.horizondb.operations.PoolsOperations.begin_delete": "Microsoft.HorizonDb.Pools.delete", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.begin_delete": "Microsoft.HorizonDb.Pools.delete", + "azure.mgmt.horizondb.operations.PoolsOperations.list": "Microsoft.HorizonDb.Pools.list", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.list": "Microsoft.HorizonDb.Pools.list", + "azure.mgmt.horizondb.operations.PoolsOperations.begin_start": "Microsoft.HorizonDb.Pools.start", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.begin_start": "Microsoft.HorizonDb.Pools.start", + "azure.mgmt.horizondb.operations.PoolsOperations.begin_stop": "Microsoft.HorizonDb.Pools.stop", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.begin_stop": "Microsoft.HorizonDb.Pools.stop", + "azure.mgmt.horizondb.operations.PoolsOperations.begin_restart": "Microsoft.HorizonDb.Pools.restart", + "azure.mgmt.horizondb.aio.operations.PoolsOperations.begin_restart": "Microsoft.HorizonDb.Pools.restart", + "azure.mgmt.horizondb.operations.FirewallRulesOperations.get": "Microsoft.HorizonDb.FirewallRules.get", + "azure.mgmt.horizondb.aio.operations.FirewallRulesOperations.get": "Microsoft.HorizonDb.FirewallRules.get", + "azure.mgmt.horizondb.operations.FirewallRulesOperations.list": "Microsoft.HorizonDb.FirewallRules.list", + "azure.mgmt.horizondb.aio.operations.FirewallRulesOperations.list": "Microsoft.HorizonDb.FirewallRules.list", + "azure.mgmt.horizondb.operations.FirewallRulesOperations.begin_create_or_replace": "Microsoft.HorizonDb.FirewallRules.createOrReplace", + "azure.mgmt.horizondb.aio.operations.FirewallRulesOperations.begin_create_or_replace": "Microsoft.HorizonDb.FirewallRules.createOrReplace", + "azure.mgmt.horizondb.operations.FirewallRulesOperations.begin_delete": "Microsoft.HorizonDb.FirewallRules.delete", + "azure.mgmt.horizondb.aio.operations.FirewallRulesOperations.begin_delete": "Microsoft.HorizonDb.FirewallRules.delete", + "azure.mgmt.horizondb.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.HorizonDb.PrivateEndpointConnections.get", + "azure.mgmt.horizondb.aio.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.HorizonDb.PrivateEndpointConnections.get", + "azure.mgmt.horizondb.operations.PrivateEndpointConnectionsOperations.list": "Microsoft.HorizonDb.PrivateEndpointConnections.list", + "azure.mgmt.horizondb.aio.operations.PrivateEndpointConnectionsOperations.list": "Microsoft.HorizonDb.PrivateEndpointConnections.list", + "azure.mgmt.horizondb.operations.PrivateEndpointConnectionsOperations.begin_approve_or_reject": "Microsoft.HorizonDb.PrivateEndpointConnections.approveOrReject", + "azure.mgmt.horizondb.aio.operations.PrivateEndpointConnectionsOperations.begin_approve_or_reject": "Microsoft.HorizonDb.PrivateEndpointConnections.approveOrReject", + "azure.mgmt.horizondb.operations.PrivateEndpointConnectionsOperations.begin_delete": "Microsoft.HorizonDb.PrivateEndpointConnections.delete", + "azure.mgmt.horizondb.aio.operations.PrivateEndpointConnectionsOperations.begin_delete": "Microsoft.HorizonDb.PrivateEndpointConnections.delete", + "azure.mgmt.horizondb.operations.PrivateLinkResourcesOperations.get": "Microsoft.HorizonDb.PrivateLinkResources.get", + "azure.mgmt.horizondb.aio.operations.PrivateLinkResourcesOperations.get": "Microsoft.HorizonDb.PrivateLinkResources.get", + "azure.mgmt.horizondb.operations.PrivateLinkResourcesOperations.list": "Microsoft.HorizonDb.PrivateLinkResources.list", + "azure.mgmt.horizondb.aio.operations.PrivateLinkResourcesOperations.list": "Microsoft.HorizonDb.PrivateLinkResources.list", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.get": "Microsoft.HorizonDb.ParameterGroups.get", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.get": "Microsoft.HorizonDb.ParameterGroups.get", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.begin_create_or_replace": "Microsoft.HorizonDb.ParameterGroups.createOrReplace", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.begin_create_or_replace": "Microsoft.HorizonDb.ParameterGroups.createOrReplace", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.begin_update": "Microsoft.HorizonDb.ParameterGroups.update", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.begin_update": "Microsoft.HorizonDb.ParameterGroups.update", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.begin_delete": "Microsoft.HorizonDb.ParameterGroups.delete", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.begin_delete": "Microsoft.HorizonDb.ParameterGroups.delete", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.list_by_resource_group": "Microsoft.HorizonDb.ParameterGroups.listByResourceGroup", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.list_by_resource_group": "Microsoft.HorizonDb.ParameterGroups.listByResourceGroup", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.list_by_subscription": "Microsoft.HorizonDb.ParameterGroups.listBySubscription", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.list_by_subscription": "Microsoft.HorizonDb.ParameterGroups.listBySubscription", + "azure.mgmt.horizondb.operations.ParameterGroupsOperations.list_connections": "Microsoft.HorizonDb.ParameterGroups.listConnections", + "azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations.list_connections": "Microsoft.HorizonDb.ParameterGroups.listConnections", + "azure.mgmt.horizondb.operations.DefaultParameterGroupsOperations.list_by_subscription_and_region": "Microsoft.HorizonDb.DefaultParameterGroups.listBySubscriptionAndRegion", + "azure.mgmt.horizondb.aio.operations.DefaultParameterGroupsOperations.list_by_subscription_and_region": "Microsoft.HorizonDb.DefaultParameterGroups.listBySubscriptionAndRegion", + "azure.mgmt.horizondb.operations.DefaultParameterGroupsOperations.get": "Microsoft.HorizonDb.DefaultParameterGroups.get", + "azure.mgmt.horizondb.aio.operations.DefaultParameterGroupsOperations.get": "Microsoft.HorizonDb.DefaultParameterGroups.get", + "azure.mgmt.horizondb.operations.MicrosoftEntraAdministratorsOperations.get": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.get", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAdministratorsOperations.get": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.get", + "azure.mgmt.horizondb.operations.MicrosoftEntraAdministratorsOperations.begin_create_or_replace": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.createOrReplace", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAdministratorsOperations.begin_create_or_replace": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.createOrReplace", + "azure.mgmt.horizondb.operations.MicrosoftEntraAdministratorsOperations.begin_delete": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.delete", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAdministratorsOperations.begin_delete": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.delete", + "azure.mgmt.horizondb.operations.MicrosoftEntraAdministratorsOperations.list": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.list", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAdministratorsOperations.list": "Microsoft.HorizonDb.MicrosoftEntraAdministrators.list", + "azure.mgmt.horizondb.operations.AuthenticationsOperations.list": "Microsoft.HorizonDb.Authentications.list", + "azure.mgmt.horizondb.aio.operations.AuthenticationsOperations.list": "Microsoft.HorizonDb.Authentications.list", + "azure.mgmt.horizondb.operations.PasswordAuthenticationsOperations.get": "Microsoft.HorizonDb.PasswordAuthentications.get", + "azure.mgmt.horizondb.aio.operations.PasswordAuthenticationsOperations.get": "Microsoft.HorizonDb.PasswordAuthentications.get", + "azure.mgmt.horizondb.operations.PasswordAuthenticationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.PasswordAuthentications.createOrReplace", + "azure.mgmt.horizondb.aio.operations.PasswordAuthenticationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.PasswordAuthentications.createOrReplace", + "azure.mgmt.horizondb.operations.PasswordAuthenticationsOperations.begin_update": "Microsoft.HorizonDb.PasswordAuthentications.update", + "azure.mgmt.horizondb.aio.operations.PasswordAuthenticationsOperations.begin_update": "Microsoft.HorizonDb.PasswordAuthentications.update", + "azure.mgmt.horizondb.operations.MicrosoftEntraAuthenticationsOperations.get": "Microsoft.HorizonDb.MicrosoftEntraAuthentications.get", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAuthenticationsOperations.get": "Microsoft.HorizonDb.MicrosoftEntraAuthentications.get", + "azure.mgmt.horizondb.operations.MicrosoftEntraAuthenticationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.MicrosoftEntraAuthentications.createOrReplace", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAuthenticationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.MicrosoftEntraAuthentications.createOrReplace", + "azure.mgmt.horizondb.operations.MicrosoftEntraAuthenticationsOperations.begin_update": "Microsoft.HorizonDb.MicrosoftEntraAuthentications.update", + "azure.mgmt.horizondb.aio.operations.MicrosoftEntraAuthenticationsOperations.begin_update": "Microsoft.HorizonDb.MicrosoftEntraAuthentications.update", + "azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations.get": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.get", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations.get": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.get", + "azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations.begin_create_or_replace": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.createOrReplace", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations.begin_create_or_replace": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.createOrReplace", + "azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations.begin_update": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.update", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations.begin_update": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.update", + "azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations.begin_delete": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.delete", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations.begin_delete": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.delete", + "azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations.list": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.list", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations.list": "Microsoft.HorizonDb.ChangeDataCaptureCapabilities.list", + "azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations.get": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.get", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations.get": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.get", + "azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.createOrReplace", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.createOrReplace", + "azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations.begin_update": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.update", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations.begin_update": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.update", + "azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations.begin_delete": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.delete", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations.begin_delete": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.delete", + "azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations.list": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.list", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations.list": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.list", + "azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations.begin_activate_identity": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.activateIdentity", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations.begin_activate_identity": "Microsoft.HorizonDb.ChangeDataCaptureDestinations.activateIdentity", + "azure.mgmt.horizondb.operations.IdentityAssignmentsOperations.get": "Microsoft.HorizonDb.IdentityAssignments.get", + "azure.mgmt.horizondb.aio.operations.IdentityAssignmentsOperations.get": "Microsoft.HorizonDb.IdentityAssignments.get", + "azure.mgmt.horizondb.operations.IdentityAssignmentsOperations.begin_create_or_replace": "Microsoft.HorizonDb.IdentityAssignments.createOrReplace", + "azure.mgmt.horizondb.aio.operations.IdentityAssignmentsOperations.begin_create_or_replace": "Microsoft.HorizonDb.IdentityAssignments.createOrReplace", + "azure.mgmt.horizondb.operations.IdentityAssignmentsOperations.begin_delete": "Microsoft.HorizonDb.IdentityAssignments.delete", + "azure.mgmt.horizondb.aio.operations.IdentityAssignmentsOperations.begin_delete": "Microsoft.HorizonDb.IdentityAssignments.delete", + "azure.mgmt.horizondb.operations.IdentityAssignmentsOperations.list": "Microsoft.HorizonDb.IdentityAssignments.list", + "azure.mgmt.horizondb.aio.operations.IdentityAssignmentsOperations.list": "Microsoft.HorizonDb.IdentityAssignments.list", + "azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations.get": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.get", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations.get": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.get", + "azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.createOrReplace", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations.begin_create_or_replace": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.createOrReplace", + "azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations.begin_update": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.update", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations.begin_update": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.update", + "azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations.begin_delete": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.delete", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations.begin_delete": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.delete", + "azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations.list": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.list", + "azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations.list": "Microsoft.HorizonDb.ChangeDataCaptureConfigurations.list", + "azure.mgmt.horizondb.operations.EndpointsOperations.get": "Microsoft.HorizonDb.Endpoints.get", + "azure.mgmt.horizondb.aio.operations.EndpointsOperations.get": "Microsoft.HorizonDb.Endpoints.get", + "azure.mgmt.horizondb.operations.EndpointsOperations.list": "Microsoft.HorizonDb.Endpoints.list", + "azure.mgmt.horizondb.aio.operations.EndpointsOperations.list": "Microsoft.HorizonDb.Endpoints.list", + "azure.mgmt.horizondb.operations.MaintenanceEventsOperations.get": "Microsoft.HorizonDb.MaintenanceEvents.get", + "azure.mgmt.horizondb.aio.operations.MaintenanceEventsOperations.get": "Microsoft.HorizonDb.MaintenanceEvents.get", + "azure.mgmt.horizondb.operations.MaintenanceEventsOperations.list": "Microsoft.HorizonDb.MaintenanceEvents.list", + "azure.mgmt.horizondb.aio.operations.MaintenanceEventsOperations.list": "Microsoft.HorizonDb.MaintenanceEvents.list", + "azure.mgmt.horizondb.operations.MaintenanceEventsOperations.begin_reschedule": "Microsoft.HorizonDb.MaintenanceEvents.reschedule", + "azure.mgmt.horizondb.aio.operations.MaintenanceEventsOperations.begin_reschedule": "Microsoft.HorizonDb.MaintenanceEvents.reschedule", + "azure.mgmt.horizondb.operations.MaintenanceEventsOperations.begin_apply_now": "Microsoft.HorizonDb.MaintenanceEvents.applyNow", + "azure.mgmt.horizondb.aio.operations.MaintenanceEventsOperations.begin_apply_now": "Microsoft.HorizonDb.MaintenanceEvents.applyNow", + "azure.mgmt.horizondb.operations.NodesOperations.get": "Microsoft.HorizonDb.Nodes.get", + "azure.mgmt.horizondb.aio.operations.NodesOperations.get": "Microsoft.HorizonDb.Nodes.get", + "azure.mgmt.horizondb.operations.NodesOperations.list": "Microsoft.HorizonDb.Nodes.list", + "azure.mgmt.horizondb.aio.operations.NodesOperations.list": "Microsoft.HorizonDb.Nodes.list", + "azure.mgmt.horizondb.operations.LogCaptureConfigurationsOperations.get": "Microsoft.HorizonDb.LogCaptureConfigurations.get", + "azure.mgmt.horizondb.aio.operations.LogCaptureConfigurationsOperations.get": "Microsoft.HorizonDb.LogCaptureConfigurations.get", + "azure.mgmt.horizondb.operations.LogCaptureConfigurationsOperations.begin_update": "Microsoft.HorizonDb.LogCaptureConfigurations.update", + "azure.mgmt.horizondb.aio.operations.LogCaptureConfigurationsOperations.begin_update": "Microsoft.HorizonDb.LogCaptureConfigurations.update", + "azure.mgmt.horizondb.operations.LogCaptureConfigurationsOperations.list": "Microsoft.HorizonDb.LogCaptureConfigurations.list", + "azure.mgmt.horizondb.aio.operations.LogCaptureConfigurationsOperations.list": "Microsoft.HorizonDb.LogCaptureConfigurations.list", + "azure.mgmt.horizondb.operations.LogFilesOperations.get": "Microsoft.HorizonDb.LogFiles.get", + "azure.mgmt.horizondb.aio.operations.LogFilesOperations.get": "Microsoft.HorizonDb.LogFiles.get", + "azure.mgmt.horizondb.operations.LogFilesOperations.list": "Microsoft.HorizonDb.LogFiles.list", + "azure.mgmt.horizondb.aio.operations.LogFilesOperations.list": "Microsoft.HorizonDb.LogFiles.list", + "azure.mgmt.horizondb.operations.LogFilesOperations.list_download_urls": "Microsoft.HorizonDb.LogFiles.listDownloadUrls", + "azure.mgmt.horizondb.aio.operations.LogFilesOperations.list_download_urls": "Microsoft.HorizonDb.LogFiles.listDownloadUrls" }, - "CrossLanguageVersion": "e073010193f3" + "CrossLanguageVersion": "e3143f0fdae1" } \ No newline at end of file diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py index 55ec35cdbcad..a00486a6f01a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py @@ -20,15 +20,28 @@ from ._configuration import HorizonDBMgmtClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( - HorizonDbAdministratorsOperations, - HorizonDbClustersOperations, - HorizonDbFirewallRulesOperations, - HorizonDbParameterGroupsOperations, - HorizonDbPoolsOperations, - HorizonDbPrivateEndpointConnectionsOperations, - HorizonDbPrivateLinkResourcesOperations, - HorizonDbReplicasOperations, + AuthenticationsOperations, + CapabilitiesOperations, + ChangeDataCaptureCapabilitiesOperations, + ChangeDataCaptureConfigurationsOperations, + ChangeDataCaptureDestinationsOperations, + ClustersOperations, + DefaultParameterGroupsOperations, + EndpointsOperations, + FirewallRulesOperations, + IdentityAssignmentsOperations, + LogCaptureConfigurationsOperations, + LogFilesOperations, + MaintenanceEventsOperations, + MicrosoftEntraAdministratorsOperations, + MicrosoftEntraAuthenticationsOperations, + NodesOperations, Operations, + ParameterGroupsOperations, + PasswordAuthenticationsOperations, + PoolsOperations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, ) if sys.version_info >= (3, 11): @@ -42,33 +55,62 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only - """Azure Resource Provider API for managing HorizonDB clusters, pools, replicas, and firewall - rules. + """Azure Resource Provider API for managing HorizonDB clusters, pools, endpoints, nodes, and + firewall rules. :ivar operations: Operations operations :vartype operations: azure.mgmt.horizondb.operations.Operations - :ivar horizon_db_clusters: HorizonDbClustersOperations operations - :vartype horizon_db_clusters: azure.mgmt.horizondb.operations.HorizonDbClustersOperations - :ivar horizon_db_pools: HorizonDbPoolsOperations operations - :vartype horizon_db_pools: azure.mgmt.horizondb.operations.HorizonDbPoolsOperations - :ivar horizon_db_replicas: HorizonDbReplicasOperations operations - :vartype horizon_db_replicas: azure.mgmt.horizondb.operations.HorizonDbReplicasOperations - :ivar horizon_db_firewall_rules: HorizonDbFirewallRulesOperations operations - :vartype horizon_db_firewall_rules: - azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations - :ivar horizon_db_private_endpoint_connections: HorizonDbPrivateEndpointConnectionsOperations - operations - :vartype horizon_db_private_endpoint_connections: - azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations - :ivar horizon_db_private_link_resources: HorizonDbPrivateLinkResourcesOperations operations - :vartype horizon_db_private_link_resources: - azure.mgmt.horizondb.operations.HorizonDbPrivateLinkResourcesOperations - :ivar horizon_db_parameter_groups: HorizonDbParameterGroupsOperations operations - :vartype horizon_db_parameter_groups: - azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations - :ivar horizon_db_administrators: HorizonDbAdministratorsOperations operations - :vartype horizon_db_administrators: - azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations + :ivar capabilities: CapabilitiesOperations operations + :vartype capabilities: azure.mgmt.horizondb.operations.CapabilitiesOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.horizondb.operations.ClustersOperations + :ivar pools: PoolsOperations operations + :vartype pools: azure.mgmt.horizondb.operations.PoolsOperations + :ivar firewall_rules: FirewallRulesOperations operations + :vartype firewall_rules: azure.mgmt.horizondb.operations.FirewallRulesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.horizondb.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.horizondb.operations.PrivateLinkResourcesOperations + :ivar parameter_groups: ParameterGroupsOperations operations + :vartype parameter_groups: azure.mgmt.horizondb.operations.ParameterGroupsOperations + :ivar default_parameter_groups: DefaultParameterGroupsOperations operations + :vartype default_parameter_groups: + azure.mgmt.horizondb.operations.DefaultParameterGroupsOperations + :ivar microsoft_entra_administrators: MicrosoftEntraAdministratorsOperations operations + :vartype microsoft_entra_administrators: + azure.mgmt.horizondb.operations.MicrosoftEntraAdministratorsOperations + :ivar authentications: AuthenticationsOperations operations + :vartype authentications: azure.mgmt.horizondb.operations.AuthenticationsOperations + :ivar password_authentications: PasswordAuthenticationsOperations operations + :vartype password_authentications: + azure.mgmt.horizondb.operations.PasswordAuthenticationsOperations + :ivar microsoft_entra_authentications: MicrosoftEntraAuthenticationsOperations operations + :vartype microsoft_entra_authentications: + azure.mgmt.horizondb.operations.MicrosoftEntraAuthenticationsOperations + :ivar change_data_capture_capabilities: ChangeDataCaptureCapabilitiesOperations operations + :vartype change_data_capture_capabilities: + azure.mgmt.horizondb.operations.ChangeDataCaptureCapabilitiesOperations + :ivar change_data_capture_destinations: ChangeDataCaptureDestinationsOperations operations + :vartype change_data_capture_destinations: + azure.mgmt.horizondb.operations.ChangeDataCaptureDestinationsOperations + :ivar identity_assignments: IdentityAssignmentsOperations operations + :vartype identity_assignments: azure.mgmt.horizondb.operations.IdentityAssignmentsOperations + :ivar change_data_capture_configurations: ChangeDataCaptureConfigurationsOperations operations + :vartype change_data_capture_configurations: + azure.mgmt.horizondb.operations.ChangeDataCaptureConfigurationsOperations + :ivar endpoints: EndpointsOperations operations + :vartype endpoints: azure.mgmt.horizondb.operations.EndpointsOperations + :ivar maintenance_events: MaintenanceEventsOperations operations + :vartype maintenance_events: azure.mgmt.horizondb.operations.MaintenanceEventsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.horizondb.operations.NodesOperations + :ivar log_capture_configurations: LogCaptureConfigurationsOperations operations + :vartype log_capture_configurations: + azure.mgmt.horizondb.operations.LogCaptureConfigurationsOperations + :ivar log_files: LogFilesOperations operations + :vartype log_files: azure.mgmt.horizondb.operations.LogFilesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -79,7 +121,7 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes,docst None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + "2026-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -135,28 +177,53 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.horizon_db_clusters = HorizonDbClustersOperations( + self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.pools = PoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_pools = HorizonDbPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.horizon_db_replicas = HorizonDbReplicasOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_firewall_rules = HorizonDbFirewallRulesOperations( + self.parameter_groups = ParameterGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_private_endpoint_connections = HorizonDbPrivateEndpointConnectionsOperations( + self.default_parameter_groups = DefaultParameterGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_private_link_resources = HorizonDbPrivateLinkResourcesOperations( + self.microsoft_entra_administrators = MicrosoftEntraAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_parameter_groups = HorizonDbParameterGroupsOperations( + self.authentications = AuthenticationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.password_authentications = PasswordAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_administrators = HorizonDbAdministratorsOperations( + self.microsoft_entra_authentications = MicrosoftEntraAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.change_data_capture_capabilities = ChangeDataCaptureCapabilitiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.change_data_capture_destinations = ChangeDataCaptureDestinationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.identity_assignments = IdentityAssignmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.change_data_capture_configurations = ChangeDataCaptureConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.endpoints = EndpointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_events = MaintenanceEventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize) + self.log_capture_configurations = LogCaptureConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.log_files = LogFilesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py index ab90765ee02d..1ff95dc86457 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py @@ -35,7 +35,7 @@ class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-att None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + "2026-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -49,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/utils.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/utils.py new file mode 100644 index 000000000000..cbaa624660e4 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/utils.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core import MatchConditions + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py deleted file mode 100644 index f5af3a4eb8a2..000000000000 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py +++ /dev/null @@ -1,66 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools - - -def api_version_validation(**kwargs): - params_added_on = kwargs.pop("params_added_on", {}) - method_added_on = kwargs.pop("method_added_on", "") - api_versions_list = kwargs.pop("api_versions_list", []) - - def _index_with_default(value: str, default: int = -1) -> int: - """Get the index of value in lst, or return default if not found. - - :param value: The value to search for in the api_versions_list. - :type value: str - :param default: The default value to return if the value is not found. - :type default: int - :return: The index of the value in the list, or the default value if not found. - :rtype: int - """ - try: - return api_versions_list.index(value) - except ValueError: - return default - - def decorator(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - try: - # this assumes the client has an _api_version attribute - client = args[0] - client_api_version = client._config.api_version # pylint: disable=protected-access - except AttributeError: - return func(*args, **kwargs) - - if _index_with_default(method_added_on) > _index_with_default(client_api_version): - raise ValueError( - f"'{func.__name__}' is not available in API version " - f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." - ) - - unsupported = { - parameter: api_version - for api_version, parameters in params_added_on.items() - for parameter in parameters - if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) - } - if unsupported: - raise ValueError( - "".join( - [ - f"'{param}' is not available in API version {client_api_version}. " - f"Use service API version {version} or newer.\n" - for param, version in unsupported.items() - ] - ) - ) - return func(*args, **kwargs) - - return wrapper - - return decorator diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py index bbcd28b4aa67..c43fdbc2e239 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b3" diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py index ca8c8ff0cc19..3873d12ca188 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py @@ -20,15 +20,28 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import HorizonDBMgmtClientConfiguration from .operations import ( - HorizonDbAdministratorsOperations, - HorizonDbClustersOperations, - HorizonDbFirewallRulesOperations, - HorizonDbParameterGroupsOperations, - HorizonDbPoolsOperations, - HorizonDbPrivateEndpointConnectionsOperations, - HorizonDbPrivateLinkResourcesOperations, - HorizonDbReplicasOperations, + AuthenticationsOperations, + CapabilitiesOperations, + ChangeDataCaptureCapabilitiesOperations, + ChangeDataCaptureConfigurationsOperations, + ChangeDataCaptureDestinationsOperations, + ClustersOperations, + DefaultParameterGroupsOperations, + EndpointsOperations, + FirewallRulesOperations, + IdentityAssignmentsOperations, + LogCaptureConfigurationsOperations, + LogFilesOperations, + MaintenanceEventsOperations, + MicrosoftEntraAdministratorsOperations, + MicrosoftEntraAuthenticationsOperations, + NodesOperations, Operations, + ParameterGroupsOperations, + PasswordAuthenticationsOperations, + PoolsOperations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, ) if sys.version_info >= (3, 11): @@ -42,33 +55,64 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only - """Azure Resource Provider API for managing HorizonDB clusters, pools, replicas, and firewall - rules. + """Azure Resource Provider API for managing HorizonDB clusters, pools, endpoints, nodes, and + firewall rules. :ivar operations: Operations operations :vartype operations: azure.mgmt.horizondb.aio.operations.Operations - :ivar horizon_db_clusters: HorizonDbClustersOperations operations - :vartype horizon_db_clusters: azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations - :ivar horizon_db_pools: HorizonDbPoolsOperations operations - :vartype horizon_db_pools: azure.mgmt.horizondb.aio.operations.HorizonDbPoolsOperations - :ivar horizon_db_replicas: HorizonDbReplicasOperations operations - :vartype horizon_db_replicas: azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations - :ivar horizon_db_firewall_rules: HorizonDbFirewallRulesOperations operations - :vartype horizon_db_firewall_rules: - azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations - :ivar horizon_db_private_endpoint_connections: HorizonDbPrivateEndpointConnectionsOperations - operations - :vartype horizon_db_private_endpoint_connections: - azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations - :ivar horizon_db_private_link_resources: HorizonDbPrivateLinkResourcesOperations operations - :vartype horizon_db_private_link_resources: - azure.mgmt.horizondb.aio.operations.HorizonDbPrivateLinkResourcesOperations - :ivar horizon_db_parameter_groups: HorizonDbParameterGroupsOperations operations - :vartype horizon_db_parameter_groups: - azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations - :ivar horizon_db_administrators: HorizonDbAdministratorsOperations operations - :vartype horizon_db_administrators: - azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations + :ivar capabilities: CapabilitiesOperations operations + :vartype capabilities: azure.mgmt.horizondb.aio.operations.CapabilitiesOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.horizondb.aio.operations.ClustersOperations + :ivar pools: PoolsOperations operations + :vartype pools: azure.mgmt.horizondb.aio.operations.PoolsOperations + :ivar firewall_rules: FirewallRulesOperations operations + :vartype firewall_rules: azure.mgmt.horizondb.aio.operations.FirewallRulesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.horizondb.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.horizondb.aio.operations.PrivateLinkResourcesOperations + :ivar parameter_groups: ParameterGroupsOperations operations + :vartype parameter_groups: azure.mgmt.horizondb.aio.operations.ParameterGroupsOperations + :ivar default_parameter_groups: DefaultParameterGroupsOperations operations + :vartype default_parameter_groups: + azure.mgmt.horizondb.aio.operations.DefaultParameterGroupsOperations + :ivar microsoft_entra_administrators: MicrosoftEntraAdministratorsOperations operations + :vartype microsoft_entra_administrators: + azure.mgmt.horizondb.aio.operations.MicrosoftEntraAdministratorsOperations + :ivar authentications: AuthenticationsOperations operations + :vartype authentications: azure.mgmt.horizondb.aio.operations.AuthenticationsOperations + :ivar password_authentications: PasswordAuthenticationsOperations operations + :vartype password_authentications: + azure.mgmt.horizondb.aio.operations.PasswordAuthenticationsOperations + :ivar microsoft_entra_authentications: MicrosoftEntraAuthenticationsOperations operations + :vartype microsoft_entra_authentications: + azure.mgmt.horizondb.aio.operations.MicrosoftEntraAuthenticationsOperations + :ivar change_data_capture_capabilities: ChangeDataCaptureCapabilitiesOperations operations + :vartype change_data_capture_capabilities: + azure.mgmt.horizondb.aio.operations.ChangeDataCaptureCapabilitiesOperations + :ivar change_data_capture_destinations: ChangeDataCaptureDestinationsOperations operations + :vartype change_data_capture_destinations: + azure.mgmt.horizondb.aio.operations.ChangeDataCaptureDestinationsOperations + :ivar identity_assignments: IdentityAssignmentsOperations operations + :vartype identity_assignments: + azure.mgmt.horizondb.aio.operations.IdentityAssignmentsOperations + :ivar change_data_capture_configurations: ChangeDataCaptureConfigurationsOperations operations + :vartype change_data_capture_configurations: + azure.mgmt.horizondb.aio.operations.ChangeDataCaptureConfigurationsOperations + :ivar endpoints: EndpointsOperations operations + :vartype endpoints: azure.mgmt.horizondb.aio.operations.EndpointsOperations + :ivar maintenance_events: MaintenanceEventsOperations operations + :vartype maintenance_events: azure.mgmt.horizondb.aio.operations.MaintenanceEventsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.horizondb.aio.operations.NodesOperations + :ivar log_capture_configurations: LogCaptureConfigurationsOperations operations + :vartype log_capture_configurations: + azure.mgmt.horizondb.aio.operations.LogCaptureConfigurationsOperations + :ivar log_files: LogFilesOperations operations + :vartype log_files: azure.mgmt.horizondb.aio.operations.LogFilesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -79,7 +123,7 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes,docst None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + "2026-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -137,28 +181,53 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.horizon_db_clusters = HorizonDbClustersOperations( + self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.pools = PoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_pools = HorizonDbPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.horizon_db_replicas = HorizonDbReplicasOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_firewall_rules = HorizonDbFirewallRulesOperations( + self.parameter_groups = ParameterGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_private_endpoint_connections = HorizonDbPrivateEndpointConnectionsOperations( + self.default_parameter_groups = DefaultParameterGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_private_link_resources = HorizonDbPrivateLinkResourcesOperations( + self.microsoft_entra_administrators = MicrosoftEntraAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_parameter_groups = HorizonDbParameterGroupsOperations( + self.authentications = AuthenticationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.password_authentications = PasswordAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.horizon_db_administrators = HorizonDbAdministratorsOperations( + self.microsoft_entra_authentications = MicrosoftEntraAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.change_data_capture_capabilities = ChangeDataCaptureCapabilitiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.change_data_capture_destinations = ChangeDataCaptureDestinationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.identity_assignments = IdentityAssignmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.change_data_capture_configurations = ChangeDataCaptureConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.endpoints = EndpointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_events = MaintenanceEventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize) + self.log_capture_configurations = LogCaptureConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.log_files = LogFilesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py index 88cfd10ee386..0e5d4ad2218f 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py @@ -35,7 +35,7 @@ class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-att None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + "2026-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -49,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py index 660c577f1dc7..9c131611bcc1 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py @@ -13,14 +13,27 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._operations import HorizonDbClustersOperations # type: ignore -from ._operations import HorizonDbPoolsOperations # type: ignore -from ._operations import HorizonDbReplicasOperations # type: ignore -from ._operations import HorizonDbFirewallRulesOperations # type: ignore -from ._operations import HorizonDbPrivateEndpointConnectionsOperations # type: ignore -from ._operations import HorizonDbPrivateLinkResourcesOperations # type: ignore -from ._operations import HorizonDbParameterGroupsOperations # type: ignore -from ._operations import HorizonDbAdministratorsOperations # type: ignore +from ._operations import CapabilitiesOperations # type: ignore +from ._operations import ClustersOperations # type: ignore +from ._operations import PoolsOperations # type: ignore +from ._operations import FirewallRulesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import PrivateLinkResourcesOperations # type: ignore +from ._operations import ParameterGroupsOperations # type: ignore +from ._operations import DefaultParameterGroupsOperations # type: ignore +from ._operations import MicrosoftEntraAdministratorsOperations # type: ignore +from ._operations import AuthenticationsOperations # type: ignore +from ._operations import PasswordAuthenticationsOperations # type: ignore +from ._operations import MicrosoftEntraAuthenticationsOperations # type: ignore +from ._operations import ChangeDataCaptureCapabilitiesOperations # type: ignore +from ._operations import ChangeDataCaptureDestinationsOperations # type: ignore +from ._operations import IdentityAssignmentsOperations # type: ignore +from ._operations import ChangeDataCaptureConfigurationsOperations # type: ignore +from ._operations import EndpointsOperations # type: ignore +from ._operations import MaintenanceEventsOperations # type: ignore +from ._operations import NodesOperations # type: ignore +from ._operations import LogCaptureConfigurationsOperations # type: ignore +from ._operations import LogFilesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -28,14 +41,27 @@ __all__ = [ "Operations", - "HorizonDbClustersOperations", - "HorizonDbPoolsOperations", - "HorizonDbReplicasOperations", - "HorizonDbFirewallRulesOperations", - "HorizonDbPrivateEndpointConnectionsOperations", - "HorizonDbPrivateLinkResourcesOperations", - "HorizonDbParameterGroupsOperations", - "HorizonDbAdministratorsOperations", + "CapabilitiesOperations", + "ClustersOperations", + "PoolsOperations", + "FirewallRulesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ParameterGroupsOperations", + "DefaultParameterGroupsOperations", + "MicrosoftEntraAdministratorsOperations", + "AuthenticationsOperations", + "PasswordAuthenticationsOperations", + "MicrosoftEntraAuthenticationsOperations", + "ChangeDataCaptureCapabilitiesOperations", + "ChangeDataCaptureDestinationsOperations", + "IdentityAssignmentsOperations", + "ChangeDataCaptureConfigurationsOperations", + "EndpointsOperations", + "MaintenanceEventsOperations", + "NodesOperations", + "LogCaptureConfigurationsOperations", + "LogFilesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py index 9f47333270fb..6930e2445d17 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -12,12 +12,13 @@ from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import AsyncPipelineClient +from azure.core import AsyncPipelineClient, MatchConditions from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -36,47 +37,89 @@ from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer -from ..._validation import api_version_validation from ...operations._operations import ( - build_horizon_db_administrators_create_or_update_request, - build_horizon_db_administrators_delete_request, - build_horizon_db_administrators_get_request, - build_horizon_db_administrators_list_request, - build_horizon_db_clusters_create_or_update_request, - build_horizon_db_clusters_delete_request, - build_horizon_db_clusters_get_request, - build_horizon_db_clusters_list_by_resource_group_request, - build_horizon_db_clusters_list_by_subscription_request, - build_horizon_db_clusters_restart_request, - build_horizon_db_clusters_start_request, - build_horizon_db_clusters_stop_request, - build_horizon_db_clusters_update_request, - build_horizon_db_firewall_rules_create_or_update_request, - build_horizon_db_firewall_rules_delete_request, - build_horizon_db_firewall_rules_get_request, - build_horizon_db_firewall_rules_list_request, - build_horizon_db_parameter_groups_create_or_update_request, - build_horizon_db_parameter_groups_delete_request, - build_horizon_db_parameter_groups_get_request, - build_horizon_db_parameter_groups_list_by_resource_group_request, - build_horizon_db_parameter_groups_list_by_subscription_request, - build_horizon_db_parameter_groups_list_connections_request, - build_horizon_db_parameter_groups_list_versions_request, - build_horizon_db_parameter_groups_update_request, - build_horizon_db_pools_get_request, - build_horizon_db_pools_list_request, - build_horizon_db_private_endpoint_connections_delete_request, - build_horizon_db_private_endpoint_connections_get_request, - build_horizon_db_private_endpoint_connections_list_request, - build_horizon_db_private_endpoint_connections_update_status_request, - build_horizon_db_private_link_resources_get_request, - build_horizon_db_private_link_resources_list_request, - build_horizon_db_replicas_create_or_update_request, - build_horizon_db_replicas_delete_request, - build_horizon_db_replicas_get_request, - build_horizon_db_replicas_list_request, - build_horizon_db_replicas_update_request, + build_authentications_list_request, + build_capabilities_get_request, + build_capabilities_list_request, + build_change_data_capture_capabilities_create_or_replace_request, + build_change_data_capture_capabilities_delete_request, + build_change_data_capture_capabilities_get_request, + build_change_data_capture_capabilities_list_request, + build_change_data_capture_capabilities_update_request, + build_change_data_capture_configurations_create_or_replace_request, + build_change_data_capture_configurations_delete_request, + build_change_data_capture_configurations_get_request, + build_change_data_capture_configurations_list_request, + build_change_data_capture_configurations_update_request, + build_change_data_capture_destinations_activate_identity_request, + build_change_data_capture_destinations_create_or_replace_request, + build_change_data_capture_destinations_delete_request, + build_change_data_capture_destinations_get_request, + build_change_data_capture_destinations_list_request, + build_change_data_capture_destinations_update_request, + build_clusters_create_or_replace_request, + build_clusters_delete_request, + build_clusters_failover_request, + build_clusters_get_request, + build_clusters_list_by_resource_group_request, + build_clusters_list_by_subscription_request, + build_clusters_update_request, + build_default_parameter_groups_get_request, + build_default_parameter_groups_list_by_subscription_and_region_request, + build_endpoints_get_request, + build_endpoints_list_request, + build_firewall_rules_create_or_replace_request, + build_firewall_rules_delete_request, + build_firewall_rules_get_request, + build_firewall_rules_list_request, + build_identity_assignments_create_or_replace_request, + build_identity_assignments_delete_request, + build_identity_assignments_get_request, + build_identity_assignments_list_request, + build_log_capture_configurations_get_request, + build_log_capture_configurations_list_request, + build_log_capture_configurations_update_request, + build_log_files_get_request, + build_log_files_list_download_urls_request, + build_log_files_list_request, + build_maintenance_events_apply_now_request, + build_maintenance_events_get_request, + build_maintenance_events_list_request, + build_maintenance_events_reschedule_request, + build_microsoft_entra_administrators_create_or_replace_request, + build_microsoft_entra_administrators_delete_request, + build_microsoft_entra_administrators_get_request, + build_microsoft_entra_administrators_list_request, + build_microsoft_entra_authentications_create_or_replace_request, + build_microsoft_entra_authentications_get_request, + build_microsoft_entra_authentications_update_request, + build_nodes_get_request, + build_nodes_list_request, build_operations_list_request, + build_parameter_groups_create_or_replace_request, + build_parameter_groups_delete_request, + build_parameter_groups_get_request, + build_parameter_groups_list_by_resource_group_request, + build_parameter_groups_list_by_subscription_request, + build_parameter_groups_list_connections_request, + build_parameter_groups_update_request, + build_password_authentications_create_or_replace_request, + build_password_authentications_get_request, + build_password_authentications_update_request, + build_pools_create_or_replace_request, + build_pools_delete_request, + build_pools_get_request, + build_pools_list_request, + build_pools_restart_request, + build_pools_start_request, + build_pools_stop_request, + build_pools_update_request, + build_private_endpoint_connections_approve_or_reject_request, + build_private_endpoint_connections_delete_request, + build_private_endpoint_connections_get_request, + build_private_endpoint_connections_list_request, + build_private_link_resources_get_request, + build_private_link_resources_list_request, ) from .._configuration import HorizonDBMgmtClientConfiguration @@ -195,14 +238,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class HorizonDbClustersOperations: # pylint: disable=docstring-missing-param +class CapabilitiesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_clusters` attribute. + :attr:`capabilities` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -213,7 +256,189 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.HorizonDbCluster: + async def get(self, location: str, **kwargs: Any) -> _models.Capability: + """Gets the singleton HorizonDB capability catalog entry available to a subscription in a specific + region. + + :param location: The name of the Azure region. Required. + :type location: str + :return: Capability. The Capability is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Capability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Capability] = kwargs.pop("cls", None) + + _request = build_capabilities_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Capability, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.Capability"]: + """Lists the singleton HorizonDB capability catalog entry available to a subscription in a + specific region. The result contains one item. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of Capability + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Capability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Capability]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_capabilities_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Capability], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ClustersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: """Gets information about a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -221,8 +446,8 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbCluster + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -236,9 +461,9 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_get_request( + _request = build_clusters_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -275,18 +500,18 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbCluster, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_or_update_initial( + async def _create_or_replace_initial( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], + resource: Union[_models.Cluster, _types.Cluster, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -310,7 +535,7 @@ async def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_clusters_create_or_update_request( + _request = build_clusters_create_or_replace_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -346,11 +571,10 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -360,16 +584,26 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: _models.HorizonDbCluster, + resource: _models.Cluster, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. + ) -> AsyncLROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -377,27 +611,37 @@ async def begin_create_or_update( :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster + :type resource: ~azure.mgmt.horizondb.models.Cluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: _types.HorizonDbCluster, + resource: _types.Cluster, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. + ) -> AsyncLROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -405,18 +649,18 @@ async def begin_create_or_update( :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbCluster + :type resource: ~azure.mgmt.horizondb.types.Cluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, @@ -424,8 +668,18 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. + ) -> AsyncLROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -437,46 +691,56 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], + resource: Union[_models.Cluster, _types.Cluster, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. + ) -> AsyncLROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Is either a HorizonDbCluster type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster or - ~azure.mgmt.horizondb.types.HorizonDbCluster or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :param resource: Resource create parameters. Is either a Cluster type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.horizondb.models.Cluster or ~azure.mgmt.horizondb.types.Cluster or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, resource=resource, @@ -490,10 +754,16 @@ async def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbCluster, response.json()) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized path_format_arguments = { @@ -509,13 +779,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbCluster].from_continuation_token( + return AsyncLROPoller[_models.Cluster].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbCluster]( + return AsyncLROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -523,7 +793,7 @@ async def _update_initial( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], + properties: Union[_models.ClusterForPatchUpdate, _types.ClusterForPatchUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -547,7 +817,7 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_clusters_update_request( + _request = build_clusters_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -585,6 +855,9 @@ async def _update_initial( response_headers = {} if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -599,12 +872,12 @@ async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: _models.HorizonDbClusterForPatchUpdate, + properties: _models.ClusterForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> AsyncLROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -612,13 +885,13 @@ async def begin_update( :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate + :type properties: ~azure.mgmt.horizondb.models.ClusterForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -627,12 +900,12 @@ async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: _types.HorizonDbClusterForPatchUpdate, + properties: _types.ClusterForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> AsyncLROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -640,13 +913,13 @@ async def begin_update( :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate + :type properties: ~azure.mgmt.horizondb.types.ClusterForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -659,8 +932,8 @@ async def begin_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> AsyncLROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -672,9 +945,9 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -683,30 +956,30 @@ async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], + properties: Union[_models.ClusterForPatchUpdate, _types.ClusterForPatchUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> AsyncLROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Is either a - HorizonDbClusterForPatchUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate or - ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :param properties: The resource properties to be updated. Is either a ClusterForPatchUpdate + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ClusterForPatchUpdate or + ~azure.mgmt.horizondb.types.ClusterForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -726,7 +999,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbCluster, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -744,13 +1017,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbCluster].from_continuation_token( + return AsyncLROPoller[_models.Cluster].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbCluster]( + return AsyncLROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -768,7 +1041,7 @@ async def _delete_initial(self, resource_group_name: str, cluster_name: str, **k cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_delete_request( + _request = build_clusters_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -818,7 +1091,9 @@ async def _delete_initial(self, resource_group_name: str, cluster_name: str, **k @distributed_trace_async async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a HorizonDB cluster. + """Deletes a HorizonDB cluster, its Cluster-scoped Endpoint, and all remaining child resources. + For an accepted deletion, the long-running operation remains nonterminal until physical + deletion completes and point GET returns 404 Not Found. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -874,22 +1149,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbCluster"]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: """Lists all HorizonDB clusters in a resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of HorizonDbCluster - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -902,7 +1175,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_clusters_list_by_resource_group_request( + _request = build_clusters_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, @@ -944,7 +1217,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbCluster], + List[_models.Cluster], deserialized.get("value", []), ) if cls: @@ -973,17 +1246,17 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.HorizonDbCluster"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: """Lists all HorizonDB clusters in a subscription. - :return: An iterator like instance of HorizonDbCluster - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -996,7 +1269,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Horizon def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_clusters_list_by_subscription_request( + _request = build_clusters_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1037,7 +1310,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbCluster], + List[_models.Cluster], deserialized.get("value", []), ) if cls: @@ -1065,14 +1338,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def _start_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + async def _failover_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1086,7 +1354,7 @@ async def _start_initial(self, resource_group_name: str, cluster_name: str, **kw cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_start_request( + _request = build_clusters_failover_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -1135,34 +1403,33 @@ async def _start_initial(self, resource_group_name: str, cluster_name: str, **kw return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Starts a stopped HorizonDB cluster. + async def begin_failover( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Triggers failover within the cluster's designated read-write pool. HorizonDB selects the + replacement node using the same eligibility and node-selection rules as automatic failover. The + request fails with 409 Conflict when the designated pool is not eligible for failover or + another conflicting operation is in progress. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._start_initial( + raw_result = await self._failover_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, cls=lambda x, y, z: x, @@ -1173,9 +1440,19 @@ async def begin_start(self, resource_group_name: str, cluster_name: str, **kwarg await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -1190,22 +1467,49 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.Cluster].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class PoolsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`pools` attribute. + """ - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any) -> _models.Pool: + """Gets information about a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Pool + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1217,11 +1521,12 @@ async def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_stop_request( + _request = build_pools_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1233,32 +1538,106 @@ async def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwa _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Pool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: Union[_models.Pool, _types.Pool, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pools_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1267,37 +1646,241 @@ async def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwa return deserialized # type: ignore + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: _models.Pool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.Pool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: _types.Pool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.Pool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def begin_stop(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Stops a running HorizonDB cluster. + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: Union[_models.Pool, _types.Pool, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Is either a Pool type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.horizondb.models.Pool or ~azure.mgmt.horizondb.types.Pool or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._stop_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + pool_name=pool_name, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1306,9 +1889,18 @@ async def begin_stop(self, resource_group_name: str, cluster_name: str, **kwargs await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Pool, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -1323,23 +1915,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.Pool].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def _restart_initial( - self, resource_group_name: str, cluster_name: str, **kwargs: Any + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: Union[_models.PoolForPatchUpdate, _types.PoolForPatchUpdate, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1349,16 +1941,27 @@ async def _restart_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_restart_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pools_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -1402,48 +2005,227 @@ async def _restart_initial( return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def begin_restart(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Restarts a HorizonDB cluster. + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: _models.PoolForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.PoolForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: _types.PoolForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.PoolForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: Union[_models.PoolForPatchUpdate, _types.PoolForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Is either a PoolForPatchUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.PoolForPatchUpdate or + ~azure.mgmt.horizondb.types.PoolForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -1458,49 +2240,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.Pool].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class HorizonDbPoolsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_pools` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return AsyncLROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @distributed_trace_async - async def get( + async def _delete_initial( self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> _models.HorizonDbPool: - """Gets information about a HorizonDB pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :return: HorizonDbPool. The HorizonDbPool is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPool - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1512,9 +2264,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPool] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_pools_get_request( + _request = build_pools_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -1529,19 +2281,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1549,20 +2300,93 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbPool, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a HorizonDB pool together with the Pool-scoped Endpoint whose associatedResourceId + identifies that Pool and all FirewallRule children of that Endpoint. The Endpoint cannot + outlive or be deleted independently from its Pool. When this is the Cluster's last surviving + Pool, the service also disconnects every existing private endpoint connection associated with + the Cluster by setting its privateLinkServiceConnectionState.status to Rejected and providing a + description that the last Pool was deleted. The HorizonDB private endpoint connection resources + remain available for inspection and cleanup, and customer-owned + Microsoft.Network/privateEndpoints resources are not deleted. The delete long-running operation + completes only after all required private endpoint disconnections have completed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbPool"]: + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Pool"]: """Lists all HorizonDB pools in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1570,14 +2394,14 @@ def list( :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbPool - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbPool] + :return: An iterator like instance of Pool + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Pool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbPool]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pool]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1590,7 +2414,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_pools_list_request( + _request = build_pools_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -1633,7 +2457,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbPool], + List[_models.Pool], deserialized.get("value", []), ) if cls: @@ -1661,43 +2485,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - -class HorizonDbReplicasOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_replicas` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> _models.HorizonDbReplica: - """Gets information about a HorizonDB replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :return: HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbReplica - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _start_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1709,13 +2499,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_replicas_get_request( + _request = build_pools_start_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1727,19 +2516,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1747,21 +2535,34 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( + @distributed_trace_async + async def begin_start( self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbReplica"]: - """Lists all HorizonDB replicas in a pool. + ) -> AsyncLROPoller[_models.Pool]: + """Starts a stopped HorizonDB pool. Power operations are supported only at pool scope in this API + version; there is no cluster-level start action. Start does not apply pending dynamic or static + parameter changes; parameterGroup.syncStatus remains PendingReboot until a customer-initiated + Restart. When the pool is already Ready, the operation succeeds as a true idempotent no-op and + likewise leaves pending parameter changes pending. The operation is allowed when the pool has + no allocated nodes. After the Pool is running, its Pool-scoped ReadOnly Endpoint routes only + when at least one allocated node is not currently playing the read-write role. The request + fails with 409 Conflict when another operation is in progress or the pool is in any other + incompatible state. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1770,106 +2571,63 @@ def list( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :return: An iterator like instance of HorizonDbReplica - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbReplica]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_replicas_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbReplica], - deserialized.get("value", []), + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return AsyncItemPaged(get_next, extract_data) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Pool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], - **kwargs: Any + async def _stop_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1879,28 +2637,17 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_replicas_create_or_update_request( + _request = build_pools_stop_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -1917,7 +2664,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1930,10 +2677,11 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1943,119 +2691,18 @@ async def _create_or_update_initial( return deserialized # type: ignore - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: _models.HorizonDbReplica, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: _types.HorizonDbReplica, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbReplica - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. + async def begin_stop( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Stops a running HorizonDB pool and deallocates compute. Power operations are supported only at + pool scope in this API version; there is no cluster-level stop action. Stop does not apply + pending dynamic or static parameter changes; parameterGroup.syncStatus remains PendingReboot. A + subsequent Start also preserves those pending changes. The operation succeeds as an idempotent + no-op when the pool is already Stopped. It is allowed when the pool has no allocated nodes. The + Pool-scoped ReadOnly Endpoint remains discoverable but has no routing destination while the + Pool is Stopped. The request fails with 409 Conflict when another operation is in progress or + the pool is in any other incompatible state. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2064,33 +2711,23 @@ async def begin_create_or_update( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Is either a HorizonDbReplica type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica or - ~azure.mgmt.horizondb.types.HorizonDbReplica or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._stop_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - replica_name=replica_name, - resource=resource, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2101,7 +2738,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + deserialized = _deserialize(_models.Pool, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2119,24 +2756,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbReplica].from_continuation_token( + return AsyncLROPoller[_models.Pool].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbReplica]( + return AsyncLROPoller[_models.Pool]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], - **kwargs: Any + async def _restart_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2146,28 +2777,17 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_replicas_update_request( + _request = build_pools_restart_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -2198,6 +2818,9 @@ async def _update_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -2208,119 +2831,19 @@ async def _update_initial( return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: _models.HorizonDbReplicaForPatchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: _types.HorizonDbReplicaForPatchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). + async def begin_restart( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Pool]: + """Restarts the PostgreSQL container on all allocated nodes in a ready HorizonDB pool and applies + pending dynamic and static parameter changes. This customer-initiated Restart is the only + operation that applies static parameter changes or dynamic parameter changes requested with + PendingReboot; Stop followed by Start and scheduled maintenance do not apply them. Power + operations are supported only at pool scope in this API version; there is no cluster-level + restart action. When the pool has no allocated nodes, the operation succeeds without restarting + any nodes, pending changes are considered applied, parameterGroup.syncStatus becomes InSync, + and the resulting configuration applies to nodes allocated later. The request fails with 409 + Conflict when another operation is in progress or the pool is in any other incompatible state. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2329,33 +2852,23 @@ async def begin_update( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Is either a - HorizonDbReplicaForPatchUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate or - ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of AsyncLROPoller that returns Pool. The Pool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.Pool] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._restart_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - replica_name=replica_name, - properties=properties, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2366,7 +2879,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + deserialized = _deserialize(_models.Pool, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2384,156 +2897,25 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbReplica].from_continuation_token( + return AsyncLROPoller[_models.Pool].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbReplica]( + return AsyncLROPoller[_models.Pool]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_horizon_db_replicas_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a HorizonDB replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class HorizonDbFirewallRulesOperations: # pylint: disable=docstring-missing-param +class FirewallRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_firewall_rules` attribute. + :attr:`firewall_rules` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2546,8 +2928,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.HorizonDbFirewallRule: - """Gets information about a HorizonDB firewall rule. + ) -> _models.FirewallRule: + """Gets information about a HorizonDB pool firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2556,10 +2938,10 @@ async def get( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. :type firewall_rule_name: str - :return: HorizonDbFirewallRule. The HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2573,9 +2955,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) - _request = build_horizon_db_firewall_rules_get_request( + _request = build_firewall_rules_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -2614,7 +2996,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) + deserialized = _deserialize(_models.FirewallRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2624,7 +3006,7 @@ async def get( @distributed_trace def list( self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbFirewallRule"]: + ) -> AsyncItemPaged["_models.FirewallRule"]: """Lists all HorizonDB firewall rules in a pool. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2634,15 +3016,14 @@ def list( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :return: An iterator like instance of HorizonDbFirewallRule - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An iterator like instance of FirewallRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbFirewallRule]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.FirewallRule]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2655,7 +3036,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_firewall_rules_list_request( + _request = build_firewall_rules_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -2699,7 +3080,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbFirewallRule], + List[_models.FirewallRule], deserialized.get("value", []), ) if cls: @@ -2727,13 +3108,13 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _create_or_update_initial( + async def _create_or_replace_initial( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], + resource: Union[_models.FirewallRule, _types.FirewallRule, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2757,7 +3138,7 @@ async def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_firewall_rules_create_or_update_request( + _request = build_firewall_rules_create_or_replace_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -2795,11 +3176,10 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -2809,18 +3189,18 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: _models.HorizonDbFirewallRule, + resource: _models.FirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2829,32 +3209,32 @@ async def begin_create_or_update( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. :type firewall_rule_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :type resource: ~azure.mgmt.horizondb.models.FirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of AsyncLROPoller that returns FirewallRule. The FirewallRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: _types.HorizonDbFirewallRule, + resource: _types.FirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2863,21 +3243,21 @@ async def begin_create_or_update( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. :type firewall_rule_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbFirewallRule + :type resource: ~azure.mgmt.horizondb.types.FirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of AsyncLROPoller that returns FirewallRule. The FirewallRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, @@ -2887,8 +3267,8 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2897,30 +3277,30 @@ async def begin_create_or_update( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. :type firewall_rule_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of AsyncLROPoller that returns FirewallRule. The FirewallRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], + resource: Union[_models.FirewallRule, _types.FirewallRule, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2929,27 +3309,27 @@ async def begin_create_or_update( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. :type firewall_rule_name: str - :param resource: Resource create parameters. Is either a HorizonDbFirewallRule type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule or - ~azure.mgmt.horizondb.types.HorizonDbFirewallRule or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :param resource: Resource create parameters. Is either a FirewallRule type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.horizondb.models.FirewallRule or + ~azure.mgmt.horizondb.types.FirewallRule or IO[bytes] + :return: An instance of AsyncLROPoller that returns FirewallRule. The FirewallRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -2965,12 +3345,18 @@ async def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FirewallRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } @@ -2984,13 +3370,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbFirewallRule].from_continuation_token( + return AsyncLROPoller[_models.FirewallRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbFirewallRule]( + return AsyncLROPoller[_models.FirewallRule]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -3010,7 +3396,7 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_firewall_rules_delete_request( + _request = build_firewall_rules_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -3064,7 +3450,7 @@ async def _delete_initial( async def begin_delete( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a HorizonDB firewall rule. + """Deletes a HorizonDB pool firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3073,7 +3459,7 @@ async def begin_delete( :type cluster_name: str :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. :type firewall_rule_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -3126,14 +3512,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class HorizonDbPrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param,name-too-long +class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_private_endpoint_connections` attribute. + :attr:`private_endpoint_connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3175,7 +3561,7 @@ async def get( cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) - _request = build_horizon_db_private_endpoint_connections_get_request( + _request = build_private_endpoint_connections_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -3252,7 +3638,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_private_endpoint_connections_list_request( + _request = build_private_endpoint_connections_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -3323,8 +3709,88 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + async def _approve_or_reject_initial( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_approve_or_reject_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - async def update_status( + async def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, @@ -3333,8 +3799,11 @@ async def update_status( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3349,14 +3818,15 @@ async def update_status( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update_status( + async def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, @@ -3365,8 +3835,11 @@ async def update_status( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3381,14 +3854,15 @@ async def update_status( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update_status( + async def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, @@ -3397,8 +3871,11 @@ async def update_status( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3413,37 +3890,26 @@ async def update_status( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "private_endpoint_connection_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def update_status( + async def begin_approve_or_reject( self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3457,78 +3923,64 @@ async def update_status( or a IO[bytes] type. Required. :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource or ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource or IO[bytes] - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._approve_or_reject_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_horizon_db_private_endpoint_connections_update_status_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateEndpointConnectionResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateEndpointConnectionResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -3546,7 +3998,7 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_private_endpoint_connections_delete_request( + _request = build_private_endpoint_connections_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -3659,14 +4111,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class HorizonDbPrivateLinkResourcesOperations: # pylint: disable=docstring-missing-param +class PrivateLinkResourcesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_private_link_resources` attribute. + :attr:`private_link_resources` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3679,7 +4131,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( self, resource_group_name: str, cluster_name: str, group_name: str, **kwargs: Any - ) -> _models.HorizonDbPrivateLinkResource: + ) -> _models.PrivateLinkResource: """Gets a private link resource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3689,9 +4141,8 @@ async def get( :type cluster_name: str :param group_name: The name of the private link resource. Required. :type group_name: str - :return: HorizonDbPrivateLinkResource. The HorizonDbPrivateLinkResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3705,9 +4156,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPrivateLinkResource] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - _request = build_horizon_db_private_link_resources_get_request( + _request = build_private_link_resources_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, group_name=group_name, @@ -3745,7 +4196,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbPrivateLinkResource, response.json()) + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3755,7 +4206,7 @@ async def get( @distributed_trace def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbPrivateLinkResource"]: + ) -> AsyncItemPaged["_models.PrivateLinkResource"]: """Lists private link resources in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3763,15 +4214,15 @@ def list( :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbPrivateLinkResource + :return: An iterator like instance of PrivateLinkResource :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.PrivateLinkResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbPrivateLinkResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3784,7 +4235,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_private_link_resources_list_request( + _request = build_private_link_resources_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -3827,7 +4278,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbPrivateLinkResource], + List[_models.PrivateLinkResource], deserialized.get("value", []), ) if cls: @@ -3856,14 +4307,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class HorizonDbParameterGroupsOperations: # pylint: disable=docstring-missing-param +class ParameterGroupsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_parameter_groups` attribute. + :attr:`parameter_groups` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3874,9 +4325,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> _models.HorizonDbParameterGroup: + async def get(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> _models.ParameterGroup: """Gets information about a HorizonDB parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3884,8 +4333,8 @@ async def get( :type resource_group_name: str :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :return: HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :return: ParameterGroup. The ParameterGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ParameterGroup :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3899,9 +4348,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.ParameterGroup] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_get_request( + _request = build_parameter_groups_get_request( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, subscription_id=self._config.subscription_id, @@ -3938,18 +4387,18 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + deserialized = _deserialize(_models.ParameterGroup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_or_update_initial( + async def _create_or_replace_initial( self, resource_group_name: str, parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], + resource: Union[_models.ParameterGroup, _types.ParameterGroup, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3973,7 +4422,7 @@ async def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_parameter_groups_create_or_update_request( + _request = build_parameter_groups_create_or_replace_request( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, subscription_id=self._config.subscription_id, @@ -4023,16 +4472,16 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, - resource: _models.HorizonDbParameterGroup, + resource: _models.ParameterGroup, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4040,28 +4489,27 @@ async def begin_create_or_update( :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :type resource: ~azure.mgmt.horizondb.models.ParameterGroup :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, - resource: _types.HorizonDbParameterGroup, + resource: _types.ParameterGroup, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4069,19 +4517,18 @@ async def begin_create_or_update( :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbParameterGroup + :type resource: ~azure.mgmt.horizondb.types.ParameterGroup :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, @@ -4089,8 +4536,8 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4102,48 +4549,46 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], + resource: Union[_models.ParameterGroup, _types.ParameterGroup, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :param resource: Resource create parameters. Is either a HorizonDbParameterGroup type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup or - ~azure.mgmt.horizondb.types.HorizonDbParameterGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param resource: Resource create parameters. Is either a ParameterGroup type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.ParameterGroup or + ~azure.mgmt.horizondb.types.ParameterGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.ParameterGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, resource=resource, @@ -4158,7 +4603,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + deserialized = _deserialize(_models.ParameterGroup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4176,13 +4621,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbParameterGroup].from_continuation_token( + return AsyncLROPoller[_models.ParameterGroup].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbParameterGroup]( + return AsyncLROPoller[_models.ParameterGroup]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -4190,9 +4635,7 @@ async def _update_initial( self, resource_group_name: str, parameter_group_name: str, - properties: Union[ - _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] - ], + properties: Union[_models.ParameterGroupForPatchUpdate, _types.ParameterGroupForPatchUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4216,7 +4659,7 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_parameter_groups_update_request( + _request = build_parameter_groups_update_request( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, subscription_id=self._config.subscription_id, @@ -4253,6 +4696,9 @@ async def _update_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -4268,12 +4714,17 @@ async def begin_update( self, resource_group_name: str, parameter_group_name: str, - properties: _models.HorizonDbParameterGroupForPatchUpdate, + properties: _models.ParameterGroupForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4281,14 +4732,13 @@ async def begin_update( :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate + :type properties: ~azure.mgmt.horizondb.models.ParameterGroupForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4297,12 +4747,17 @@ async def begin_update( self, resource_group_name: str, parameter_group_name: str, - properties: _types.HorizonDbParameterGroupForPatchUpdate, + properties: _types.ParameterGroupForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4310,14 +4765,13 @@ async def begin_update( :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate + :type properties: ~azure.mgmt.horizondb.types.ParameterGroupForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4330,8 +4784,13 @@ async def begin_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4343,10 +4802,9 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4355,12 +4813,15 @@ async def begin_update( self, resource_group_name: str, parameter_group_name: str, - properties: Union[ - _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] - ], + properties: Union[_models.ParameterGroupForPatchUpdate, _types.ParameterGroupForPatchUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + ) -> AsyncLROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4368,20 +4829,19 @@ async def begin_update( :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param properties: The resource properties to be updated. Is either a - HorizonDbParameterGroupForPatchUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate or - ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + ParameterGroupForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ParameterGroupForPatchUpdate or + ~azure.mgmt.horizondb.types.ParameterGroupForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns ParameterGroup. The ParameterGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.ParameterGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -4401,7 +4861,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + deserialized = _deserialize(_models.ParameterGroup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4419,13 +4879,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbParameterGroup].from_continuation_token( + return AsyncLROPoller[_models.ParameterGroup].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbParameterGroup]( + return AsyncLROPoller[_models.ParameterGroup]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -4445,7 +4905,7 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_delete_request( + _request = build_parameter_groups_delete_request( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, subscription_id=self._config.subscription_id, @@ -4497,7 +4957,8 @@ async def _delete_initial( async def begin_delete( self, resource_group_name: str, parameter_group_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a HorizonDB parameter group. + """Deletes a HorizonDB parameter group. Deletion fails with a conflict when the parameter group is + associated with one or more pools. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4555,21 +5016,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: + ) -> AsyncItemPaged["_models.ParameterGroup"]: """Lists all HorizonDB parameter groups in a resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An iterator like instance of ParameterGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ParameterGroup]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4582,7 +5042,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_by_resource_group_request( + _request = build_parameter_groups_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, @@ -4624,7 +5084,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.ParameterGroup], deserialized.get("value", []), ) if cls: @@ -4653,18 +5113,17 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ParameterGroup"]: """Lists all HorizonDB parameter groups in a subscription. - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An iterator like instance of ParameterGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.ParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ParameterGroup]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4677,7 +5136,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Horizon def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_by_subscription_request( + _request = build_parameter_groups_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4718,7 +5177,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.ParameterGroup], deserialized.get("value", []), ) if cls: @@ -4749,7 +5208,7 @@ async def get_next(next_link=None): @distributed_trace def list_connections( self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbParameterGroupConnectionProperties"]: + ) -> AsyncItemPaged["_models.ParameterGroupConnectionProperties"]: """Gets all connections to a parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -4757,15 +5216,15 @@ def list_connections( :type resource_group_name: str :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :return: An iterator like instance of HorizonDbParameterGroupConnectionProperties + :return: An iterator like instance of ParameterGroupConnectionProperties :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.ParameterGroupConnectionProperties] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroupConnectionProperties]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ParameterGroupConnectionProperties]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4778,7 +5237,7 @@ def list_connections( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_connections_request( + _request = build_parameter_groups_list_connections_request( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, subscription_id=self._config.subscription_id, @@ -4821,56 +5280,6585 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroupConnectionProperties], + List[_models.ParameterGroupConnectionProperties], deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DefaultParameterGroupsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`default_parameter_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription_and_region( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DefaultParameterGroup"]: + """Lists default parameter groups available for a subscription in a specific region. The response + contains at most one default parameter group for each PostgreSQL version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of DefaultParameterGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.DefaultParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DefaultParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_default_parameter_groups_list_by_subscription_and_region_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DefaultParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, location: str, name: str, **kwargs: Any) -> _models.DefaultParameterGroup: + """Gets a default parameter group available for a subscription in a specific region. Each + PostgreSQL version has at most one default parameter group in a location. + + :param location: The name of the Azure region. Required. + :type location: str + :param name: The name of the DefaultParameterGroup. Required. + :type name: str + :return: DefaultParameterGroup. The DefaultParameterGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.DefaultParameterGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DefaultParameterGroup] = kwargs.pop("cls", None) + + _request = build_default_parameter_groups_get_request( + location=location, + name=name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DefaultParameterGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MicrosoftEntraAdministratorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`microsoft_entra_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> _models.MicrosoftEntraAdministrator: + """Gets information about a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :return: MicrosoftEntraAdministrator. The MicrosoftEntraAdministrator is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MicrosoftEntraAdministrator] = kwargs.pop("cls", None) + + _request = build_microsoft_entra_administrators_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MicrosoftEntraAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: Union[_models.MicrosoftEntraAdministratorAdd, _types.MicrosoftEntraAdministratorAdd, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_microsoft_entra_administrators_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: _models.MicrosoftEntraAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministratorAdd + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: _types.MicrosoftEntraAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.MicrosoftEntraAdministratorAdd + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: Union[_models.MicrosoftEntraAdministratorAdd, _types.MicrosoftEntraAdministratorAdd, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Is either a MicrosoftEntraAdministratorAdd type or + a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministratorAdd or + ~azure.mgmt.horizondb.types.MicrosoftEntraAdministratorAdd or IO[bytes] + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MicrosoftEntraAdministrator] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.MicrosoftEntraAdministrator, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MicrosoftEntraAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MicrosoftEntraAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_microsoft_entra_administrators_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a PostgreSQL role that is a member of azure_pg_admin and mapped to a Microsoft Entra + principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.MicrosoftEntraAdministrator"]: + """Lists the PostgreSQL roles in a cluster that are members of azure_pg_admin and mapped to + Microsoft Entra principals. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of MicrosoftEntraAdministrator + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MicrosoftEntraAdministrator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_microsoft_entra_administrators_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MicrosoftEntraAdministrator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AuthenticationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Authentication"]: + """Lists the two service-created authentication configurations for the cluster: passwordMethod and + microsoftEntra. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Authentication + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Authentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Authentication]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_authentications_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Authentication], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PasswordAuthenticationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`password_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.PasswordAuthentication: + """Gets the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: PasswordAuthentication. The PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PasswordAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PasswordAuthentication] = kwargs.pop("cls", None) + + _request = build_password_authentications_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PasswordAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.PasswordAuthentication, _types.PasswordAuthentication, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_password_authentications_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _models.PasswordAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.PasswordAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _types.PasswordAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.PasswordAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.PasswordAuthentication, _types.PasswordAuthentication, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is either a PasswordAuthentication type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.PasswordAuthentication or + ~azure.mgmt.horizondb.types.PasswordAuthentication or IO[bytes] + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PasswordAuthentication] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.PasswordAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PasswordAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PasswordAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.PasswordAuthenticationForPatchUpdate, _types.PasswordAuthenticationForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_password_authentications_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _models.PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.PasswordAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _types.PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.PasswordAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.PasswordAuthenticationForPatchUpdate, _types.PasswordAuthenticationForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Is either a + PasswordAuthenticationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.PasswordAuthenticationForPatchUpdate or + ~azure.mgmt.horizondb.types.PasswordAuthenticationForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PasswordAuthentication] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PasswordAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PasswordAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PasswordAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class MicrosoftEntraAuthenticationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`microsoft_entra_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> _models.MicrosoftEntraAuthentication: + """Gets the service-created Microsoft Entra authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: MicrosoftEntraAuthentication. The MicrosoftEntraAuthentication is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MicrosoftEntraAuthentication] = kwargs.pop("cls", None) + + _request = build_microsoft_entra_authentications_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MicrosoftEntraAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.MicrosoftEntraAuthentication, _types.MicrosoftEntraAuthentication, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_microsoft_entra_authentications_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _models.MicrosoftEntraAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _types.MicrosoftEntraAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.MicrosoftEntraAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.MicrosoftEntraAuthentication, _types.MicrosoftEntraAuthentication, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is either a MicrosoftEntraAuthentication type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication or + ~azure.mgmt.horizondb.types.MicrosoftEntraAuthentication or IO[bytes] + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MicrosoftEntraAuthentication] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.MicrosoftEntraAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MicrosoftEntraAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MicrosoftEntraAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.MicrosoftEntraAuthenticationForPatchUpdate, + _types.MicrosoftEntraAuthenticationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_microsoft_entra_authentications_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _models.MicrosoftEntraAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _types.MicrosoftEntraAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.MicrosoftEntraAuthenticationForPatchUpdate, + _types.MicrosoftEntraAuthenticationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Is either a + MicrosoftEntraAuthenticationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationForPatchUpdate or + ~azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MicrosoftEntraAuthentication] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MicrosoftEntraAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MicrosoftEntraAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MicrosoftEntraAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ChangeDataCaptureCapabilitiesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`change_data_capture_capabilities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> _models.ChangeDataCaptureCapability: + """Gets the singleton change data capture capability for a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: ChangeDataCaptureCapability. The ChangeDataCaptureCapability is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ChangeDataCaptureCapability] = kwargs.pop("cls", None) + + _request = build_change_data_capture_capabilities_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ChangeDataCaptureCapability, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.ChangeDataCaptureCapability, _types.ChangeDataCaptureCapability, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_capabilities_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _models.ChangeDataCaptureCapability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapability + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _types.ChangeDataCaptureCapability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.ChangeDataCaptureCapability + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.ChangeDataCaptureCapability, _types.ChangeDataCaptureCapability, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is either a ChangeDataCaptureCapability type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapability or + ~azure.mgmt.horizondb.types.ChangeDataCaptureCapability or IO[bytes] + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureCapability] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ChangeDataCaptureCapability, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ChangeDataCaptureCapability].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ChangeDataCaptureCapability]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.ChangeDataCaptureCapabilityForPatchUpdate, + _types.ChangeDataCaptureCapabilityForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_capabilities_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _models.ChangeDataCaptureCapabilityForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _types.ChangeDataCaptureCapabilityForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.ChangeDataCaptureCapabilityForPatchUpdate, + _types.ChangeDataCaptureCapabilityForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Is either a + ChangeDataCaptureCapabilityForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityForPatchUpdate or + ~azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureCapability] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ChangeDataCaptureCapability, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ChangeDataCaptureCapability].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ChangeDataCaptureCapability]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_change_data_capture_capabilities_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the change data capture capability after all change data capture destinations and + configurations have been removed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ChangeDataCaptureCapability"]: + """Lists the optional singleton change data capture capability for a cluster. The result contains + zero or one item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ChangeDataCaptureCapability + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ChangeDataCaptureCapability]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_change_data_capture_capabilities_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ChangeDataCaptureCapability], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ChangeDataCaptureDestinationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`change_data_capture_destinations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any + ) -> _models.ChangeDataCaptureDestination: + """Gets a change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :return: ChangeDataCaptureDestination. The ChangeDataCaptureDestination is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestination + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ChangeDataCaptureDestination] = kwargs.pop("cls", None) + + _request = build_change_data_capture_destinations_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ChangeDataCaptureDestination, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: Union[_models.ChangeDataCaptureDestination, _types.ChangeDataCaptureDestination, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_destinations_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: _models.ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestination + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: _types.ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.ChangeDataCaptureDestination + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: Union[_models.ChangeDataCaptureDestination, _types.ChangeDataCaptureDestination, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Is either a ChangeDataCaptureDestination type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestination or + ~azure.mgmt.horizondb.types.ChangeDataCaptureDestination or IO[bytes] + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureDestination] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ChangeDataCaptureDestination, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ChangeDataCaptureDestination].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ChangeDataCaptureDestination]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: Union[ + _models.ChangeDataCaptureDestinationForPatchUpdate, + _types.ChangeDataCaptureDestinationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_destinations_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: _models.ChangeDataCaptureDestinationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: _types.ChangeDataCaptureDestinationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ChangeDataCaptureDestinationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + properties: Union[ + _models.ChangeDataCaptureDestinationForPatchUpdate, + _types.ChangeDataCaptureDestinationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Is either a + ChangeDataCaptureDestinationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationForPatchUpdate or + ~azure.mgmt.horizondb.types.ChangeDataCaptureDestinationForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureDestination] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ChangeDataCaptureDestination, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ChangeDataCaptureDestination].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ChangeDataCaptureDestination]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_change_data_capture_destinations_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a change data capture destination after all referencing configurations and identity + assignments have been removed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ChangeDataCaptureDestination"]: + """Lists change data capture destinations in a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ChangeDataCaptureDestination + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ChangeDataCaptureDestination]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_change_data_capture_destinations_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ChangeDataCaptureDestination], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _activate_identity_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: Union[ + _models.ActivateChangeDataCaptureIdentityRequest, _types.ActivateChangeDataCaptureIdentityRequest, IO[bytes] + ], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_destinations_activate_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: _models.ActivateChangeDataCaptureIdentityRequest, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ActivateChangeDataCaptureIdentityResult. + The ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: _types.ActivateChangeDataCaptureIdentityRequest, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.types.ActivateChangeDataCaptureIdentityRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ActivateChangeDataCaptureIdentityResult. + The ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ActivateChangeDataCaptureIdentityResult. + The ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_activate_identity( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: Union[ + _models.ActivateChangeDataCaptureIdentityRequest, _types.ActivateChangeDataCaptureIdentityRequest, IO[bytes] + ], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Is either a + ActivateChangeDataCaptureIdentityRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityRequest or + ~azure.mgmt.horizondb.types.ActivateChangeDataCaptureIdentityRequest or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ActivateChangeDataCaptureIdentityResult. + The ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActivateChangeDataCaptureIdentityResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._activate_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + body=body, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ActivateChangeDataCaptureIdentityResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ActivateChangeDataCaptureIdentityResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ActivateChangeDataCaptureIdentityResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class IdentityAssignmentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`identity_assignments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, destination_name: str, assignment_name: str, **kwargs: Any + ) -> _models.IdentityAssignment: + """Gets a change data capture identity assignment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :return: IdentityAssignment. The IdentityAssignment is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.IdentityAssignment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IdentityAssignment] = kwargs.pop("cls", None) + + _request = build_identity_assignments_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + assignment_name=assignment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IdentityAssignment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: Union[_models.IdentityAssignment, _types.IdentityAssignment, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_identity_assignments_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + assignment_name=assignment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: _models.IdentityAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.IdentityAssignment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IdentityAssignment. The IdentityAssignment + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: _types.IdentityAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.IdentityAssignment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IdentityAssignment. The IdentityAssignment + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IdentityAssignment. The IdentityAssignment + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: Union[_models.IdentityAssignment, _types.IdentityAssignment, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Is either a IdentityAssignment type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.IdentityAssignment or + ~azure.mgmt.horizondb.types.IdentityAssignment or IO[bytes] + :return: An instance of AsyncLROPoller that returns IdentityAssignment. The IdentityAssignment + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IdentityAssignment] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + assignment_name=assignment_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.IdentityAssignment, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IdentityAssignment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IdentityAssignment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, destination_name: str, assignment_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_identity_assignments_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + assignment_name=assignment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, destination_name: str, assignment_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an inactive change data capture identity assignment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + assignment_name=assignment_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.IdentityAssignment"]: + """Lists identity assignments for a change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :return: An iterator like instance of IdentityAssignment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IdentityAssignment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_identity_assignments_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IdentityAssignment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ChangeDataCaptureConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`change_data_capture_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, configuration_name: str, **kwargs: Any + ) -> _models.ChangeDataCaptureConfiguration: + """Gets a change data capture configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :return: ChangeDataCaptureConfiguration. The ChangeDataCaptureConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ChangeDataCaptureConfiguration] = kwargs.pop("cls", None) + + _request = build_change_data_capture_configurations_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ChangeDataCaptureConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: Union[_models.ChangeDataCaptureConfiguration, _types.ChangeDataCaptureConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_configurations_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: _models.ChangeDataCaptureConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: _types.ChangeDataCaptureConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.ChangeDataCaptureConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: Union[_models.ChangeDataCaptureConfiguration, _types.ChangeDataCaptureConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Is either a ChangeDataCaptureConfiguration type or + a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration or + ~azure.mgmt.horizondb.types.ChangeDataCaptureConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ChangeDataCaptureConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ChangeDataCaptureConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ChangeDataCaptureConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: Union[ + _models.ChangeDataCaptureConfigurationForPatchUpdate, + _types.ChangeDataCaptureConfigurationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_configurations_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: _models.ChangeDataCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: _types.ChangeDataCaptureConfigurationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: Union[ + _models.ChangeDataCaptureConfigurationForPatchUpdate, + _types.ChangeDataCaptureConfigurationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Is either a + ChangeDataCaptureConfigurationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationForPatchUpdate or + ~azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ChangeDataCaptureConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ChangeDataCaptureConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ChangeDataCaptureConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, configuration_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_change_data_capture_configurations_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a change data capture configuration after destination-side replication has been stopped + or detached. This operation never deletes the Microsoft Fabric mirrored-database item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ChangeDataCaptureConfiguration"]: + """Lists change data capture configurations in a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ChangeDataCaptureConfiguration + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ChangeDataCaptureConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_change_data_capture_configurations_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ChangeDataCaptureConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class EndpointsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`endpoints` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, endpoint_name: str, **kwargs: Any + ) -> _models.Endpoint: + """Gets information about a service-generated HorizonDB Cluster- or Pool-scoped Endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param endpoint_name: The platform-assigned name of the HorizonDB endpoint. A Cluster-scoped + ReadWrite Endpoint has exactly the same name as its associated Cluster. A Pool-scoped Endpoint + has exactly the same name as its associated Pool. Required. + :type endpoint_name: str + :return: Endpoint. The Endpoint is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Endpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Endpoint] = kwargs.pop("cls", None) + + _request = build_endpoints_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + endpoint_name=endpoint_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Endpoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Endpoint"]: + """Lists the service-generated Endpoints in a cluster. The collection contains the Cluster-scoped + Endpoint named cluster and one Pool-scoped Endpoint for each pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Endpoint + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Endpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Endpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_endpoints_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Endpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class MaintenanceEventsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`maintenance_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, maintenance_event_id: str, **kwargs: Any + ) -> _models.MaintenanceEvent: + """Gets information about a maintenance event for a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :return: MaintenanceEvent. The MaintenanceEvent is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.MaintenanceEvent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceEvent] = kwargs.pop("cls", None) + + _request = build_maintenance_events_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceEvent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.MaintenanceEvent"]: + """Lists maintenance events for a HorizonDB pool. Use the OData $filter query parameter to filter + by properties/status with the eq and or operators. For example, properties/status eq 'Planned' + or properties/status eq 'InProgress' returns upcoming events. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :keyword filter: The OData filter expression to apply to the list operation. Default value is + None. + :paramtype filter: str + :return: An iterator like instance of MaintenanceEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.MaintenanceEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MaintenanceEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_maintenance_events_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MaintenanceEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reschedule_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, _types.MaintenanceEventRescheduleRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_events_reschedule_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: _models.MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.models.MaintenanceEventRescheduleRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: _types.MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.types.MaintenanceEventRescheduleRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, _types.MaintenanceEventRescheduleRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Is either a MaintenanceEventRescheduleRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.horizondb.models.MaintenanceEventRescheduleRequest or + ~azure.mgmt.horizondb.types.MaintenanceEventRescheduleRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reschedule_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _apply_now_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, maintenance_event_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_maintenance_events_apply_now_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_apply_now( + self, resource_group_name: str, cluster_name: str, pool_name: str, maintenance_event_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Applies the maintenance event immediately. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._apply_now_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NodesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`nodes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, node_name: str, **kwargs: Any + ) -> _models.Node: + """Gets a node allocated to a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param node_name: The name of the Node. Required. + :type node_name: str + :return: Node. The Node is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Node + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Node] = kwargs.pop("cls", None) + + _request = build_nodes_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + node_name=node_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Node, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def list_versions( - self, resource_group_name: str, parameter_group_name: str, *, version: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: - """Lists parameter groups filtered by version number. + def list( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Node"]: + """Lists the nodes allocated to a HorizonDB pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :keyword version: The version number to filter by. Default value is None. - :paramtype version: int - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An iterator like instance of Node + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.Node] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Node]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4883,11 +11871,11 @@ def list_versions( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_versions_request( + _request = build_nodes_list_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, - version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4927,7 +11915,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.Node], deserialized.get("value", []), ) if cls: @@ -4956,14 +11944,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class HorizonDbAdministratorsOperations: # pylint: disable=docstring-missing-param +class LogCaptureConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_administrators` attribute. + :attr:`log_capture_configurations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -4974,34 +11962,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "object_id", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) async def get( - self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> _models.HorizonDbAdministrator: - """Gets information about a HorizonDB administrator. + self, resource_group_name: str, cluster_name: str, log_capture_configuration_name: str, **kwargs: Any + ) -> _models.LogCaptureConfiguration: + """Gets a log capture configuration for a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :return: HorizonDbAdministrator. The HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbAdministrator + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :return: LogCaptureConfiguration. The LogCaptureConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.LogCaptureConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5015,12 +11989,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) + cls: ClsType[_models.LogCaptureConfiguration] = kwargs.pop("cls", None) - _request = build_horizon_db_administrators_get_request( + _request = build_log_capture_configurations_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - object_id=object_id, + log_capture_configuration_name=log_capture_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5055,34 +12029,21 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) + deserialized = _deserialize(_models.LogCaptureConfiguration, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "object_id", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def _create_or_update_initial( + async def _update_initial( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], + log_capture_configuration_name: str, + properties: Union[ + _models.LogCaptureConfigurationForPatchUpdate, _types.LogCaptureConfigurationForPatchUpdate, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -5101,15 +12062,15 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(properties, (IOBase, bytes)): + _content = properties else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_administrators_create_or_update_request( + _request = build_log_capture_configurations_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - object_id=object_id, + log_capture_configuration_name=log_capture_configuration_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -5130,7 +12091,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5143,10 +12104,11 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -5157,203 +12119,322 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_update( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: _models.HorizonDbAdministratorAdd, + log_capture_configuration_name: str, + properties: _models.LogCaptureConfigurationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + ) -> AsyncLROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.LogCaptureConfigurationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :return: An instance of AsyncLROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_update( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: _types.HorizonDbAdministratorAdd, + log_capture_configuration_name: str, + properties: _types.LogCaptureConfigurationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + ) -> AsyncLROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.LogCaptureConfigurationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :return: An instance of AsyncLROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: Union[ + _models.LogCaptureConfigurationForPatchUpdate, _types.LogCaptureConfigurationForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Is either a + LogCaptureConfigurationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.LogCaptureConfigurationForPatchUpdate or + ~azure.mgmt.horizondb.types.LogCaptureConfigurationForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LogCaptureConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + log_capture_configuration_name=log_capture_configuration_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LogCaptureConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LogCaptureConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogCaptureConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.LogCaptureConfiguration"]: + """Lists the log capture configurations for a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of LogCaptureConfiguration + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.LogCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LogCaptureConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_log_capture_configurations_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LogCaptureConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - object_id: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return AsyncItemPaged(get_next, extract_data) + + +class LogFilesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`log_files` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "object_id", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - object_id: str, - resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + async def get( + self, resource_group_name: str, cluster_name: str, log_file_name: str, **kwargs: Any + ) -> _models.LogFile: + """Gets metadata for a captured HorizonDB log file. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Is either a HorizonDbAdministratorAdd type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd or - ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :param log_file_name: The name of the LogFile. Required. + :type log_file_name: str + :return: LogFile. The LogFile is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.LogFile :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - object_id=object_id, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.HorizonDbAdministrator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.HorizonDbAdministrator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5365,12 +12446,12 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.LogFile] = kwargs.pop("cls", None) - _request = build_horizon_db_administrators_delete_request( + _request = build_log_files_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - object_id=object_id, + log_file_name=log_file_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5382,18 +12463,19 @@ async def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -5401,117 +12483,33 @@ async def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LogFile, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def begin_delete( - self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a HorizonDB administrator. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - object_id=object_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbAdministrator"]: - """Lists all HorizonDB administrators in a cluster. + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.LogFile"]: + """Lists captured log files for a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbAdministrator - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :return: An iterator like instance of LogFile + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.LogFile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbAdministrator]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.LogFile]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5524,7 +12522,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_administrators_list_request( + _request = build_log_files_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -5567,7 +12565,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbAdministrator], + List[_models.LogFile], deserialized.get("value", []), ) if cls: @@ -5594,3 +12592,80 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_download_urls( + self, resource_group_name: str, cluster_name: str, log_file_name: str, **kwargs: Any + ) -> _models.LogFileDownloadUrl: + """Gets a short-lived signed URL for downloading a captured log file. The signed URL is returned + only by this action so routine resource GET and LIST responses do not expose bearer + credentials. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param log_file_name: The name of the LogFile. Required. + :type log_file_name: str + :return: LogFileDownloadUrl. The LogFileDownloadUrl is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.LogFileDownloadUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogFileDownloadUrl] = kwargs.pop("cls", None) + + _request = build_log_files_list_download_urls_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + log_file_name=log_file_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LogFileDownloadUrl, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py index 4c01d651cb25..7496469b0b20 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py @@ -14,135 +14,349 @@ from ._models import ( # type: ignore + ActivateChangeDataCaptureIdentityRequest, + ActivateChangeDataCaptureIdentityResult, + Authentication, + AuthenticationProperties, + BackupProperties, + BackupPropertiesForPatchUpdate, + Capability, + CapabilityProperties, + ChangeDataCaptureCapability, + ChangeDataCaptureCapabilityForPatchUpdate, + ChangeDataCaptureCapabilityProperties, + ChangeDataCaptureCapabilityPropertiesForPatchUpdate, + ChangeDataCaptureConfiguration, + ChangeDataCaptureConfigurationForPatchUpdate, + ChangeDataCaptureConfigurationProperties, + ChangeDataCaptureConfigurationPropertiesForPatchUpdate, + ChangeDataCaptureDestination, + ChangeDataCaptureDestinationDetails, + ChangeDataCaptureDestinationForPatchUpdate, + ChangeDataCaptureDestinationProperties, + ChangeDataCaptureDestinationPropertiesForPatchUpdate, + ChangeDataCaptureExtensionStatus, + ChangeDataCaptureIdentityAssignmentProperties, + ChangeDataCapturePrerequisiteStatus, + ChangeDataCaptureReplicationStatus, + ChangeDataCaptureStatus, + ChangeDataCaptureTopologyBindingStatus, + Cluster, + ClusterCapability, + ClusterFeatureCapability, + ClusterForPatchUpdate, + ClusterProperties, + ClusterPropertiesForPatchUpdate, + ComputeGenerationCapability, + ComputeModelCapability, + ComputeProcessorCapability, + ComputeSizeCapability, + DefaultParameterGroup, + DefaultParameterGroupProperties, + Endpoint, + EndpointProperties, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, - HorizonDbAdministrator, - HorizonDbAdministratorAdd, - HorizonDbAdministratorProperties, - HorizonDbAdministratorPropertiesForAdd, - HorizonDbCluster, - HorizonDbClusterAuthConfig, - HorizonDbClusterForPatchUpdate, - HorizonDbClusterMirroring, - HorizonDbClusterParameterGroupConnectionProperties, - HorizonDbClusterProperties, - HorizonDbClusterPropertiesForPatchUpdate, - HorizonDbComputeModel, - HorizonDbFirewallRule, - HorizonDbFirewallRuleProperties, - HorizonDbParameterGroup, - HorizonDbParameterGroupConnectionProperties, - HorizonDbParameterGroupForPatchUpdate, - HorizonDbParameterGroupProperties, - HorizonDbParameterGroupPropertiesForPatchUpdate, - HorizonDbPool, - HorizonDbPoolProperties, - HorizonDbPrivateLinkResource, - HorizonDbReplica, - HorizonDbReplicaForPatchUpdate, - HorizonDbReplicaProperties, - HorizonDbReplicaPropertiesForPatchUpdate, - ManagedServiceIdentity, + FabricDestinationDetails, + FirewallRule, + FirewallRuleProperties, + HorizonDbClusterDataEncryption, + HorizonDbClusterDataEncryptionForPatchUpdate, + HorizonDbClusterManagedServiceIdentity, + IdentityAssignment, + IdentityValidationStatus, + LogCaptureConfiguration, + LogCaptureConfigurationForPatchUpdate, + LogCaptureConfigurationProperties, + LogCaptureConfigurationPropertiesForPatchUpdate, + LogFile, + LogFileDownloadUrl, + LogFileProperties, + MaintenanceEvent, + MaintenanceEventActionResponse, + MaintenanceEventProperties, + MaintenanceEventRescheduleRequest, + MicrosoftEntraAdministrator, + MicrosoftEntraAdministratorAdd, + MicrosoftEntraAdministratorProperties, + MicrosoftEntraAdministratorPropertiesForAdd, + MicrosoftEntraAuthentication, + MicrosoftEntraAuthenticationForPatchUpdate, + MicrosoftEntraAuthenticationProperties, + MicrosoftEntraAuthenticationPropertiesForPatchUpdate, Network, + NetworkForPatchUpdate, + Node, + NodeProperties, Operation, OperationDisplay, + ParameterGroup, + ParameterGroupConnectionProperties, + ParameterGroupForPatchUpdate, + ParameterGroupProperties, + ParameterGroupPropertiesForPatchUpdate, ParameterProperties, + PasswordAuthentication, + PasswordAuthenticationForPatchUpdate, + PasswordAuthenticationProperties, + PasswordAuthenticationPropertiesForPatchUpdate, + Pool, + PoolCapability, + PoolComputeModel, + PoolComputeModelForPatchUpdate, + PoolFeatureCapability, + PoolForPatchUpdate, + PoolHighAvailability, + PoolHighAvailabilityPatch, + PoolParameterGroupReference, + PoolParameterGroupReferenceForPatchUpdate, + PoolProperties, + PoolPropertiesForPatchUpdate, + PostgreSqlVersionCapability, PrivateEndpoint, PrivateEndpointConnectionProperties, PrivateEndpointConnectionResource, + PrivateLinkResource, PrivateLinkResourceProperties, PrivateLinkServiceConnectionState, + ProvisionedComputeModelCapability, ProxyResource, + ReadWritePoolProperties, Resource, + ScheduledMaintenanceProperties, + ScheduledMaintenancePropertiesForPatchUpdate, SystemData, + SystemScheduledMaintenanceProperties, TrackedResource, UserAssignedIdentity, ) from ._enums import ( # type: ignore ActionType, + AiModelManagementStatus, + AuthenticationName, AuthenticationState, - CreateModeCluster, - CreateModePool, + ChangeDataCaptureDesiredState, + ChangeDataCaptureDestinationEffectiveState, + ChangeDataCaptureDestinationType, + ChangeDataCaptureEffectiveState, + ChangeDataCaptureEngineConfigurationState, + ChangeDataCaptureExtensionState, + ChangeDataCaptureIdentityActivationState, + ChangeDataCaptureIdentityAssignmentState, + ChangeDataCaptureIdentityValidationState, + ChangeDataCaptureProtocol, + ChangeDataCaptureReadWriteEndpointState, + ChangeDataCaptureReplicationArchitecture, + ChangeDataCaptureReplicationState, + ChangeDataCaptureTopologyBindingState, + ChangeDataCaptureUsageProfile, + ClusterCreateMode, + ClusterState, + ComputeProcessorType, CreatedByType, - HorizonDbComputeModelType, - ManagedServiceIdentityType, + EndpointRole, + EndpointScope, + GeoRedundancyState, + HorizonDbClusterDataEncryptionType, + HorizonDbClusterEncryptionKeyStatus, + HorizonDbClusterIdentityType, + LogCaptureState, + LogFileType, + MaintenanceEventStatus, + MaintenanceType, + MicrosoftEntraAuthenticationName, + NodeRole, Origin, + ParameterApplyMethod, + ParameterGroupSyncStatus, + ParameterValueSource, + PasswordAuthenticationName, + PoolComputeModelType, + PoolHighAvailabilityMode, + PoolState, + PostgreSqlCapabilityVersion, + PostgreSqlVersion, PrincipalTypes, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, ProvisioningState, PublicNetworkAccessState, - ReplicaRole, - State, - ZonePlacementPolicy, + ScheduledMaintenanceManagementType, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ActivateChangeDataCaptureIdentityRequest", + "ActivateChangeDataCaptureIdentityResult", + "Authentication", + "AuthenticationProperties", + "BackupProperties", + "BackupPropertiesForPatchUpdate", + "Capability", + "CapabilityProperties", + "ChangeDataCaptureCapability", + "ChangeDataCaptureCapabilityForPatchUpdate", + "ChangeDataCaptureCapabilityProperties", + "ChangeDataCaptureCapabilityPropertiesForPatchUpdate", + "ChangeDataCaptureConfiguration", + "ChangeDataCaptureConfigurationForPatchUpdate", + "ChangeDataCaptureConfigurationProperties", + "ChangeDataCaptureConfigurationPropertiesForPatchUpdate", + "ChangeDataCaptureDestination", + "ChangeDataCaptureDestinationDetails", + "ChangeDataCaptureDestinationForPatchUpdate", + "ChangeDataCaptureDestinationProperties", + "ChangeDataCaptureDestinationPropertiesForPatchUpdate", + "ChangeDataCaptureExtensionStatus", + "ChangeDataCaptureIdentityAssignmentProperties", + "ChangeDataCapturePrerequisiteStatus", + "ChangeDataCaptureReplicationStatus", + "ChangeDataCaptureStatus", + "ChangeDataCaptureTopologyBindingStatus", + "Cluster", + "ClusterCapability", + "ClusterFeatureCapability", + "ClusterForPatchUpdate", + "ClusterProperties", + "ClusterPropertiesForPatchUpdate", + "ComputeGenerationCapability", + "ComputeModelCapability", + "ComputeProcessorCapability", + "ComputeSizeCapability", + "DefaultParameterGroup", + "DefaultParameterGroupProperties", + "Endpoint", + "EndpointProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", - "HorizonDbAdministrator", - "HorizonDbAdministratorAdd", - "HorizonDbAdministratorProperties", - "HorizonDbAdministratorPropertiesForAdd", - "HorizonDbCluster", - "HorizonDbClusterAuthConfig", - "HorizonDbClusterForPatchUpdate", - "HorizonDbClusterMirroring", - "HorizonDbClusterParameterGroupConnectionProperties", - "HorizonDbClusterProperties", - "HorizonDbClusterPropertiesForPatchUpdate", - "HorizonDbComputeModel", - "HorizonDbFirewallRule", - "HorizonDbFirewallRuleProperties", - "HorizonDbParameterGroup", - "HorizonDbParameterGroupConnectionProperties", - "HorizonDbParameterGroupForPatchUpdate", - "HorizonDbParameterGroupProperties", - "HorizonDbParameterGroupPropertiesForPatchUpdate", - "HorizonDbPool", - "HorizonDbPoolProperties", - "HorizonDbPrivateLinkResource", - "HorizonDbReplica", - "HorizonDbReplicaForPatchUpdate", - "HorizonDbReplicaProperties", - "HorizonDbReplicaPropertiesForPatchUpdate", - "ManagedServiceIdentity", + "FabricDestinationDetails", + "FirewallRule", + "FirewallRuleProperties", + "HorizonDbClusterDataEncryption", + "HorizonDbClusterDataEncryptionForPatchUpdate", + "HorizonDbClusterManagedServiceIdentity", + "IdentityAssignment", + "IdentityValidationStatus", + "LogCaptureConfiguration", + "LogCaptureConfigurationForPatchUpdate", + "LogCaptureConfigurationProperties", + "LogCaptureConfigurationPropertiesForPatchUpdate", + "LogFile", + "LogFileDownloadUrl", + "LogFileProperties", + "MaintenanceEvent", + "MaintenanceEventActionResponse", + "MaintenanceEventProperties", + "MaintenanceEventRescheduleRequest", + "MicrosoftEntraAdministrator", + "MicrosoftEntraAdministratorAdd", + "MicrosoftEntraAdministratorProperties", + "MicrosoftEntraAdministratorPropertiesForAdd", + "MicrosoftEntraAuthentication", + "MicrosoftEntraAuthenticationForPatchUpdate", + "MicrosoftEntraAuthenticationProperties", + "MicrosoftEntraAuthenticationPropertiesForPatchUpdate", "Network", + "NetworkForPatchUpdate", + "Node", + "NodeProperties", "Operation", "OperationDisplay", + "ParameterGroup", + "ParameterGroupConnectionProperties", + "ParameterGroupForPatchUpdate", + "ParameterGroupProperties", + "ParameterGroupPropertiesForPatchUpdate", "ParameterProperties", + "PasswordAuthentication", + "PasswordAuthenticationForPatchUpdate", + "PasswordAuthenticationProperties", + "PasswordAuthenticationPropertiesForPatchUpdate", + "Pool", + "PoolCapability", + "PoolComputeModel", + "PoolComputeModelForPatchUpdate", + "PoolFeatureCapability", + "PoolForPatchUpdate", + "PoolHighAvailability", + "PoolHighAvailabilityPatch", + "PoolParameterGroupReference", + "PoolParameterGroupReferenceForPatchUpdate", + "PoolProperties", + "PoolPropertiesForPatchUpdate", + "PostgreSqlVersionCapability", "PrivateEndpoint", "PrivateEndpointConnectionProperties", "PrivateEndpointConnectionResource", + "PrivateLinkResource", "PrivateLinkResourceProperties", "PrivateLinkServiceConnectionState", + "ProvisionedComputeModelCapability", "ProxyResource", + "ReadWritePoolProperties", "Resource", + "ScheduledMaintenanceProperties", + "ScheduledMaintenancePropertiesForPatchUpdate", "SystemData", + "SystemScheduledMaintenanceProperties", "TrackedResource", "UserAssignedIdentity", "ActionType", + "AiModelManagementStatus", + "AuthenticationName", "AuthenticationState", - "CreateModeCluster", - "CreateModePool", + "ChangeDataCaptureDesiredState", + "ChangeDataCaptureDestinationEffectiveState", + "ChangeDataCaptureDestinationType", + "ChangeDataCaptureEffectiveState", + "ChangeDataCaptureEngineConfigurationState", + "ChangeDataCaptureExtensionState", + "ChangeDataCaptureIdentityActivationState", + "ChangeDataCaptureIdentityAssignmentState", + "ChangeDataCaptureIdentityValidationState", + "ChangeDataCaptureProtocol", + "ChangeDataCaptureReadWriteEndpointState", + "ChangeDataCaptureReplicationArchitecture", + "ChangeDataCaptureReplicationState", + "ChangeDataCaptureTopologyBindingState", + "ChangeDataCaptureUsageProfile", + "ClusterCreateMode", + "ClusterState", + "ComputeProcessorType", "CreatedByType", - "HorizonDbComputeModelType", - "ManagedServiceIdentityType", + "EndpointRole", + "EndpointScope", + "GeoRedundancyState", + "HorizonDbClusterDataEncryptionType", + "HorizonDbClusterEncryptionKeyStatus", + "HorizonDbClusterIdentityType", + "LogCaptureState", + "LogFileType", + "MaintenanceEventStatus", + "MaintenanceType", + "MicrosoftEntraAuthenticationName", + "NodeRole", "Origin", + "ParameterApplyMethod", + "ParameterGroupSyncStatus", + "ParameterValueSource", + "PasswordAuthenticationName", + "PoolComputeModelType", + "PoolHighAvailabilityMode", + "PoolState", + "PostgreSqlCapabilityVersion", + "PostgreSqlVersion", "PrincipalTypes", "PrivateEndpointConnectionProvisioningState", "PrivateEndpointServiceConnectionStatus", "ProvisioningState", "PublicNetworkAccessState", - "ReplicaRole", - "State", - "ZonePlacementPolicy", + "ScheduledMaintenanceManagementType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py index eece19388040..deb832264cb9 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py @@ -11,7 +11,7 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. """ @@ -19,6 +19,24 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class AiModelManagementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The AI Model Management status for a HorizonDB cluster.""" + + ENABLED = "Enabled" + """AI Model Management is enabled.""" + DISABLED = "Disabled" + """AI Model Management is disabled.""" + + +class AuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of a service-created authentication configuration.""" + + PASSWORD_METHOD = "passwordMethod" + """PostgreSQL username-and-password authentication.""" + MICROSOFT_ENTRA = "microsoftEntra" + """Microsoft Entra authentication.""" + + class AuthenticationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if authentication state is enabled or not.""" @@ -28,6 +46,241 @@ class AuthenticationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Is disabled.""" +class ChangeDataCaptureDesiredState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The requested state of a HorizonDB change data capture capability, destination, or + configuration. + """ + + ENABLED = "Enabled" + """The resource should be enabled.""" + DISABLED = "Disabled" + """The resource should be disabled.""" + + +class ChangeDataCaptureDestinationEffectiveState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The effective state of a HorizonDB change data capture destination.""" + + WAITING_FOR_IDENTITY = "WaitingForIdentity" + """The destination is waiting for a validated active identity assignment.""" + ENABLING = "Enabling" + """The destination is being enabled.""" + ENABLED = "Enabled" + """The destination is enabled.""" + DISABLING = "Disabling" + """The destination is being disabled.""" + DISABLED = "Disabled" + """The destination is disabled.""" + DEGRADED = "Degraded" + """The destination is available with reduced functionality or impaired health.""" + FAILED = "Failed" + """The destination is not operational because reconciliation failed.""" + + +class ChangeDataCaptureDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The destination type supported by this API version.""" + + FABRIC = "Fabric" + """A Microsoft Fabric destination.""" + + +class ChangeDataCaptureEffectiveState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The effective state of a HorizonDB change data capture capability or configuration.""" + + ENABLING = "Enabling" + """The resource is being enabled.""" + ENABLED = "Enabled" + """The resource is enabled.""" + DISABLING = "Disabling" + """The resource is being disabled.""" + DISABLED = "Disabled" + """The resource is disabled.""" + DEGRADED = "Degraded" + """The resource is available with reduced functionality or impaired health.""" + FAILED = "Failed" + """The resource is not operational because reconciliation failed.""" + + +class ChangeDataCaptureEngineConfigurationState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The readiness of HorizonDB engine settings required for change data capture.""" + + READY = "Ready" + """The required engine settings are ready.""" + NOT_READY = "NotReady" + """One or more required engine settings are not ready.""" + RECONCILING = "Reconciling" + """The service is reconciling required engine settings.""" + FAILED = "Failed" + """Engine-setting reconciliation failed.""" + + +class ChangeDataCaptureExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle state of the HorizonDB change data capture extension.""" + + NOT_INSTALLED = "NotInstalled" + """The extension is not installed.""" + INSTALLING = "Installing" + """The extension is being installed.""" + READY = "Ready" + """The extension is ready.""" + UPGRADING = "Upgrading" + """The extension is being upgraded.""" + REMOVING = "Removing" + """The extension is being removed.""" + FAILED = "Failed" + """The extension operation failed.""" + + +class ChangeDataCaptureIdentityActivationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The activation state of a change data capture identity assignment.""" + + INACTIVE = "Inactive" + """The identity assignment is not active.""" + ACTIVATING = "Activating" + """The identity assignment is being activated.""" + ACTIVE = "Active" + """The identity assignment is active.""" + DEACTIVATING = "Deactivating" + """The identity assignment is being deactivated.""" + FAILED = "Failed" + """The identity activation transition failed.""" + + +class ChangeDataCaptureIdentityAssignmentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle state of a change data capture identity assignment.""" + + ASSIGNING = "Assigning" + """The identity is being assigned.""" + ASSIGNED = "Assigned" + """The identity is assigned.""" + REMOVING = "Removing" + """The identity assignment is being removed.""" + FAILED = "Failed" + """The identity assignment operation failed.""" + + +class ChangeDataCaptureIdentityValidationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The validation state of a change data capture identity assignment.""" + + NOT_STARTED = "NotStarted" + """Identity validation has not started.""" + RUNNING = "Running" + """Identity validation is running.""" + SUCCEEDED = "Succeeded" + """Identity validation succeeded.""" + FAILED = "Failed" + """Identity validation failed.""" + + +class ChangeDataCaptureProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol used to communicate with a change data capture destination.""" + + NATIVE = "Native" + """The destination's native protocol.""" + + +class ChangeDataCaptureReadWriteEndpointState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The availability of a read-write endpoint for change data capture engine mutations.""" + + READY = "Ready" + """An eligible read-write endpoint is ready.""" + UNAVAILABLE = "Unavailable" + """No eligible read-write endpoint is currently available.""" + + +class ChangeDataCaptureReplicationArchitecture(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The implementation architecture used to capture and publish changes.""" + + COMPUTE_BASED = "ComputeBased" + """Change capture runs with the HorizonDB compute layer.""" + STORAGE_BASED = "StorageBased" + """Change capture runs with the HorizonDB storage layer.""" + HYBRID = "Hybrid" + """Change capture uses both compute and storage components.""" + + +class ChangeDataCaptureReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state of a destination-owned replication session.""" + + NOT_APPLICABLE = "NotApplicable" + """A destination session does not apply to the current resource state.""" + NOT_CONNECTED = "NotConnected" + """No destination session is connected.""" + CONNECTING = "Connecting" + """A destination session is connecting.""" + REPLICATING = "Replicating" + """A destination session is replicating changes.""" + RECONNECTING = "Reconnecting" + """A destination session is reconnecting after an interruption.""" + PAUSED = "Paused" + """The destination session is paused.""" + STOPPING = "Stopping" + """The destination session is stopping.""" + DEGRADED = "Degraded" + """The destination session is operating with impaired health.""" + FAILED = "Failed" + """The destination session failed.""" + + +class ChangeDataCaptureTopologyBindingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The relationship of a change data capture configuration to the current writer topology.""" + + ACTIVE = "Active" + """The configuration belongs to the current active writer.""" + RECONCILING = "Reconciling" + """The service is reconciling the configuration after a writer change.""" + REBIND_REQUIRED = "RebindRequired" + """The destination session must bind to a replacement configuration resource ID.""" + SUPERSEDED = "Superseded" + """The configuration belongs to a former writer and has been replaced.""" + CONFLICT = "Conflict" + """Equivalent change data capture state could not be materialized without overwriting unrelated + state.""" + + +class ChangeDataCaptureUsageProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The reason that a change data capture configuration exists.""" + + MIRRORING = "Mirroring" + """The configuration publishes database changes for Microsoft Fabric Mirroring.""" + + +class ClusterCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Controls how a HorizonDB cluster PUT request is processed.""" + + CREATE = "Create" + """Process the request as a normal cluster creation.""" + POINT_IN_TIME_RESTORE = "PointInTimeRestore" + """Create the cluster from a point-in-time restore.""" + + +class ClusterState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current state of a HorizonDB cluster.""" + + READY = "Ready" + """Is ready and operational.""" + PROVISIONING = "Provisioning" + """Is provisioning.""" + DELETING = "Deleting" + """Is being deleted.""" + INACCESSIBLE = "Inaccessible" + """Is inaccessible.""" + UPDATING = "Updating" + """Is being updated.""" + + +class ComputeProcessorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The compute processor type.""" + + INTEL = "Intel" + """Intel processor.""" + AMD = "AMD" + """AMD processor.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -41,53 +294,123 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" -class CreateModeCluster(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The mode to create a new HorizonDB cluster.""" +class EndpointRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Role of the endpoint.""" - CREATE = "Create" - """Create a new cluster.""" - UPDATE = "Update" - """Update an existing cluster.""" - POINT_IN_TIME_RESTORE = "PointInTimeRestore" - """Create cluster from point-in-time restore.""" + READ_ONLY = "ReadOnly" + """The Endpoint accepts read-only traffic. This applies to Pool-scoped Endpoints and may apply to + other endpoint scenarios introduced by later API versions.""" + READ_WRITE = "ReadWrite" + """The Cluster-scoped Endpoint accepts read and write traffic.""" -class CreateModePool(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The mode to create a new HorizonDB cluster.""" +class EndpointScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The scope of a HorizonDB endpoint.""" - CREATE = "Create" - """Create a new pool.""" - UPDATE = "Update" - """Update an existing pool.""" + CLUSTER = "Cluster" + """The Endpoint is associated with its parent Cluster.""" + POOL = "Pool" + """The Endpoint is associated with a Pool under its parent Cluster and has the ReadOnly role.""" -class HorizonDbComputeModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The compute model type.""" +class GeoRedundancyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the geo-redundancy state.""" - PROVISIONED = "Provisioned" - """Provisioned compute.""" - SERVERLESS = "Serverless" - """Serverless compute.""" + ENABLED = "Enabled" + """Geo-redundancy is enabled. This value is not supported when dataEncryption.type is + AzureKeyVault.""" + DISABLED = "Disabled" + """Geo-redundancy is disabled.""" -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). +class HorizonDbClusterDataEncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of data encryption used by a HorizonDB cluster. The type is selected at cluster + creation; switching between SystemManaged and AzureKeyVault after creation is not supported. """ + SYSTEM_MANAGED = "SystemManaged" + """Data encryption is managed by Azure using platform-managed keys.""" + AZURE_KEY_VAULT = "AzureKeyVault" + """Data encryption uses customer-managed keys stored in Azure Key Vault.""" + + +class HorizonDbClusterEncryptionKeyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The validation status of a customer-managed encryption key used by a HorizonDB cluster.""" + + VALID = "Valid" + """The encryption key is valid and accessible to the configured user-assigned managed identity.""" + INVALID = "Invalid" + """The encryption key is invalid or inaccessible to the configured user-assigned managed identity.""" + + +class HorizonDbClusterIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The managed identity types supported by a HorizonDB cluster.""" + NONE = "None" - """No managed identity.""" - SYSTEM_ASSIGNED = "SystemAssigned" - """System assigned managed identity.""" + """No managed identity is assigned. Setting type to None clears all managed identity assignments.""" USER_ASSIGNED = "UserAssigned" - """User assigned managed identity.""" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - """System and user assigned managed identity.""" + """User-assigned managed identities are assigned.""" + + +class LogCaptureState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies whether HorizonDB captures log files.""" + + ENABLED = "Enabled" + """Log capture is enabled.""" + DISABLED = "Disabled" + """Log capture is disabled.""" + + +class LogFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a captured HorizonDB log file.""" + + POSTGRE_SQL_SERVER = "PostgreSqlServer" + """A PostgreSQL server log file.""" + + +class MaintenanceEventStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a maintenance event.""" + + PLANNED = "Planned" + """The maintenance event is scheduled and has not yet started.""" + IN_PROGRESS = "InProgress" + """The maintenance event is currently in progress.""" + COMPLETE = "Complete" + """The maintenance event completed successfully.""" + RESCHEDULED = "Rescheduled" + """The customer rescheduled the maintenance event.""" + CANCELED = "Canceled" + """The maintenance event was canceled, failed, or timed out.""" + + +class MaintenanceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a maintenance event.""" + + PLANNED_MAINTENANCE = "PlannedMaintenance" + """A planned maintenance event.""" + + +class MicrosoftEntraAuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of the Microsoft Entra authentication method.""" + + MICROSOFT_ENTRA = "microsoftEntra" + """Microsoft Entra authentication.""" + + +class NodeRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The role performed by a node within its HorizonDB pool.""" + + READ_WRITE = "ReadWrite" + """The node accepts read and write traffic for its cluster.""" + READ_ONLY = "ReadOnly" + """The node accepts read-only traffic.""" + UNASSIGNED = "Unassigned" + """The node is not currently assigned a read-write or read-only role.""" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". + logs UX. Default value is \"user,system\". """ USER = "user" @@ -98,17 +421,127 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the operation is initiated by a user or system.""" +class ParameterApplyMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Controls when dynamic parameter changes become effective. Static parameter changes always + become effective only after a customer-initiated pool Restart. Stop followed by Start and + scheduled maintenance do not apply pending parameter changes. + """ + + IMMEDIATE = "Immediate" + """Apply dynamic parameter changes immediately. Static parameter changes remain pending until a + customer-initiated pool Restart.""" + PENDING_REBOOT = "PendingReboot" + """Keep dynamic and static parameter changes pending until a customer-initiated pool Restart. Stop + followed by Start and scheduled maintenance do not apply them.""" + + +class ParameterGroupSyncStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates synchronization status between a HorizonDB resource and its parameter group.""" + + APPLYING = "Applying" + """Parameter updates are currently being applied.""" + IN_SYNC = "InSync" + """Parameter values are synchronized and up to date.""" + FAILED_TO_APPLY = "FailedToApply" + """Applying parameter updates failed.""" + PENDING_REBOOT = "PendingReboot" + """Parameter updates are pending and require a customer-initiated pool Restart to take effect. + Stop followed by Start and scheduled maintenance preserve this status.""" + + +class ParameterValueSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The source of the effective value assigned to a HorizonDB parameter.""" + + SYSTEM_DEFAULT = "SystemDefault" + """The effective value is the system-defined default.""" + USER_OVERRIDE = "UserOverride" + """The effective value was explicitly supplied by the user, even when it equals the system-defined + default value.""" + + +class PasswordAuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of the PostgreSQL username-and-password authentication method.""" + + PASSWORD_METHOD = "passwordMethod" + """PostgreSQL username-and-password authentication.""" + + +class PoolComputeModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The compute model type.""" + + PROVISIONED = "Provisioned" + """Provisioned compute model.""" + + +class PoolHighAvailabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The high-availability mode requested for a HorizonDB pool.""" + + DISABLED = "Disabled" + """High availability is disabled. This mode is valid only when nodeCount is 1.""" + ANY_ZONE = "AnyZone" + """The service may allocate nodes in the same availability zone or across availability zones. This + mode is valid only when nodeCount is 2 through 16.""" + ZONE_REDUNDANT = "ZoneRedundant" + """The service must allocate nodes across availability zones. This mode is valid only when + nodeCount is 2 through 16.""" + + +class PoolState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current state of a HorizonDB pool.""" + + READY = "Ready" + """Is ready and operational.""" + PROVISIONING = "Provisioning" + """Is provisioning.""" + DELETING = "Deleting" + """Is being deleted.""" + INACCESSIBLE = "Inaccessible" + """Is inaccessible.""" + UPDATING = "Updating" + """Is being updated.""" + STARTING = "Starting" + """Is starting up.""" + RESTARTING = "Restarting" + """Is restarting.""" + STOPPING = "Stopping" + """Is stopping.""" + STOPPED = "Stopped" + """Is stopped.""" + + +class PostgreSqlCapabilityVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A PostgreSQL major version advertised by the HorizonDB capabilities API.""" + + V17 = "17" + """PostgreSQL major version 17.""" + V18 = "18" + """PostgreSQL major version 18.""" + + +class PostgreSqlVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A PostgreSQL major version supported by HorizonDB. API version 2026-10-01-preview accepts 17 + and 18. Future API versions may add named values, and clients must tolerate unknown values + returned by the service. + """ + + V17 = "17" + """PostgreSQL major version 17.""" + V18 = "18" + """PostgreSQL major version 18.""" + + class PrincipalTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the Entra ID principal.""" + """The type of Microsoft Entra principal mapped to a PostgreSQL role.""" UNKNOWN = "Unknown" - """Unknown or unrecognized type (internal only, not accepted in requests).""" + """An unknown or unrecognized type. This value is for internal use and is not accepted in + requests.""" USER = "User" - """An Entra ID user account (UPN-based principal).""" + """A Microsoft Entra ID user account.""" GROUP = "Group" - """An Entra ID security group. All members of the group inherit admin privileges.""" + """A Microsoft Entra ID security group. All members of the group inherit administrator privileges.""" SERVICE_PRINCIPAL = "ServicePrincipal" - """An Entra ID application / service principal (used for automated workloads).""" + """A Microsoft Entra ID application or service principal used for automated workloads.""" class PrivateEndpointConnectionProvisioningState( # pylint: disable=name-too-long @@ -141,15 +574,15 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The provisioning state.""" SUCCEEDED = "Succeeded" - """Provisioning completed successfully.""" + """Resource has been created.""" FAILED = "Failed" - """Provisioning failed.""" + """Resource creation failed.""" CANCELED = "Canceled" - """Provisioning was canceled.""" + """Resource creation was canceled.""" IN_PROGRESS = "InProgress" - """Provisioning is in progress.""" + """The HorizonDB resource operation is actively running.""" PROVISIONING = "Provisioning" - """Provisioning is in progress.""" + """The HorizonDB resource is still provisioning.""" class PublicNetworkAccessState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -161,44 +594,8 @@ class PublicNetworkAccessState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Public network access is disabled.""" -class ReplicaRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Role of the replica.""" - - READ = "Read" - """Read-only replica.""" - READ_WRITE = "ReadWrite" - """ReadWrite replica.""" - - -class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current states.""" - - READY = "Ready" - """Is ready and operational.""" - DROPPING = "Dropping" - """Is being dropped/deleted.""" - DISABLED = "Disabled" - """Is disabled.""" - STARTING = "Starting" - """Is starting up.""" - STOPPING = "Stopping" - """Is stopping.""" - STOPPED = "Stopped" - """Is stopped.""" - UPDATING = "Updating" - """Is being updated.""" - HEALTHY = "Healthy" - """Is healthy.""" - SUCCEEDED = "Succeeded" - """Is succeeded.""" - UPGRADING = "Upgrading" - """Is upgrading.""" - - -class ZonePlacementPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The zone redundancy option for the cluster.""" +class ScheduledMaintenanceManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies who manages scheduled maintenance for a HorizonDB pool.""" - STRICT = "Strict" - """Enforce zonal redundancy.""" - BEST_EFFORT = "BestEffort" - """Best-effort placement (default).""" + SYSTEM = "System" + """Scheduled maintenance is managed by the system.""" diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py index 5cb1ce4f50d0..b508133eab90 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py @@ -9,73 +9,48 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload -from .._utils.model_base import Model as _Model, rest_field +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ._enums import ( + ChangeDataCaptureDestinationType, + ChangeDataCaptureProtocol, + PoolComputeModelType, + ScheduledMaintenanceManagementType, +) if TYPE_CHECKING: from .. import models as _models -class ErrorAdditionalInfo(_Model): - """The resource management error additional info. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - type: Optional[str] = rest_field(visibility=["read"]) - """The additional info type.""" - info: Optional[Any] = rest_field(visibility=["read"]) - """The additional info.""" - - -class ErrorDetail(_Model): - """The error detail. +class ActivateChangeDataCaptureIdentityRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request to activate an identity assignment for a change data capture destination. - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.horizondb.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.horizondb.models.ErrorAdditionalInfo] + :ivar identity_assignment_resource_id: The resource ID of an inactive, successfully validated + identity assignment under the destination receiving the action. Required. + :vartype identity_assignment_resource_id: str + :ivar drain_existing_sessions: Whether existing destination sessions should drain before the + identity cutover. The default is false. + :vartype drain_existing_sessions: bool """ - code: Optional[str] = rest_field(visibility=["read"]) - """The error code.""" - message: Optional[str] = rest_field(visibility=["read"]) - """The error message.""" - target: Optional[str] = rest_field(visibility=["read"]) - """The error target.""" - details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """The error details.""" - additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( - name="additionalInfo", visibility=["read"] + identity_assignment_resource_id: str = rest_field( + name="identityAssignmentResourceId", visibility=["read", "create", "update", "delete", "query"] ) - """The error additional info.""" - - -class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Error response. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.horizondb.models.ErrorDetail - """ - - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error object.""" + """The resource ID of an inactive, successfully validated identity assignment under the + destination receiving the action. Required.""" + drain_existing_sessions: Optional[bool] = rest_field( + name="drainExistingSessions", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether existing destination sessions should drain before the identity cutover. The default is + false.""" @overload def __init__( self, *, - error: Optional["_models.ErrorDetail"] = None, + identity_assignment_resource_id: str, + drain_existing_sessions: Optional[bool] = None, ) -> None: ... @overload @@ -89,6 +64,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ActivateChangeDataCaptureIdentityResult(_Model): # pylint: disable=docstring-missing-param + """The completed result of activating a change data capture destination identity. + + :ivar status: The completed activation status. Required. Default value is "Succeeded". + :vartype status: str + :ivar target_identity_assignment_resource_id: The resource ID of the newly active identity + assignment. Required. + :vartype target_identity_assignment_resource_id: str + :ivar previous_identity_assignment_resource_id: The resource ID of the previously active + identity assignment, when one existed. + :vartype previous_identity_assignment_resource_id: str + """ + + status: Literal["Succeeded"] = rest_field(visibility=["read"]) + """The completed activation status. Required. Default value is \"Succeeded\".""" + target_identity_assignment_resource_id: str = rest_field( + name="targetIdentityAssignmentResourceId", visibility=["read"] + ) + """The resource ID of the newly active identity assignment. Required.""" + previous_identity_assignment_resource_id: Optional[str] = rest_field( + name="previousIdentityAssignmentResourceId", visibility=["read"] + ) + """The resource ID of the previously active identity assignment, when one existed.""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.status: Literal["Succeeded"] = "Succeeded" + + class Resource(_Model): """Resource. @@ -134,8 +138,9 @@ class ProxyResource(Resource): """ -class HorizonDbAdministrator(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents an Entra ID administrator configured on a HorizonDB cluster. +class Authentication(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A service-created authentication configuration returned by the authentications collection. The + resource name is passwordMethod or microsoftEntra. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -149,10 +154,10 @@ class HorizonDbAdministrator(ProxyResource): # pylint: disable=docstring-keywor information. :vartype system_data: ~azure.mgmt.horizondb.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbAdministratorProperties + :vartype properties: ~azure.mgmt.horizondb.models.AuthenticationProperties """ - properties: Optional["_models.HorizonDbAdministratorProperties"] = rest_field( + properties: Optional["_models.AuthenticationProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" @@ -161,7 +166,7 @@ class HorizonDbAdministrator(ProxyResource): # pylint: disable=docstring-keywor def __init__( self, *, - properties: Optional["_models.HorizonDbAdministratorProperties"] = None, + properties: Optional["_models.AuthenticationProperties"] = None, ) -> None: ... @overload @@ -175,85 +180,60 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbAdministratorAdd(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The request body for adding a HorizonDB administrator. +class AuthenticationProperties(_Model): + """Common read-only properties of a service-created authentication configuration. - :ivar properties: The properties for adding a HorizonDB administrator. Required. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbAdministratorPropertiesForAdd + :ivar state: The state of the authentication configuration. Required. Known values are: + "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.AuthenticationState + :ivar provisioning_state: The provisioning state of the authentication configuration. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState """ - properties: "_models.HorizonDbAdministratorPropertiesForAdd" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + state: Union[str, "_models.AuthenticationState"] = rest_field(visibility=["read"]) + """The state of the authentication configuration. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] ) - """The properties for adding a HorizonDB administrator. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.HorizonDbAdministratorPropertiesForAdd", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class HorizonDbAdministratorProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB administrator. - - :ivar principal_name: The display name or UPN of the Entra ID principal. For users, typically - the User Principal Name (e.g., `admin@contoso.com `_). For groups, - the group display name. For service principals, the application display name. Required. - :vartype principal_name: str - :ivar principal_type: The type of the Entra ID principal. Required. Known values are: - "Unknown", "User", "Group", and "ServicePrincipal". - :vartype principal_type: str or ~azure.mgmt.horizondb.models.PrincipalTypes - :ivar object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). On PUT - requests, this value comes from the URI path parameter. - :vartype object_id: str - :ivar tenant_id: The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the - tenant of the subscription. - :vartype tenant_id: str - :ivar provisioning_state: The provisioning state of the administrator. Known values are: - "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". - :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + """The provisioning state of the authentication configuration. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + +class BackupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Backup configuration properties for a HorizonDB cluster. + + :ivar geo_redundancy: The geo-redundancy state. Geo-redundant backup is not supported when + dataEncryption.type is AzureKeyVault. Required. Known values are: "Enabled" and "Disabled". + :vartype geo_redundancy: str or ~azure.mgmt.horizondb.models.GeoRedundancyState + :ivar retention_days: The number of days that automatic backups are retained. The service + defaults to 7 days when this property is omitted. + :vartype retention_days: int + :ivar earliest_restore_point_utc: The earliest point in time, in UTC, to which the cluster can + currently be restored. + :vartype earliest_restore_point_utc: ~datetime.datetime """ - principal_name: str = rest_field(name="principalName", visibility=["read", "create"]) - """The display name or UPN of the Entra ID principal. For users, typically the User Principal Name - (e.g., `admin@contoso.com `_). For groups, the group display name. - For service principals, the application display name. Required.""" - principal_type: Union[str, "_models.PrincipalTypes"] = rest_field( - name="principalType", visibility=["read", "create"] + geo_redundancy: Union[str, "_models.GeoRedundancyState"] = rest_field( + name="geoRedundancy", visibility=["read", "create"] ) - """The type of the Entra ID principal. Required. Known values are: \"Unknown\", \"User\", - \"Group\", and \"ServicePrincipal\".""" - object_id: Optional[str] = rest_field(name="objectId", visibility=["read"]) - """The Entra ID object identifier of the principal (an RFC 4122 GUID). On PUT requests, this value - comes from the URI path parameter.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create"]) - """The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the tenant of the - subscription.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + """The geo-redundancy state. Geo-redundant backup is not supported when dataEncryption.type is + AzureKeyVault. Required. Known values are: \"Enabled\" and \"Disabled\".""" + retention_days: Optional[int] = rest_field(name="retentionDays", visibility=["read", "create", "update"]) + """The number of days that automatic backups are retained. The service defaults to 7 days when + this property is omitted.""" + earliest_restore_point_utc: Optional[datetime.datetime] = rest_field( + name="earliestRestorePointUtc", visibility=["read"], format="rfc3339" ) - """The provisioning state of the administrator. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" + """The earliest point in time, in UTC, to which the cluster can currently be restored.""" @overload def __init__( self, *, - principal_name: str, - principal_type: Union[str, "_models.PrincipalTypes"], - tenant_id: Optional[str] = None, + geo_redundancy: Union[str, "_models.GeoRedundancyState"], + retention_days: Optional[int] = None, ) -> None: ... @overload @@ -267,41 +247,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbAdministratorPropertiesForAdd(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties for adding a HorizonDB administrator. +class BackupPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Backup configuration properties for updating a HorizonDB cluster. - :ivar principal_name: The display name or UPN of the Entra ID principal. For users, typically - the User Principal Name (e.g., `admin@contoso.com `_). For groups, - the group display name. For service principals, the application display name. Required. - :vartype principal_name: str - :ivar principal_type: The type of the Entra ID principal. Required. Known values are: - "Unknown", "User", "Group", and "ServicePrincipal". - :vartype principal_type: str or ~azure.mgmt.horizondb.models.PrincipalTypes - :ivar tenant_id: The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the - tenant of the subscription. - :vartype tenant_id: str + :ivar retention_days: The number of days that automatic backups are retained. + :vartype retention_days: int """ - principal_name: str = rest_field(name="principalName", visibility=["read", "create", "update", "delete", "query"]) - """The display name or UPN of the Entra ID principal. For users, typically the User Principal Name - (e.g., `admin@contoso.com `_). For groups, the group display name. - For service principals, the application display name. Required.""" - principal_type: Union[str, "_models.PrincipalTypes"] = rest_field( - name="principalType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of the Entra ID principal. Required. Known values are: \"Unknown\", \"User\", - \"Group\", and \"ServicePrincipal\".""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the tenant of the - subscription.""" + retention_days: Optional[int] = rest_field(name="retentionDays", visibility=["update"]) + """The number of days that automatic backups are retained.""" @overload def __init__( self, *, - principal_name: str, - principal_type: Union[str, "_models.PrincipalTypes"], - tenant_id: Optional[str] = None, + retention_days: Optional[int] = None, ) -> None: ... @overload @@ -315,8 +275,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tracked Resource. +class Capability(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The singleton HorizonDB capability catalog entry available to a subscription in a location. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -329,23 +289,20 @@ class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-mat :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.horizondb.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.CapabilityProperties """ - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" + properties: Optional["_models.CapabilityProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" @overload def __init__( self, *, - location: str, - tags: Optional[dict[str, str]] = None, + properties: Optional["_models.CapabilityProperties"] = None, ) -> None: ... @overload @@ -359,8 +316,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbCluster(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the HorizonDB cluster. +class CapabilityProperties(_Model): + """Properties of the HorizonDB capabilities available to a subscription in a location. + + :ivar provisioning_state: The provisioning state of the capability catalog entry. Known values + are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar cluster_capabilities: The Cluster capabilities available in the region. Required. + :vartype cluster_capabilities: ~azure.mgmt.horizondb.models.ClusterCapability + :ivar pool_capabilities: The Pool capabilities available in the region, including processor, + generation, and compute-model details. Required. + :vartype pool_capabilities: ~azure.mgmt.horizondb.models.PoolCapability + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the capability catalog entry. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + cluster_capabilities: "_models.ClusterCapability" = rest_field(name="clusterCapabilities", visibility=["read"]) + """The Cluster capabilities available in the region. Required.""" + pool_capabilities: "_models.PoolCapability" = rest_field(name="poolCapabilities", visibility=["read"]) + """The Pool capabilities available in the region, including processor, generation, and + compute-model details. Required.""" + + +class ChangeDataCaptureCapability(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The singleton change data capture capability for a HorizonDB cluster. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -373,33 +355,30 @@ class HorizonDbCluster(TrackedResource): # pylint: disable=docstring-keyword-sh :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.horizondb.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbClusterProperties - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.horizondb.models.ManagedServiceIdentity + :vartype properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str """ - properties: Optional["_models.HorizonDbClusterProperties"] = rest_field( + properties: Optional["_models.ChangeDataCaptureCapabilityProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" @overload def __init__( self, *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.HorizonDbClusterProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, + properties: Optional["_models.ChangeDataCaptureCapabilityProperties"] = None, ) -> None: ... @overload @@ -413,39 +392,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterAuthConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Authentication configuration for a HorizonDB cluster. +class ChangeDataCaptureCapabilityForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A sparse update request for the singleton change data capture capability. - :ivar entra_id_auth: Indicates whether Microsoft Entra ID authentication is enabled or - disabled. Known values are: "Enabled" and "Disabled". - :vartype entra_id_auth: str or ~azure.mgmt.horizondb.models.AuthenticationState - :ivar tenant_id: The Microsoft Entra tenant ID. - :vartype tenant_id: str - :ivar password_auth: Indicates whether password authentication is enabled or disabled. Known - values are: "Enabled" and "Disabled". - :vartype password_auth: str or ~azure.mgmt.horizondb.models.AuthenticationState + :ivar properties: The capability properties to update. + :vartype properties: + ~azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityPropertiesForPatchUpdate """ - entra_id_auth: Optional[Union[str, "_models.AuthenticationState"]] = rest_field( - name="entraIdAuth", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether Microsoft Entra ID authentication is enabled or disabled. Known values are: - \"Enabled\" and \"Disabled\".""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Entra tenant ID.""" - password_auth: Optional[Union[str, "_models.AuthenticationState"]] = rest_field( - name="passwordAuth", visibility=["read", "create", "update", "delete", "query"] + properties: Optional["_models.ChangeDataCaptureCapabilityPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Indicates whether password authentication is enabled or disabled. Known values are: \"Enabled\" - and \"Disabled\".""" + """The capability properties to update.""" @overload def __init__( self, *, - entra_id_auth: Optional[Union[str, "_models.AuthenticationState"]] = None, - tenant_id: Optional[str] = None, - password_auth: Optional[Union[str, "_models.AuthenticationState"]] = None, + properties: Optional["_models.ChangeDataCaptureCapabilityPropertiesForPatchUpdate"] = None, ) -> None: ... @overload @@ -459,35 +425,83 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """HorizonDB cluster for update operations. +class ChangeDataCaptureCapabilityProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of the singleton change data capture capability. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.horizondb.models.ManagedServiceIdentity - :ivar properties: The properties that can be updated for a HorizonDB cluster. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate + :ivar desired_state: The requested capability state. Required. Known values are: "Enabled" and + "Disabled". + :vartype desired_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState + :ivar effective_state: The current effective capability state. Required. Known values are: + "Enabling", "Enabled", "Disabling", "Disabled", "Degraded", and "Failed". + :vartype effective_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureEffectiveState + :ivar provisioning_state: The provisioning state of the latest capability mutation. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar auto_upgrade_extension: Whether HorizonDB may automatically upgrade the service-owned + change data capture extension within the supported compatibility policy. + :vartype auto_upgrade_extension: bool + :ivar replication_architecture: The implementation architecture currently used for change + capture. Required. Known values are: "ComputeBased", "StorageBased", and "Hybrid". + :vartype replication_architecture: str or + ~azure.mgmt.horizondb.models.ChangeDataCaptureReplicationArchitecture + :ivar extension: The installed change data capture extension and its current lifecycle state. + Required. + :vartype extension: ~azure.mgmt.horizondb.models.ChangeDataCaptureExtensionStatus + :ivar prerequisites: The current readiness of change data capture engine and read-write + endpoint prerequisites. Required. + :vartype prerequisites: ~azure.mgmt.horizondb.models.ChangeDataCapturePrerequisiteStatus + :ivar destination_count: The number of change data capture destinations under this cluster. + Required. + :vartype destination_count: int + :ivar configuration_count: The number of change data capture configurations under this cluster. + Required. + :vartype configuration_count: int + :ivar status: Customer-safe health information for the capability. Required. + :vartype status: ~azure.mgmt.horizondb.models.ChangeDataCaptureStatus """ - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + desired_state: Union[str, "_models.ChangeDataCaptureDesiredState"] = rest_field( + name="desiredState", visibility=["read", "create", "update"] ) - """The managed service identities assigned to this resource.""" - properties: Optional["_models.HorizonDbClusterPropertiesForPatchUpdate"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The requested capability state. Required. Known values are: \"Enabled\" and \"Disabled\".""" + effective_state: Union[str, "_models.ChangeDataCaptureEffectiveState"] = rest_field( + name="effectiveState", visibility=["read"] ) - """The properties that can be updated for a HorizonDB cluster.""" + """The current effective capability state. Required. Known values are: \"Enabling\", \"Enabled\", + \"Disabling\", \"Disabled\", \"Degraded\", and \"Failed\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the latest capability mutation. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + auto_upgrade_extension: Optional[bool] = rest_field( + name="autoUpgradeExtension", visibility=["read", "create", "update"] + ) + """Whether HorizonDB may automatically upgrade the service-owned change data capture extension + within the supported compatibility policy.""" + replication_architecture: Union[str, "_models.ChangeDataCaptureReplicationArchitecture"] = rest_field( + name="replicationArchitecture", visibility=["read"] + ) + """The implementation architecture currently used for change capture. Required. Known values are: + \"ComputeBased\", \"StorageBased\", and \"Hybrid\".""" + extension: "_models.ChangeDataCaptureExtensionStatus" = rest_field(visibility=["read"]) + """The installed change data capture extension and its current lifecycle state. Required.""" + prerequisites: "_models.ChangeDataCapturePrerequisiteStatus" = rest_field(visibility=["read"]) + """The current readiness of change data capture engine and read-write endpoint prerequisites. + Required.""" + destination_count: int = rest_field(name="destinationCount", visibility=["read"]) + """The number of change data capture destinations under this cluster. Required.""" + configuration_count: int = rest_field(name="configurationCount", visibility=["read"]) + """The number of change data capture configurations under this cluster. Required.""" + status: "_models.ChangeDataCaptureStatus" = rest_field(visibility=["read"]) + """Customer-safe health information for the capability. Required.""" @overload def __init__( self, *, - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - properties: Optional["_models.HorizonDbClusterPropertiesForPatchUpdate"] = None, + desired_state: Union[str, "_models.ChangeDataCaptureDesiredState"], + auto_upgrade_extension: Optional[bool] = None, ) -> None: ... @overload @@ -501,31 +515,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterMirroring(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Mirroring configuration for a HorizonDB cluster. - - :ivar database_names: The names of the databases to mirror. - :vartype database_names: list[str] - :ivar user_assigned_identity_id: The resource ID of the user-assigned managed identity used for - mirroring. - :vartype user_assigned_identity_id: str +class ChangeDataCaptureCapabilityPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for updating the singleton change data capture capability. Omitted properties + preserve their current values. + + :ivar desired_state: The requested capability state. Known values are: "Enabled" and + "Disabled". + :vartype desired_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState + :ivar auto_upgrade_extension: Whether HorizonDB may automatically upgrade the service-owned + change data capture extension within the supported compatibility policy. + :vartype auto_upgrade_extension: bool """ - database_names: Optional[list[str]] = rest_field( - name="databaseNames", visibility=["read", "create", "update", "delete", "query"] - ) - """The names of the databases to mirror.""" - user_assigned_identity_id: Optional[str] = rest_field( - name="userAssignedIdentityId", visibility=["read", "create", "update", "delete", "query"] + desired_state: Optional[Union[str, "_models.ChangeDataCaptureDesiredState"]] = rest_field( + name="desiredState", visibility=["update"] ) - """The resource ID of the user-assigned managed identity used for mirroring.""" + """The requested capability state. Known values are: \"Enabled\" and \"Disabled\".""" + auto_upgrade_extension: Optional[bool] = rest_field(name="autoUpgradeExtension", visibility=["update"]) + """Whether HorizonDB may automatically upgrade the service-owned change data capture extension + within the supported compatibility policy.""" @overload def __init__( self, *, - database_names: Optional[list[str]] = None, - user_assigned_identity_id: Optional[str] = None, + desired_state: Optional[Union[str, "_models.ChangeDataCaptureDesiredState"]] = None, + auto_upgrade_extension: Optional[bool] = None, ) -> None: ... @overload @@ -539,32 +556,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterParameterGroupConnectionProperties( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Connection information for HorizonDB parameter group. +class ChangeDataCaptureConfiguration(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A HorizonDB database enrollment for Microsoft Fabric Mirroring. - :ivar id: The resource ID of the connected parameter group. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar sync_status: Indication of if parameter group is applied on HorizonDB resource. - :vartype sync_status: str - :ivar apply_immediately: Indicates whether the parameters should be applied immediately. - :vartype apply_immediately: bool + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str """ - id: Optional[str] = rest_field(visibility=["read", "update"]) - """The resource ID of the connected parameter group.""" - sync_status: Optional[str] = rest_field(name="syncStatus", visibility=["read"]) - """Indication of if parameter group is applied on HorizonDB resource.""" - apply_immediately: Optional[bool] = rest_field(name="applyImmediately", visibility=["read", "update"]) - """Indicates whether the parameters should be applied immediately.""" + properties: Optional["_models.ChangeDataCaptureConfigurationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" @overload def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - apply_immediately: Optional[bool] = None, + properties: Optional["_models.ChangeDataCaptureConfigurationProperties"] = None, ) -> None: ... @overload @@ -578,144 +607,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB cluster. +class ChangeDataCaptureConfigurationForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A sparse update request for a change data capture configuration. - :ivar administrator_login: The administrator login name. Required. - :vartype administrator_login: str - :ivar administrator_login_password: The administrator login password. - :vartype administrator_login_password: str - :ivar version: The version of the HorizonDB cluster. - :vartype version: str - :ivar create_mode: The mode to create a new HorizonDB cluster. Known values are: "Create", - "Update", and "PointInTimeRestore". - :vartype create_mode: str or ~azure.mgmt.horizondb.models.CreateModeCluster - :ivar point_in_time_utc: Restore point creation time specifying the time to restore from. - :vartype point_in_time_utc: ~datetime.datetime - :ivar source_cluster_resource_id: The source cluster resource ID for restore or replica - creation. - :vartype source_cluster_resource_id: str - :ivar pool_name: The pool name for restore or replica operations. - :vartype pool_name: str - :ivar replica_count: Number of replicas. - :vartype replica_count: int - :ivar v_cores: Number of vCores. - :vartype v_cores: int - :ivar processor_type: The processor type for the HorizonDB cluster. - :vartype processor_type: str - :ivar network: The network related info. - :vartype network: ~azure.mgmt.horizondb.models.Network - :ivar state: Current state of the cluster. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". - :vartype state: str or ~azure.mgmt.horizondb.models.State - :ivar fully_qualified_domain_name: The fully qualified domain name of the cluster. - :vartype fully_qualified_domain_name: str - :ivar readonly_endpoint: The fully qualified domain name used for readonly endpoint for the - cluster. - :vartype readonly_endpoint: str - :ivar provisioning_state: The provisioning state of the cluster. Known values are: "Succeeded", - "Failed", "Canceled", "InProgress", and "Provisioning". - :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState - :ivar zone_placement_policy: Defines how replicas are placed across availability zones. Known - values are: "Strict" and "BestEffort". - :vartype zone_placement_policy: str or ~azure.mgmt.horizondb.models.ZonePlacementPolicy - :ivar parameter_group: Defines connection to a parameter group. - :vartype parameter_group: - ~azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties - :ivar auth_config: Authentication configuration for the HorizonDB cluster. - :vartype auth_config: ~azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig - :ivar compute_model: The compute model for the cluster. - :vartype compute_model: ~azure.mgmt.horizondb.models.HorizonDbComputeModel - :ivar mirroring: Mirroring configuration for the HorizonDB cluster. - :vartype mirroring: ~azure.mgmt.horizondb.models.HorizonDbClusterMirroring + :ivar properties: The configuration properties to update. + :vartype properties: + ~azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationPropertiesForPatchUpdate """ - administrator_login: str = rest_field(name="administratorLogin", visibility=["read", "create"]) - """The administrator login name. Required.""" - administrator_login_password: Optional[str] = rest_field( - name="administratorLoginPassword", visibility=["create", "update"] - ) - """The administrator login password.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the HorizonDB cluster.""" - create_mode: Optional[Union[str, "_models.CreateModeCluster"]] = rest_field( - name="createMode", visibility=["read", "create", "update", "delete", "query"] - ) - """The mode to create a new HorizonDB cluster. Known values are: \"Create\", \"Update\", and - \"PointInTimeRestore\".""" - point_in_time_utc: Optional[datetime.datetime] = rest_field( - name="pointInTimeUTC", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Restore point creation time specifying the time to restore from.""" - source_cluster_resource_id: Optional[str] = rest_field( - name="sourceClusterResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The source cluster resource ID for restore or replica creation.""" - pool_name: Optional[str] = rest_field(name="poolName", visibility=["read", "create", "update", "delete", "query"]) - """The pool name for restore or replica operations.""" - replica_count: Optional[int] = rest_field(name="replicaCount", visibility=["read", "create"]) - """Number of replicas.""" - v_cores: Optional[int] = rest_field(name="vCores", visibility=["read", "create", "update"]) - """Number of vCores.""" - processor_type: Optional[str] = rest_field( - name="processorType", visibility=["read", "create", "update", "delete", "query"] - ) - """The processor type for the HorizonDB cluster.""" - network: Optional["_models.Network"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The network related info.""" - state: Optional[Union[str, "_models.State"]] = rest_field(visibility=["read"]) - """Current state of the cluster. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and - \"Upgrading\".""" - fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) - """The fully qualified domain name of the cluster.""" - readonly_endpoint: Optional[str] = rest_field(name="readonlyEndpoint", visibility=["read"]) - """The fully qualified domain name used for readonly endpoint for the cluster.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of the cluster. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" - zone_placement_policy: Optional[Union[str, "_models.ZonePlacementPolicy"]] = rest_field( - name="zonePlacementPolicy", visibility=["read", "create"] - ) - """Defines how replicas are placed across availability zones. Known values are: \"Strict\" and - \"BestEffort\".""" - parameter_group: Optional["_models.HorizonDbClusterParameterGroupConnectionProperties"] = rest_field( - name="parameterGroup", visibility=["read", "update"] - ) - """Defines connection to a parameter group.""" - auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = rest_field( - name="authConfig", visibility=["read", "create", "update"] - ) - """Authentication configuration for the HorizonDB cluster.""" - compute_model: Optional["_models.HorizonDbComputeModel"] = rest_field( - name="computeModel", visibility=["read", "create", "update"] + properties: Optional["_models.ChangeDataCaptureConfigurationPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The compute model for the cluster.""" - mirroring: Optional["_models.HorizonDbClusterMirroring"] = rest_field(visibility=["read", "create", "update"]) - """Mirroring configuration for the HorizonDB cluster.""" + """The configuration properties to update.""" @overload def __init__( self, *, - administrator_login: str, - administrator_login_password: Optional[str] = None, - version: Optional[str] = None, - create_mode: Optional[Union[str, "_models.CreateModeCluster"]] = None, - point_in_time_utc: Optional[datetime.datetime] = None, - source_cluster_resource_id: Optional[str] = None, - pool_name: Optional[str] = None, - replica_count: Optional[int] = None, - v_cores: Optional[int] = None, - processor_type: Optional[str] = None, - network: Optional["_models.Network"] = None, - zone_placement_policy: Optional[Union[str, "_models.ZonePlacementPolicy"]] = None, - parameter_group: Optional["_models.HorizonDbClusterParameterGroupConnectionProperties"] = None, - auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = None, - compute_model: Optional["_models.HorizonDbComputeModel"] = None, - mirroring: Optional["_models.HorizonDbClusterMirroring"] = None, + properties: Optional["_models.ChangeDataCaptureConfigurationPropertiesForPatchUpdate"] = None, ) -> None: ... @overload @@ -729,49 +640,87 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB cluster for update operations. - - :ivar administrator_login_password: The administrator login password. - :vartype administrator_login_password: str - :ivar v_cores: Number of vCores. - :vartype v_cores: int - :ivar parameter_group: Defines connection to a parameter group. - :vartype parameter_group: - ~azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties - :ivar auth_config: Authentication configuration for the HorizonDB cluster. - :vartype auth_config: ~azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig - :ivar compute_model: The compute model for the cluster. - :vartype compute_model: ~azure.mgmt.horizondb.models.HorizonDbComputeModel - :ivar mirroring: Mirroring configuration for the HorizonDB cluster. - :vartype mirroring: ~azure.mgmt.horizondb.models.HorizonDbClusterMirroring +class ChangeDataCaptureConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a Microsoft Fabric Mirroring configuration. + + :ivar database_name: The exact PostgreSQL database name enrolled in this logical stream. This + value is immutable. Required. + :vartype database_name: str + :ivar usage_profile: The immutable usage profile. API version 2026-10-01-preview accepts + Mirroring only. Required. "Mirroring" + :vartype usage_profile: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureUsageProfile + :ivar destination_resource_id: The immutable resource ID of an enabled change data capture + destination under the same cluster. Required. + :vartype destination_resource_id: str + :ivar logical_stream_id: A service-generated identifier for the logical stream, represented as + an RFC 4122 GUID. This value remains stable when a writer role moves and the service + materializes a replacement ARM resource under the new writer cluster. Required. + :vartype logical_stream_id: str + :ivar desired_state: The requested configuration state. Required. Known values are: "Enabled" + and "Disabled". + :vartype desired_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState + :ivar effective_state: The current effective configuration state. Required. Known values are: + "Enabling", "Enabled", "Disabling", "Disabled", "Degraded", and "Failed". + :vartype effective_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureEffectiveState + :ivar provisioning_state: The provisioning state of the latest configuration mutation. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar extension: The change data capture extension state for the enrolled database. Required. + :vartype extension: ~azure.mgmt.horizondb.models.ChangeDataCaptureExtensionStatus + :ivar replication: The known status of the destination-owned replication session. Required. + :vartype replication: ~azure.mgmt.horizondb.models.ChangeDataCaptureReplicationStatus + :ivar topology: The current writer-topology binding for this logical stream. Required. + :vartype topology: ~azure.mgmt.horizondb.models.ChangeDataCaptureTopologyBindingStatus + :ivar status: Customer-safe health information for the configuration. Required. + :vartype status: ~azure.mgmt.horizondb.models.ChangeDataCaptureStatus """ - administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["update"]) - """The administrator login password.""" - v_cores: Optional[int] = rest_field(name="vCores", visibility=["update"]) - """Number of vCores.""" - parameter_group: Optional["_models.HorizonDbClusterParameterGroupConnectionProperties"] = rest_field( - name="parameterGroup", visibility=["read", "create", "update", "delete", "query"] + database_name: str = rest_field(name="databaseName", visibility=["read", "create"]) + """The exact PostgreSQL database name enrolled in this logical stream. This value is immutable. + Required.""" + usage_profile: Union[str, "_models.ChangeDataCaptureUsageProfile"] = rest_field( + name="usageProfile", visibility=["read", "create"] + ) + """The immutable usage profile. API version 2026-10-01-preview accepts Mirroring only. Required. + \"Mirroring\"""" + destination_resource_id: str = rest_field(name="destinationResourceId", visibility=["read", "create"]) + """The immutable resource ID of an enabled change data capture destination under the same cluster. + Required.""" + logical_stream_id: str = rest_field(name="logicalStreamId", visibility=["read"]) + """A service-generated identifier for the logical stream, represented as an RFC 4122 GUID. This + value remains stable when a writer role moves and the service materializes a replacement ARM + resource under the new writer cluster. Required.""" + desired_state: Union[str, "_models.ChangeDataCaptureDesiredState"] = rest_field( + name="desiredState", visibility=["read", "create", "update"] + ) + """The requested configuration state. Required. Known values are: \"Enabled\" and \"Disabled\".""" + effective_state: Union[str, "_models.ChangeDataCaptureEffectiveState"] = rest_field( + name="effectiveState", visibility=["read"] ) - """Defines connection to a parameter group.""" - auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = rest_field(name="authConfig", visibility=["update"]) - """Authentication configuration for the HorizonDB cluster.""" - compute_model: Optional["_models.HorizonDbComputeModel"] = rest_field(name="computeModel", visibility=["update"]) - """The compute model for the cluster.""" - mirroring: Optional["_models.HorizonDbClusterMirroring"] = rest_field(visibility=["update"]) - """Mirroring configuration for the HorizonDB cluster.""" + """The current effective configuration state. Required. Known values are: \"Enabling\", + \"Enabled\", \"Disabling\", \"Disabled\", \"Degraded\", and \"Failed\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the latest configuration mutation. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + extension: "_models.ChangeDataCaptureExtensionStatus" = rest_field(visibility=["read"]) + """The change data capture extension state for the enrolled database. Required.""" + replication: "_models.ChangeDataCaptureReplicationStatus" = rest_field(visibility=["read"]) + """The known status of the destination-owned replication session. Required.""" + topology: "_models.ChangeDataCaptureTopologyBindingStatus" = rest_field(visibility=["read"]) + """The current writer-topology binding for this logical stream. Required.""" + status: "_models.ChangeDataCaptureStatus" = rest_field(visibility=["read"]) + """Customer-safe health information for the configuration. Required.""" @overload def __init__( self, *, - administrator_login_password: Optional[str] = None, - v_cores: Optional[int] = None, - parameter_group: Optional["_models.HorizonDbClusterParameterGroupConnectionProperties"] = None, - auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = None, - compute_model: Optional["_models.HorizonDbComputeModel"] = None, - mirroring: Optional["_models.HorizonDbClusterMirroring"] = None, + database_name: str, + usage_profile: Union[str, "_models.ChangeDataCaptureUsageProfile"], + destination_resource_id: str, + desired_state: Union[str, "_models.ChangeDataCaptureDesiredState"], ) -> None: ... @overload @@ -785,46 +734,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbComputeModel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The compute model for a HorizonDB cluster. +class ChangeDataCaptureConfigurationPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for updating a change data capture configuration. Omitted properties preserve their + current values. - :ivar type: The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values - are: "Provisioned" and "Serverless". - :vartype type: str or ~azure.mgmt.horizondb.models.HorizonDbComputeModelType - :ivar v_cores: The fixed vCore count for Provisioned compute. - :vartype v_cores: int - :ivar minv_cores: The minimum vCores for Serverless compute. Defines the lower autoscaling - bound. - :vartype minv_cores: float - :ivar maxv_cores: The maximum vCores for Serverless compute. Defines the upper autoscaling - bound. - :vartype maxv_cores: float + :ivar desired_state: The requested configuration state. Known values are: "Enabled" and + "Disabled". + :vartype desired_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState """ - type: Optional[Union[str, "_models.HorizonDbComputeModelType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values are: - \"Provisioned\" and \"Serverless\".""" - v_cores: Optional[int] = rest_field(name="vCores", visibility=["read", "create", "update", "delete", "query"]) - """The fixed vCore count for Provisioned compute.""" - minv_cores: Optional[float] = rest_field( - name="minvCores", visibility=["read", "create", "update", "delete", "query"] + desired_state: Optional[Union[str, "_models.ChangeDataCaptureDesiredState"]] = rest_field( + name="desiredState", visibility=["update"] ) - """The minimum vCores for Serverless compute. Defines the lower autoscaling bound.""" - maxv_cores: Optional[float] = rest_field( - name="maxvCores", visibility=["read", "create", "update", "delete", "query"] - ) - """The maximum vCores for Serverless compute. Defines the upper autoscaling bound.""" + """The requested configuration state. Known values are: \"Enabled\" and \"Disabled\".""" @overload def __init__( self, *, - type: Optional[Union[str, "_models.HorizonDbComputeModelType"]] = None, - v_cores: Optional[int] = None, - minv_cores: Optional[float] = None, - maxv_cores: Optional[float] = None, + desired_state: Optional[Union[str, "_models.ChangeDataCaptureDesiredState"]] = None, ) -> None: ... @overload @@ -838,8 +768,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbFirewallRule(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the HorizonDB firewall rule. +class ChangeDataCaptureDestination(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reusable Microsoft Fabric destination for HorizonDB change data capture configurations. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -853,19 +783,29 @@ class HorizonDbFirewallRule(ProxyResource): # pylint: disable=docstring-keyword information. :vartype system_data: ~azure.mgmt.horizondb.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbFirewallRuleProperties + :vartype properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str """ - properties: Optional["_models.HorizonDbFirewallRuleProperties"] = rest_field( + properties: Optional["_models.ChangeDataCaptureDestinationProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" @overload def __init__( self, *, - properties: Optional["_models.HorizonDbFirewallRuleProperties"] = None, + properties: Optional["_models.ChangeDataCaptureDestinationProperties"] = None, ) -> None: ... @overload @@ -879,39 +819,2620 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbFirewallRuleProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB firewall rule. +class ChangeDataCaptureDestinationDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Destination-specific settings discriminated by destinationType. - :ivar start_ip_address: The start IP address of the firewall rule (IPv4). Required. - :vartype start_ip_address: str - :ivar end_ip_address: The end IP address of the firewall rule (IPv4). Required. - :vartype end_ip_address: str - :ivar description: The description of the HorizonDB firewall rule. - :vartype description: str - :ivar provisioning_state: The provisioning state of the firewall rule. Known values are: - "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". - :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FabricDestinationDetails + + :ivar destination_type: The destination family. Required. "Fabric" + :vartype destination_type: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationType + :ivar protocol: The protocol used to communicate with the destination. Required. "Native" + :vartype protocol: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureProtocol + """ + + __mapping__: dict[str, _Model] = {} + destination_type: str = rest_discriminator(name="destinationType", visibility=["read", "create"]) + """The destination family. Required. \"Fabric\"""" + protocol: Union[str, "_models.ChangeDataCaptureProtocol"] = rest_field(visibility=["read", "create"]) + """The protocol used to communicate with the destination. Required. \"Native\"""" + + @overload + def __init__( + self, + *, + destination_type: str, + protocol: Union[str, "_models.ChangeDataCaptureProtocol"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChangeDataCaptureDestinationForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A sparse update request for a change data capture destination. + + :ivar properties: The destination properties to update. + :vartype properties: + ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationPropertiesForPatchUpdate + """ + + properties: Optional["_models.ChangeDataCaptureDestinationPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The destination properties to update.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ChangeDataCaptureDestinationPropertiesForPatchUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChangeDataCaptureDestinationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a Microsoft Fabric change data capture destination. + + :ivar destination: The immutable Microsoft Fabric destination settings. Resubmitting the same + values is accepted; changing them requires deleting and recreating the destination. Required. + :vartype destination: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationDetails + :ivar desired_state: The requested destination state. Required. Known values are: "Enabled" and + "Disabled". + :vartype desired_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState + :ivar effective_state: The current effective destination state. Required. Known values are: + "WaitingForIdentity", "Enabling", "Enabled", "Disabling", "Disabled", "Degraded", and "Failed". + :vartype effective_state: str or + ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationEffectiveState + :ivar provisioning_state: The provisioning state of the latest destination mutation. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar active_identity_assignment_resource_id: The resource ID of the currently active identity + assignment, if one is active. + :vartype active_identity_assignment_resource_id: str + :ivar configuration_count: The number of change data capture configurations that reference this + destination. Required. + :vartype configuration_count: int + :ivar status: Customer-safe health information for the destination. Required. + :vartype status: ~azure.mgmt.horizondb.models.ChangeDataCaptureStatus + """ + + destination: "_models.ChangeDataCaptureDestinationDetails" = rest_field(visibility=["read", "create"]) + """The immutable Microsoft Fabric destination settings. Resubmitting the same values is accepted; + changing them requires deleting and recreating the destination. Required.""" + desired_state: Union[str, "_models.ChangeDataCaptureDesiredState"] = rest_field( + name="desiredState", visibility=["read", "create", "update"] + ) + """The requested destination state. Required. Known values are: \"Enabled\" and \"Disabled\".""" + effective_state: Union[str, "_models.ChangeDataCaptureDestinationEffectiveState"] = rest_field( + name="effectiveState", visibility=["read"] + ) + """The current effective destination state. Required. Known values are: \"WaitingForIdentity\", + \"Enabling\", \"Enabled\", \"Disabling\", \"Disabled\", \"Degraded\", and \"Failed\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the latest destination mutation. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + active_identity_assignment_resource_id: Optional[str] = rest_field( + name="activeIdentityAssignmentResourceId", visibility=["read"] + ) + """The resource ID of the currently active identity assignment, if one is active.""" + configuration_count: int = rest_field(name="configurationCount", visibility=["read"]) + """The number of change data capture configurations that reference this destination. Required.""" + status: "_models.ChangeDataCaptureStatus" = rest_field(visibility=["read"]) + """Customer-safe health information for the destination. Required.""" + + @overload + def __init__( + self, + *, + destination: "_models.ChangeDataCaptureDestinationDetails", + desired_state: Union[str, "_models.ChangeDataCaptureDesiredState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChangeDataCaptureDestinationPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for updating a change data capture destination. Omitted properties preserve their + current values. + + :ivar desired_state: The requested destination state. Known values are: "Enabled" and + "Disabled". + :vartype desired_state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureDesiredState + """ + + desired_state: Optional[Union[str, "_models.ChangeDataCaptureDesiredState"]] = rest_field( + name="desiredState", visibility=["update"] + ) + """The requested destination state. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, "_models.ChangeDataCaptureDesiredState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChangeDataCaptureExtensionStatus(_Model): + """The installed HorizonDB change data capture extension and its current state. + + :ivar name: The extension name. Required. + :vartype name: str + :ivar version: The installed extension version. Required. + :vartype version: str + :ivar state: The current extension lifecycle state. Required. Known values are: "NotInstalled", + "Installing", "Ready", "Upgrading", "Removing", and "Failed". + :vartype state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureExtensionState + """ + + name: str = rest_field(visibility=["read"]) + """The extension name. Required.""" + version: str = rest_field(visibility=["read"]) + """The installed extension version. Required.""" + state: Union[str, "_models.ChangeDataCaptureExtensionState"] = rest_field(visibility=["read"]) + """The current extension lifecycle state. Required. Known values are: \"NotInstalled\", + \"Installing\", \"Ready\", \"Upgrading\", \"Removing\", and \"Failed\".""" + + +class ChangeDataCaptureIdentityAssignmentProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The properties of a change data capture identity assignment. + + :ivar identity_resource_id: The immutable resource ID of the user-assigned managed identity + selected for this destination. The ID must exactly match a key in the parent cluster's + top-level identity.userAssignedIdentities dictionary; otherwise creation is rejected. Attaching + the identity to the cluster does not grant destination access, so required role assignments + must be configured separately. Resubmitting the same value is accepted; changing it requires + deleting and recreating the assignment. Required. + :vartype identity_resource_id: str + :ivar effective_state: The current assignment lifecycle state. Required. Known values are: + "Assigning", "Assigned", "Removing", and "Failed". + :vartype effective_state: str or + ~azure.mgmt.horizondb.models.ChangeDataCaptureIdentityAssignmentState + :ivar activation_state: The current activation state within the parent destination. Required. + Known values are: "Inactive", "Activating", "Active", "Deactivating", and "Failed". + :vartype activation_state: str or + ~azure.mgmt.horizondb.models.ChangeDataCaptureIdentityActivationState + :ivar principal_id: The Microsoft Entra principal ID resolved from the user-assigned managed + identity, represented as an RFC 4122 GUID. Required. + :vartype principal_id: str + :ivar tenant_id: The Microsoft Entra tenant ID resolved from the user-assigned managed + identity, represented as an RFC 4122 GUID. Required. + :vartype tenant_id: str + :ivar provisioning_state: The provisioning state of the latest identity-assignment mutation. + Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar validation: The latest validation result for this identity assignment. Required. + :vartype validation: ~azure.mgmt.horizondb.models.IdentityValidationStatus + :ivar status: Customer-safe health information for the identity assignment. Required. + :vartype status: ~azure.mgmt.horizondb.models.ChangeDataCaptureStatus + """ + + identity_resource_id: str = rest_field(name="identityResourceId", visibility=["read", "create"]) + """The immutable resource ID of the user-assigned managed identity selected for this destination. + The ID must exactly match a key in the parent cluster's top-level + identity.userAssignedIdentities dictionary; otherwise creation is rejected. Attaching the + identity to the cluster does not grant destination access, so required role assignments must be + configured separately. Resubmitting the same value is accepted; changing it requires deleting + and recreating the assignment. Required.""" + effective_state: Union[str, "_models.ChangeDataCaptureIdentityAssignmentState"] = rest_field( + name="effectiveState", visibility=["read"] + ) + """The current assignment lifecycle state. Required. Known values are: \"Assigning\", + \"Assigned\", \"Removing\", and \"Failed\".""" + activation_state: Union[str, "_models.ChangeDataCaptureIdentityActivationState"] = rest_field( + name="activationState", visibility=["read"] + ) + """The current activation state within the parent destination. Required. Known values are: + \"Inactive\", \"Activating\", \"Active\", \"Deactivating\", and \"Failed\".""" + principal_id: str = rest_field(name="principalId", visibility=["read"]) + """The Microsoft Entra principal ID resolved from the user-assigned managed identity, represented + as an RFC 4122 GUID. Required.""" + tenant_id: str = rest_field(name="tenantId", visibility=["read"]) + """The Microsoft Entra tenant ID resolved from the user-assigned managed identity, represented as + an RFC 4122 GUID. Required.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the latest identity-assignment mutation. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + validation: "_models.IdentityValidationStatus" = rest_field(visibility=["read"]) + """The latest validation result for this identity assignment. Required.""" + status: "_models.ChangeDataCaptureStatus" = rest_field(visibility=["read"]) + """Customer-safe health information for the identity assignment. Required.""" + + @overload + def __init__( + self, + *, + identity_resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChangeDataCapturePrerequisiteStatus(_Model): + """The current readiness of prerequisites shared by change data capture configurations. + + :ivar engine_configuration_state: The readiness of the required engine configuration. Required. + Known values are: "Ready", "NotReady", "Reconciling", and "Failed". + :vartype engine_configuration_state: str or + ~azure.mgmt.horizondb.models.ChangeDataCaptureEngineConfigurationState + :ivar read_write_endpoint_state: The availability of the read-write endpoint required for + engine mutations. Required. Known values are: "Ready" and "Unavailable". + :vartype read_write_endpoint_state: str or + ~azure.mgmt.horizondb.models.ChangeDataCaptureReadWriteEndpointState + """ + + engine_configuration_state: Union[str, "_models.ChangeDataCaptureEngineConfigurationState"] = rest_field( + name="engineConfigurationState", visibility=["read"] + ) + """The readiness of the required engine configuration. Required. Known values are: \"Ready\", + \"NotReady\", \"Reconciling\", and \"Failed\".""" + read_write_endpoint_state: Union[str, "_models.ChangeDataCaptureReadWriteEndpointState"] = rest_field( + name="readWriteEndpointState", visibility=["read"] + ) + """The availability of the read-write endpoint required for engine mutations. Required. Known + values are: \"Ready\" and \"Unavailable\".""" + + +class ChangeDataCaptureReplicationStatus(_Model): + """The destination-owned replication-session status known to HorizonDB. + + :ivar state: The current replication-session state. Required. Known values are: + "NotApplicable", "NotConnected", "Connecting", "Replicating", "Reconnecting", "Paused", + "Stopping", "Degraded", and "Failed". + :vartype state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureReplicationState + :ivar external_artifact_id: An opaque identifier of a destination-owned artifact, such as a + Microsoft Fabric mirrored-database item. HorizonDB does not create, update, or delete the + identified artifact. + :vartype external_artifact_id: str + :ivar last_connected_at_utc: The date and time, in UTC, when a destination session most + recently connected. + :vartype last_connected_at_utc: ~datetime.datetime + """ + + state: Union[str, "_models.ChangeDataCaptureReplicationState"] = rest_field(visibility=["read"]) + """The current replication-session state. Required. Known values are: \"NotApplicable\", + \"NotConnected\", \"Connecting\", \"Replicating\", \"Reconnecting\", \"Paused\", \"Stopping\", + \"Degraded\", and \"Failed\".""" + external_artifact_id: Optional[str] = rest_field(name="externalArtifactId", visibility=["read"]) + """An opaque identifier of a destination-owned artifact, such as a Microsoft Fabric + mirrored-database item. HorizonDB does not create, update, or delete the identified artifact.""" + last_connected_at_utc: Optional[datetime.datetime] = rest_field( + name="lastConnectedAtUtc", visibility=["read"], format="rfc3339" + ) + """The date and time, in UTC, when a destination session most recently connected.""" + + +class ChangeDataCaptureStatus(_Model): + """Customer-safe health information for a HorizonDB change data capture resource. + + :ivar code: A stable machine-readable status code. Required. + :vartype code: str + :ivar message: A localized customer-safe description of the current status. Required. + :vartype message: str + """ + + code: str = rest_field(visibility=["read"]) + """A stable machine-readable status code. Required.""" + message: str = rest_field(visibility=["read"]) + """A localized customer-safe description of the current status. Required.""" + + +class ChangeDataCaptureTopologyBindingStatus(_Model): + """The current writer-topology binding of a change data capture configuration. + + :ivar state: The configuration's relationship to the current writer topology. Required. Known + values are: "Active", "Reconciling", "RebindRequired", "Superseded", and "Conflict". + :vartype state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureTopologyBindingState + :ivar generation: A monotonically increasing topology generation for this logical stream. + Required. + :vartype generation: int + :ivar active_cluster_resource_id: The Azure resource ID of the cluster that currently owns the + active configuration projection. Required. + :vartype active_cluster_resource_id: str + :ivar replacement_configuration_resource_id: The replacement configuration resource ID when + this projection has been superseded or requires rebinding. + :vartype replacement_configuration_resource_id: str + """ + + state: Union[str, "_models.ChangeDataCaptureTopologyBindingState"] = rest_field(visibility=["read"]) + """The configuration's relationship to the current writer topology. Required. Known values are: + \"Active\", \"Reconciling\", \"RebindRequired\", \"Superseded\", and \"Conflict\".""" + generation: int = rest_field(visibility=["read"]) + """A monotonically increasing topology generation for this logical stream. Required.""" + active_cluster_resource_id: str = rest_field(name="activeClusterResourceId", visibility=["read"]) + """The Azure resource ID of the cluster that currently owns the active configuration projection. + Required.""" + replacement_configuration_resource_id: Optional[str] = rest_field( + name="replacementConfigurationResourceId", visibility=["read"] + ) + """The replacement configuration resource ID when this projection has been superseded or requires + rebinding.""" + + +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Cluster(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.ClusterProperties + :ivar identity: The managed service identities assigned to this resource. Omitting the entire + identity property from PUT or PATCH preserves all current assignments. When provided, PUT + replaces the user-assigned identity set and PATCH merges it; null PATCH dictionary entries + remove individual identities. Setting type to None clears all assignments. + :vartype identity: ~azure.mgmt.horizondb.models.HorizonDbClusterManagedServiceIdentity + """ + + properties: Optional["_models.ClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + identity: Optional["_models.HorizonDbClusterManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource. Omitting the entire identity property + from PUT or PATCH preserves all current assignments. When provided, PUT replaces the + user-assigned identity set and PATCH merges it; null PATCH dictionary entries remove individual + identities. Setting type to None clears all assignments.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ClusterProperties"] = None, + identity: Optional["_models.HorizonDbClusterManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ClusterCapability(_Model): + """The HorizonDB Cluster capabilities available in a location. + + :ivar recommended_postgre_sql_version: The PostgreSQL major version recommended for clients to + select for HorizonDB Clusters in the region. This recommendation does not describe backend + behavior when the PostgreSQL version is omitted from a request. Required. Known values are: + "17" and "18". + :vartype recommended_postgre_sql_version: str or + ~azure.mgmt.horizondb.models.PostgreSqlCapabilityVersion + :ivar supported_postgre_sql_versions: The PostgreSQL major versions supported by Clusters in + the region. Required. + :vartype supported_postgre_sql_versions: + list[~azure.mgmt.horizondb.models.PostgreSqlVersionCapability] + :ivar supported_features: Additional Cluster features supported in the region. Required. + :vartype supported_features: list[~azure.mgmt.horizondb.models.ClusterFeatureCapability] + """ + + recommended_postgre_sql_version: Union[str, "_models.PostgreSqlCapabilityVersion"] = rest_field( + name="recommendedPostgreSqlVersion", visibility=["read"] + ) + """The PostgreSQL major version recommended for clients to select for HorizonDB Clusters in the + region. This recommendation does not describe backend behavior when the PostgreSQL version is + omitted from a request. Required. Known values are: \"17\" and \"18\".""" + supported_postgre_sql_versions: list["_models.PostgreSqlVersionCapability"] = rest_field( + name="supportedPostgreSqlVersions", visibility=["read"] + ) + """The PostgreSQL major versions supported by Clusters in the region. Required.""" + supported_features: list["_models.ClusterFeatureCapability"] = rest_field( + name="supportedFeatures", visibility=["read"] + ) + """Additional Cluster features supported in the region. Required.""" + + +class ClusterFeatureCapability(_Model): + """A HorizonDB Cluster feature supported in a location. + + :ivar name: The name of the Cluster feature. Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read"]) + """The name of the Cluster feature. Required.""" + + +class ClusterForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HorizonDB cluster for update operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. Omitting the entire + identity property from PUT or PATCH preserves all current assignments. When provided, PUT + replaces the user-assigned identity set and PATCH merges it; null PATCH dictionary entries + remove individual identities. Setting type to None clears all assignments. + :vartype identity: ~azure.mgmt.horizondb.models.HorizonDbClusterManagedServiceIdentity + :ivar properties: The properties that can be updated for a HorizonDB cluster. + :vartype properties: ~azure.mgmt.horizondb.models.ClusterPropertiesForPatchUpdate + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + identity: Optional["_models.HorizonDbClusterManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource. Omitting the entire identity property + from PUT or PATCH preserves all current assignments. When provided, PUT replaces the + user-assigned identity set and PATCH merges it; null PATCH dictionary entries remove individual + identities. Setting type to None clears all assignments.""" + properties: Optional["_models.ClusterPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties that can be updated for a HorizonDB cluster.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.HorizonDbClusterManagedServiceIdentity"] = None, + properties: Optional["_models.ClusterPropertiesForPatchUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ClusterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB cluster. + + :ivar postgre_sql_version: The PostgreSQL major version used by the HorizonDB cluster. API + version 2026-10-01-preview supports versions 17 and 18. For ordinary cluster creation, the + version is supplied in the request and is immutable after creation. For point-in-time restore, + the service obtains the version from the source backup metadata and the request must omit this + property. This API version does not support in-place PostgreSQL major-version upgrades. Known + values are: "17" and "18". + :vartype postgre_sql_version: str or ~azure.mgmt.horizondb.models.PostgreSqlVersion + :ivar creation_mode: The mode used to create the cluster. When this property is omitted while + creating a new cluster, the service records Create. PointInTimeRestore creates a new cluster + from an available backup; pointInTimeUtc and creationSourceClusterResourceId are then required, + postgreSqlVersion must be omitted because it is obtained from the backup metadata, and + creationSourceClusterLocation is required when the source and target cluster locations differ. + This property is immutable and is returned as creation provenance. On replacement, omission + preserves the recorded value, resubmitting the same value is accepted, and changing it is + rejected. Known values are: "Create" and "PointInTimeRestore". + :vartype creation_mode: str or ~azure.mgmt.horizondb.models.ClusterCreateMode + :ivar point_in_time_utc: The requested point in time, in UTC. This property is required in + every PointInTimeRestore request. For a same-location restore, the service restores the latest + backup available at or before this value. For a cross-location restore, the service requires + but ignores this value and restores the latest available backup; cross-location responses omit + this property. This property must be absent for other creation modes or when creationMode is + omitted and can only be specified during resource creation. + :vartype point_in_time_utc: ~datetime.datetime + :ivar creation_source_cluster_resource_id: The Azure resource ID of the source HorizonDB + cluster used by the selected creation mode. This property is required for PointInTimeRestore + and other source-based creation modes, and must be absent when creationMode is Create or + omitted. A source cluster does not need to have a pool to be restored, provided an available + backup exists. This immutable creation-provenance value does not change after creation. + :vartype creation_source_cluster_resource_id: str + :ivar creation_source_cluster_location: The Azure location of the source HorizonDB cluster used + for point-in-time restore. This property is optional when the source and target cluster + locations are the same. It is required when the source cluster location differs from the target + cluster location and must identify the source cluster's location. This property must be absent + for creation modes other than PointInTimeRestore or when creationMode is omitted. This + immutable creation-provenance value does not change after creation. + :vartype creation_source_cluster_location: str + :ivar network: The network configuration for the cluster. When this object is omitted, the + service defaults it to publicAccess Disabled. + :vartype network: ~azure.mgmt.horizondb.models.Network + :ivar backup: The backup configuration for the cluster. + :vartype backup: ~azure.mgmt.horizondb.models.BackupProperties + :ivar data_encryption: The data encryption configuration for the cluster. When omitted during + initial cluster creation, the service uses SystemManaged encryption. When supplied during + initial cluster creation, type is required. For PUT updates of an existing cluster, type may be + omitted; if provided, it must match the existing encryption type. The encryption type is + selected at cluster creation; switching between SystemManaged and AzureKeyVault after creation + is not supported. + :vartype data_encryption: ~azure.mgmt.horizondb.models.HorizonDbClusterDataEncryption + :ivar ai_model_management: Specifies whether AI Model Management is enabled for the cluster. + Known values are: "Enabled" and "Disabled". + :vartype ai_model_management: str or ~azure.mgmt.horizondb.models.AiModelManagementStatus + :ivar state: Current state of the cluster. Required. Known values are: "Ready", "Provisioning", + "Deleting", "Inaccessible", and "Updating". + :vartype state: str or ~azure.mgmt.horizondb.models.ClusterState + :ivar provisioning_state: The provisioning state of the cluster. Required. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar read_write_pool: The pool currently designated to host the cluster's read-write node. + Required. + :vartype read_write_pool: ~azure.mgmt.horizondb.models.ReadWritePoolProperties + """ + + postgre_sql_version: Optional[Union[str, "_models.PostgreSqlVersion"]] = rest_field( + name="postgreSqlVersion", visibility=["read", "create"] + ) + """The PostgreSQL major version used by the HorizonDB cluster. API version 2026-10-01-preview + supports versions 17 and 18. For ordinary cluster creation, the version is supplied in the + request and is immutable after creation. For point-in-time restore, the service obtains the + version from the source backup metadata and the request must omit this property. This API + version does not support in-place PostgreSQL major-version upgrades. Known values are: \"17\" + and \"18\".""" + creation_mode: Optional[Union[str, "_models.ClusterCreateMode"]] = rest_field( + name="creationMode", visibility=["read", "create"] + ) + """The mode used to create the cluster. When this property is omitted while creating a new + cluster, the service records Create. PointInTimeRestore creates a new cluster from an available + backup; pointInTimeUtc and creationSourceClusterResourceId are then required, postgreSqlVersion + must be omitted because it is obtained from the backup metadata, and + creationSourceClusterLocation is required when the source and target cluster locations differ. + This property is immutable and is returned as creation provenance. On replacement, omission + preserves the recorded value, resubmitting the same value is accepted, and changing it is + rejected. Known values are: \"Create\" and \"PointInTimeRestore\".""" + point_in_time_utc: Optional[datetime.datetime] = rest_field( + name="pointInTimeUtc", visibility=["read", "create"], format="rfc3339" + ) + """The requested point in time, in UTC. This property is required in every PointInTimeRestore + request. For a same-location restore, the service restores the latest backup available at or + before this value. For a cross-location restore, the service requires but ignores this value + and restores the latest available backup; cross-location responses omit this property. This + property must be absent for other creation modes or when creationMode is omitted and can only + be specified during resource creation.""" + creation_source_cluster_resource_id: Optional[str] = rest_field( + name="creationSourceClusterResourceId", visibility=["read", "create"] + ) + """The Azure resource ID of the source HorizonDB cluster used by the selected creation mode. This + property is required for PointInTimeRestore and other source-based creation modes, and must be + absent when creationMode is Create or omitted. A source cluster does not need to have a pool to + be restored, provided an available backup exists. This immutable creation-provenance value does + not change after creation.""" + creation_source_cluster_location: Optional[str] = rest_field( + name="creationSourceClusterLocation", visibility=["read", "create"] + ) + """The Azure location of the source HorizonDB cluster used for point-in-time restore. This + property is optional when the source and target cluster locations are the same. It is required + when the source cluster location differs from the target cluster location and must identify the + source cluster's location. This property must be absent for creation modes other than + PointInTimeRestore or when creationMode is omitted. This immutable creation-provenance value + does not change after creation.""" + network: Optional["_models.Network"] = rest_field(visibility=["read", "create", "update"]) + """The network configuration for the cluster. When this object is omitted, the service defaults it + to publicAccess Disabled.""" + backup: Optional["_models.BackupProperties"] = rest_field(visibility=["read", "create", "update"]) + """The backup configuration for the cluster.""" + data_encryption: Optional["_models.HorizonDbClusterDataEncryption"] = rest_field( + name="dataEncryption", visibility=["read", "create", "update"] + ) + """The data encryption configuration for the cluster. When omitted during initial cluster + creation, the service uses SystemManaged encryption. When supplied during initial cluster + creation, type is required. For PUT updates of an existing cluster, type may be omitted; if + provided, it must match the existing encryption type. The encryption type is selected at + cluster creation; switching between SystemManaged and AzureKeyVault after creation is not + supported.""" + ai_model_management: Optional[Union[str, "_models.AiModelManagementStatus"]] = rest_field( + name="aiModelManagement", visibility=["read", "update"] + ) + """Specifies whether AI Model Management is enabled for the cluster. Known values are: \"Enabled\" + and \"Disabled\".""" + state: Union[str, "_models.ClusterState"] = rest_field(visibility=["read"]) + """Current state of the cluster. Required. Known values are: \"Ready\", \"Provisioning\", + \"Deleting\", \"Inaccessible\", and \"Updating\".""" + provisioning_state: Union[str, "_models.ProvisioningState"] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the cluster. Required. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + read_write_pool: "_models.ReadWritePoolProperties" = rest_field(name="readWritePool", visibility=["read"]) + """The pool currently designated to host the cluster's read-write node. Required.""" + + @overload + def __init__( + self, + *, + postgre_sql_version: Optional[Union[str, "_models.PostgreSqlVersion"]] = None, + creation_mode: Optional[Union[str, "_models.ClusterCreateMode"]] = None, + point_in_time_utc: Optional[datetime.datetime] = None, + creation_source_cluster_resource_id: Optional[str] = None, + creation_source_cluster_location: Optional[str] = None, + network: Optional["_models.Network"] = None, + backup: Optional["_models.BackupProperties"] = None, + data_encryption: Optional["_models.HorizonDbClusterDataEncryption"] = None, + ai_model_management: Optional[Union[str, "_models.AiModelManagementStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ClusterPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB cluster for update operations. + + :ivar network: The network configuration to update for the cluster. + :vartype network: ~azure.mgmt.horizondb.models.NetworkForPatchUpdate + :ivar backup: The backup configuration for the cluster. + :vartype backup: ~azure.mgmt.horizondb.models.BackupPropertiesForPatchUpdate + :ivar data_encryption: The data encryption configuration to update for the cluster. Omitted + properties preserve their current values. Updates can modify settings within the existing + encryption type, but switching between SystemManaged and AzureKeyVault after cluster creation + is not supported. + :vartype data_encryption: + ~azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionForPatchUpdate + :ivar ai_model_management: Specifies whether AI Model Management is enabled for the cluster. + Known values are: "Enabled" and "Disabled". + :vartype ai_model_management: str or ~azure.mgmt.horizondb.models.AiModelManagementStatus + """ + + network: Optional["_models.NetworkForPatchUpdate"] = rest_field(visibility=["update"]) + """The network configuration to update for the cluster.""" + backup: Optional["_models.BackupPropertiesForPatchUpdate"] = rest_field(visibility=["update"]) + """The backup configuration for the cluster.""" + data_encryption: Optional["_models.HorizonDbClusterDataEncryptionForPatchUpdate"] = rest_field( + name="dataEncryption", visibility=["update"] + ) + """The data encryption configuration to update for the cluster. Omitted properties preserve their + current values. Updates can modify settings within the existing encryption type, but switching + between SystemManaged and AzureKeyVault after cluster creation is not supported.""" + ai_model_management: Optional[Union[str, "_models.AiModelManagementStatus"]] = rest_field( + name="aiModelManagement", visibility=["update"] + ) + """Specifies whether AI Model Management is enabled for the cluster. Known values are: \"Enabled\" + and \"Disabled\".""" + + @overload + def __init__( + self, + *, + network: Optional["_models.NetworkForPatchUpdate"] = None, + backup: Optional["_models.BackupPropertiesForPatchUpdate"] = None, + data_encryption: Optional["_models.HorizonDbClusterDataEncryptionForPatchUpdate"] = None, + ai_model_management: Optional[Union[str, "_models.AiModelManagementStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComputeGenerationCapability(_Model): + """The capabilities of a HorizonDB compute generation. + + :ivar compute_generation: The numeric compute generation used when configuring a HorizonDB + pool. Required. + :vartype compute_generation: int + :ivar recommended_compute_model_type: The compute model type recommended for clients to select + for this compute generation. This recommendation does not describe backend behavior when the + compute model type is omitted from a request. Required. "Provisioned" + :vartype recommended_compute_model_type: str or + ~azure.mgmt.horizondb.models.PoolComputeModelType + :ivar supported_compute_models: The compute models supported by the compute generation. + Required. + :vartype supported_compute_models: list[~azure.mgmt.horizondb.models.ComputeModelCapability] + """ + + compute_generation: int = rest_field(name="computeGeneration", visibility=["read"]) + """The numeric compute generation used when configuring a HorizonDB pool. Required.""" + recommended_compute_model_type: Union[str, "_models.PoolComputeModelType"] = rest_field( + name="recommendedComputeModelType", visibility=["read"] + ) + """The compute model type recommended for clients to select for this compute generation. This + recommendation does not describe backend behavior when the compute model type is omitted from a + request. Required. \"Provisioned\"""" + supported_compute_models: list["_models.ComputeModelCapability"] = rest_field( + name="supportedComputeModels", visibility=["read"] + ) + """The compute models supported by the compute generation. Required.""" + + +class ComputeModelCapability(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The capabilities of a HorizonDB compute model. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ProvisionedComputeModelCapability + + :ivar type: The compute model represented by these capabilities. Required. "Provisioned" + :vartype type: str or ~azure.mgmt.horizondb.models.PoolComputeModelType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read"]) + """The compute model represented by these capabilities. Required. \"Provisioned\"""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComputeProcessorCapability(_Model): + """The capabilities of a processor family supported by HorizonDB. + + :ivar name: The name of the processor family. Required. Known values are: "Intel" and "AMD". + :vartype name: str or ~azure.mgmt.horizondb.models.ComputeProcessorType + :ivar supported_generations: The compute generations supported by the processor family. + Required. + :vartype supported_generations: list[~azure.mgmt.horizondb.models.ComputeGenerationCapability] + """ + + name: Union[str, "_models.ComputeProcessorType"] = rest_field(visibility=["read"]) + """The name of the processor family. Required. Known values are: \"Intel\" and \"AMD\".""" + supported_generations: list["_models.ComputeGenerationCapability"] = rest_field( + name="supportedGenerations", visibility=["read"] + ) + """The compute generations supported by the processor family. Required.""" + + +class ComputeSizeCapability(_Model): + """A vCore configuration supported by a HorizonDB processor generation. + + :ivar v_cores: The number of vCores in the configuration. Required. + :vartype v_cores: int + :ivar memory_per_v_core_in_mb: The memory in megabytes available for each vCore. Required. + :vartype memory_per_v_core_in_mb: int + """ + + v_cores: int = rest_field(name="vCores", visibility=["read"]) + """The number of vCores in the configuration. Required.""" + memory_per_v_core_in_mb: int = rest_field(name="memoryPerVCoreInMb", visibility=["read"]) + """The memory in megabytes available for each vCore. Required.""" + + +class DefaultParameterGroup(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A default parameter group available in a specific region. It contains engine-defined parameters + and excludes service and other non-engine entries. For each PostgreSQL version, the + DefaultParameterGroups APIs return at most one default parameter group in a location. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.DefaultParameterGroupProperties + """ + + properties: Optional["_models.DefaultParameterGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DefaultParameterGroupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DefaultParameterGroupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a default parameter group. + + :ivar provisioning_state: The provisioning state of the default parameter group. Known values + are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar parameters: Engine-defined parameters in the default parameter group. Service and other + non-engine entries are excluded. Required. + :vartype parameters: list[~azure.mgmt.horizondb.models.ParameterProperties] + :ivar description: Description of the default parameter group. + :vartype description: str + :ivar postgre_sql_version: PostgreSQL version for which this default parameter group is valid. + Required. Known values are: "17" and "18". + :vartype postgre_sql_version: str or ~azure.mgmt.horizondb.models.PostgreSqlVersion + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the default parameter group. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + parameters: list["_models.ParameterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Engine-defined parameters in the default parameter group. Service and other non-engine entries + are excluded. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the default parameter group.""" + postgre_sql_version: Union[str, "_models.PostgreSqlVersion"] = rest_field( + name="postgreSqlVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """PostgreSQL version for which this default parameter group is valid. Required. Known values are: + \"17\" and \"18\".""" + + @overload + def __init__( + self, + *, + parameters: list["_models.ParameterProperties"], + postgre_sql_version: Union[str, "_models.PostgreSqlVersion"], + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Endpoint(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a service-generated, service-managed HorizonDB endpoint. The Cluster-scoped Endpoint + is created and deleted with its parent Cluster. A Pool-scoped Endpoint is created and deleted + with the Pool identified by associatedResourceId. Endpoints cannot be created or deleted + independently from their lifecycle owner. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.EndpointProperties + """ + + properties: Optional["_models.EndpointProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.EndpointProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EndpointProperties(_Model): + """Properties of a service-generated HorizonDB endpoint. + + :ivar scope: The scope of the endpoint. Cluster-scoped Endpoints provide the cluster + connection, and Pool-scoped Endpoints provide read-only connections to eligible nodes in one + pool. Required. Known values are: "Cluster" and "Pool". + :vartype scope: str or ~azure.mgmt.horizondb.models.EndpointScope + :ivar associated_resource_id: The Azure resource ID of the Endpoint's lifecycle owner. For + Cluster scope, this identifies the parent Cluster with which the Endpoint is created and + deleted. For Pool scope, this identifies the Pool with which the Endpoint is created and + deleted; the Pool must be a child of the Endpoint's parent Cluster. Required. + :vartype associated_resource_id: str + :ivar fully_qualified_domain_name: The service-generated fully qualified domain name of the + endpoint. A Cluster-scoped Endpoint uses ...horizondb.azure.com. A + Pool-scoped Endpoint uses ....horizondb.azure.com. + Required. + :vartype fully_qualified_domain_name: str + :ivar role: The routing role of the endpoint. A Cluster-scoped Endpoint normally has the + ReadWrite role. Pool-scoped Endpoints have the ReadOnly role and route only to allocated nodes + in the associated Pool that are not currently playing the read-write role. A Pool-scoped + ReadOnly Endpoint has no routing destination unless at least one such node exists, including + when the Pool is Stopped, has zero allocated nodes, or has only one allocated node and that + node is playing the read-write role. Required. Known values are: "ReadOnly" and "ReadWrite". + :vartype role: str or ~azure.mgmt.horizondb.models.EndpointRole + """ + + scope: Union[str, "_models.EndpointScope"] = rest_field(visibility=["read"]) + """The scope of the endpoint. Cluster-scoped Endpoints provide the cluster connection, and + Pool-scoped Endpoints provide read-only connections to eligible nodes in one pool. Required. + Known values are: \"Cluster\" and \"Pool\".""" + associated_resource_id: str = rest_field(name="associatedResourceId", visibility=["read"]) + """The Azure resource ID of the Endpoint's lifecycle owner. For Cluster scope, this identifies the + parent Cluster with which the Endpoint is created and deleted. For Pool scope, this identifies + the Pool with which the Endpoint is created and deleted; the Pool must be a child of the + Endpoint's parent Cluster. Required.""" + fully_qualified_domain_name: str = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) + """The service-generated fully qualified domain name of the endpoint. A Cluster-scoped Endpoint + uses ...horizondb.azure.com. A Pool-scoped Endpoint uses + ....horizondb.azure.com. Required.""" + role: Union[str, "_models.EndpointRole"] = rest_field(visibility=["read"]) + """The routing role of the endpoint. A Cluster-scoped Endpoint normally has the ReadWrite role. + Pool-scoped Endpoints have the ReadOnly role and route only to allocated nodes in the + associated Pool that are not currently playing the read-write role. A Pool-scoped ReadOnly + Endpoint has no routing destination unless at least one such node exists, including when the + Pool is Stopped, has zero allocated nodes, or has only one allocated node and that node is + playing the read-write role. Required. Known values are: \"ReadOnly\" and \"ReadWrite\".""" + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.horizondb.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.horizondb.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.horizondb.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FabricDestinationDetails( + ChangeDataCaptureDestinationDetails, discriminator="Fabric" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Settings for a Microsoft Fabric destination. + + :ivar destination_type: Specifies a Microsoft Fabric destination. Required. A Microsoft Fabric + destination. + :vartype destination_type: str or ~azure.mgmt.horizondb.models.FABRIC + :ivar protocol: Specifies the Microsoft Fabric native destination protocol. Required. The + destination's native protocol. + :vartype protocol: str or ~azure.mgmt.horizondb.models.NATIVE + :ivar workspace_id: The opaque identifier of the Microsoft Fabric workspace that owns the + destination artifact. Required. + :vartype workspace_id: str + """ + + destination_type: Literal[ChangeDataCaptureDestinationType.FABRIC] = rest_discriminator(name="destinationType", visibility=["read", "create"]) # type: ignore + """Specifies a Microsoft Fabric destination. Required. A Microsoft Fabric destination.""" + protocol: Literal[ChangeDataCaptureProtocol.NATIVE] = rest_field(visibility=["read", "create"]) + """Specifies the Microsoft Fabric native destination protocol. Required. The destination's native + protocol.""" + workspace_id: str = rest_field(name="workspaceId", visibility=["read", "create"]) + """The opaque identifier of the Microsoft Fabric workspace that owns the destination artifact. + Required.""" + + @overload + def __init__( + self, + *, + protocol: Literal[ChangeDataCaptureProtocol.NATIVE], + workspace_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.destination_type = ChangeDataCaptureDestinationType.FABRIC # type: ignore + + +class FirewallRule(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a customer-managed firewall rule for a HorizonDB pool. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.FirewallRuleProperties + """ + + properties: Optional["_models.FirewallRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.FirewallRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FirewallRuleProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB firewall rule. + + :ivar start_ip_address: The start IPv4 address of the firewall rule in dotted-decimal notation. + Required. + :vartype start_ip_address: str + :ivar end_ip_address: The end IPv4 address of the firewall rule in dotted-decimal notation. + This address must be numerically greater than or equal to startIpAddress. Required. + :vartype end_ip_address: str + :ivar description: The description of the HorizonDB firewall rule. The maximum length is 1024 + characters. + :vartype description: str + :ivar provisioning_state: The provisioning state of the firewall rule. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState """ start_ip_address: str = rest_field(name="startIpAddress", visibility=["read", "create", "update"]) - """The start IP address of the firewall rule (IPv4). Required.""" + """The start IPv4 address of the firewall rule in dotted-decimal notation. Required.""" end_ip_address: str = rest_field(name="endIpAddress", visibility=["read", "create", "update"]) - """The end IP address of the firewall rule (IPv4). Required.""" + """The end IPv4 address of the firewall rule in dotted-decimal notation. This address must be + numerically greater than or equal to startIpAddress. Required.""" description: Optional[str] = rest_field(visibility=["read", "create", "update"]) - """The description of the HorizonDB firewall rule.""" + """The description of the HorizonDB firewall rule. The maximum length is 1024 characters.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the firewall rule. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + @overload + def __init__( + self, + *, + start_ip_address: str, + end_ip_address: str, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbClusterDataEncryption(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Cluster-level data encryption configuration. The encryption type is selected at cluster + creation; switching between SystemManaged and AzureKeyVault after creation is not supported. + For AzureKeyVault encryption, primaryKeyUri and primaryUserAssignedIdentityId are required, and + backup.geoRedundancy must be Disabled. Both primaryKeyUri and primaryUserAssignedIdentityId can + be provided during initial cluster creation. For updates to an existing cluster through PUT or + PATCH, only one of these properties can change per request, and that update must complete + before submitting a separate update to change the other property. Customer-managed key + identities must also be assigned to the Cluster through its top-level identity property. Only + versionless Azure Key Vault key URIs are supported; key version paths are rejected. For + SystemManaged encryption, key and identity properties must be omitted. + + :ivar type: The type of data encryption used by the cluster. When the data encryption + configuration is supplied during initial cluster creation, this property is required. For PUT + updates of an existing cluster, this property may be omitted; if provided, it must match the + existing encryption type. This value is selected at cluster creation and cannot later be + changed from SystemManaged to AzureKeyVault or from AzureKeyVault to SystemManaged. Known + values are: "SystemManaged" and "AzureKeyVault". + :vartype type: str or ~azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionType + :ivar primary_key_uri: The versionless Azure Key Vault key URI used to encrypt the cluster's + primary storage. Key version paths are not supported. During initial cluster creation, this + property can be provided together with primaryUserAssignedIdentityId. For updates to an + existing cluster through PUT or PATCH, this property and primaryUserAssignedIdentityId cannot + both change in the same request; the first update must complete before submitting a separate + update for the other property. + :vartype primary_key_uri: str + :ivar primary_user_assigned_identity_id: The Azure resource ID of the user-assigned managed + identity used to access the primary encryption key. The identity must also be assigned to the + Cluster through its top-level identity property. During initial cluster creation, this property + can be provided together with primaryKeyUri. For updates to an existing cluster through PUT or + PATCH, this property and primaryKeyUri cannot both change in the same request; the first update + must complete before submitting a separate update for the other property. + :vartype primary_user_assigned_identity_id: str + :ivar primary_encryption_key_status: The validation status of the primary encryption key. This + property is returned for AzureKeyVault encryption and is absent for SystemManaged encryption. + Known values are: "Valid" and "Invalid". + :vartype primary_encryption_key_status: str or + ~azure.mgmt.horizondb.models.HorizonDbClusterEncryptionKeyStatus + :ivar primary_encryption_key_current_version: The current version of the primary encryption key + used by the cluster. This property is returned for AzureKeyVault encryption and is absent for + SystemManaged encryption. + :vartype primary_encryption_key_current_version: str + """ + + type: Optional[Union[str, "_models.HorizonDbClusterDataEncryptionType"]] = rest_field( + visibility=["read", "create", "update"] + ) + """The type of data encryption used by the cluster. When the data encryption configuration is + supplied during initial cluster creation, this property is required. For PUT updates of an + existing cluster, this property may be omitted; if provided, it must match the existing + encryption type. This value is selected at cluster creation and cannot later be changed from + SystemManaged to AzureKeyVault or from AzureKeyVault to SystemManaged. Known values are: + \"SystemManaged\" and \"AzureKeyVault\".""" + primary_key_uri: Optional[str] = rest_field(name="primaryKeyUri", visibility=["read", "create", "update"]) + """The versionless Azure Key Vault key URI used to encrypt the cluster's primary storage. Key + version paths are not supported. During initial cluster creation, this property can be provided + together with primaryUserAssignedIdentityId. For updates to an existing cluster through PUT or + PATCH, this property and primaryUserAssignedIdentityId cannot both change in the same request; + the first update must complete before submitting a separate update for the other property.""" + primary_user_assigned_identity_id: Optional[str] = rest_field( + name="primaryUserAssignedIdentityId", visibility=["read", "create", "update"] + ) + """The Azure resource ID of the user-assigned managed identity used to access the primary + encryption key. The identity must also be assigned to the Cluster through its top-level + identity property. During initial cluster creation, this property can be provided together with + primaryKeyUri. For updates to an existing cluster through PUT or PATCH, this property and + primaryKeyUri cannot both change in the same request; the first update must complete before + submitting a separate update for the other property.""" + primary_encryption_key_status: Optional[Union[str, "_models.HorizonDbClusterEncryptionKeyStatus"]] = rest_field( + name="primaryEncryptionKeyStatus", visibility=["read"] + ) + """The validation status of the primary encryption key. This property is returned for + AzureKeyVault encryption and is absent for SystemManaged encryption. Known values are: + \"Valid\" and \"Invalid\".""" + primary_encryption_key_current_version: Optional[str] = rest_field( + name="primaryEncryptionKeyCurrentVersion", visibility=["read"] + ) + """The current version of the primary encryption key used by the cluster. This property is + returned for AzureKeyVault encryption and is absent for SystemManaged encryption.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.HorizonDbClusterDataEncryptionType"]] = None, + primary_key_uri: Optional[str] = None, + primary_user_assigned_identity_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbClusterDataEncryptionForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for sparsely updating Cluster-level data encryption. Omitted properties preserve + their current values. Updates can modify settings within the existing encryption type, such as + the primary Azure Key Vault key URI, but switching between SystemManaged and AzureKeyVault + after cluster creation is not supported. AzureKeyVault encryption is not supported when + backup.geoRedundancy is Enabled. An update can change only one of primaryKeyUri or + primaryUserAssignedIdentityId; that update must complete before submitting a separate update to + change the other property. + + :ivar type: The existing data encryption type used by the cluster. PATCH is a sparse update, so + this property may be omitted. If provided, it must match the existing encryption type. This + value cannot be changed from SystemManaged to AzureKeyVault or from AzureKeyVault to + SystemManaged after cluster creation. Known values are: "SystemManaged" and "AzureKeyVault". + :vartype type: str or ~azure.mgmt.horizondb.models.HorizonDbClusterDataEncryptionType + :ivar primary_key_uri: The versionless Azure Key Vault key URI used to encrypt the cluster's + primary storage. Key version paths are not supported. This property and + primaryUserAssignedIdentityId cannot both change in the same update; the first update must + complete before submitting a separate update for the other property. + :vartype primary_key_uri: str + :ivar primary_user_assigned_identity_id: The Azure resource ID of the user-assigned managed + identity used to access the primary encryption key. The identity must also be assigned to the + Cluster through its top-level identity property. This property and primaryKeyUri cannot both + change in the same update; the first update must complete before submitting a separate update + for the other property. + :vartype primary_user_assigned_identity_id: str + """ + + type: Optional[Union[str, "_models.HorizonDbClusterDataEncryptionType"]] = rest_field(visibility=["update"]) + """The existing data encryption type used by the cluster. PATCH is a sparse update, so this + property may be omitted. If provided, it must match the existing encryption type. This value + cannot be changed from SystemManaged to AzureKeyVault or from AzureKeyVault to SystemManaged + after cluster creation. Known values are: \"SystemManaged\" and \"AzureKeyVault\".""" + primary_key_uri: Optional[str] = rest_field(name="primaryKeyUri", visibility=["update"]) + """The versionless Azure Key Vault key URI used to encrypt the cluster's primary storage. Key + version paths are not supported. This property and primaryUserAssignedIdentityId cannot both + change in the same update; the first update must complete before submitting a separate update + for the other property.""" + primary_user_assigned_identity_id: Optional[str] = rest_field( + name="primaryUserAssignedIdentityId", visibility=["update"] + ) + """The Azure resource ID of the user-assigned managed identity used to access the primary + encryption key. The identity must also be assigned to the Cluster through its top-level + identity property. This property and primaryKeyUri cannot both change in the same update; the + first update must complete before submitting a separate update for the other property.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.HorizonDbClusterDataEncryptionType"]] = None, + primary_key_uri: Optional[str] = None, + primary_user_assigned_identity_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbClusterManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The user-assigned managed identities assigned to a HorizonDB cluster. Omitting the entire + top-level identity property from PUT or PATCH preserves all current assignments. When + userAssignedIdentities is supplied, PUT replaces the complete set and PATCH merges the supplied + entries with the existing set; a null PATCH entry removes that individual identity. Setting + type to None clears all assignments. Removing an identity referenced by a change data capture + identity assignment is rejected until the referencing assignment is deleted. + + :ivar type: The managed identity type assigned to the cluster. Setting this property to None + clears all managed identity assignments. Required. Known values are: "None" and "UserAssigned". + :vartype type: str or ~azure.mgmt.horizondb.models.HorizonDbClusterIdentityType + :ivar user_assigned_identities: The user-assigned managed identities associated with the + cluster. When supplied on PUT, this dictionary replaces the complete set of assignments. When + supplied on PATCH, entries are merged with the existing set and a null value removes the + corresponding identity. Each dictionary key must be the full Azure resource ID of a + Microsoft.ManagedIdentity/userAssignedIdentities resource. Non-null request values can be empty + objects; response values contain the service-populated clientId and principalId. Assigning an + identity does not grant it access to destination resources; required role assignments must be + configured separately. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.horizondb.models.UserAssignedIdentity] + """ + + type: Union[str, "_models.HorizonDbClusterIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed identity type assigned to the cluster. Setting this property to None clears all + managed identity assignments. Required. Known values are: \"None\" and \"UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The user-assigned managed identities associated with the cluster. When supplied on PUT, this + dictionary replaces the complete set of assignments. When supplied on PATCH, entries are merged + with the existing set and a null value removes the corresponding identity. Each dictionary key + must be the full Azure resource ID of a Microsoft.ManagedIdentity/userAssignedIdentities + resource. Non-null request values can be empty objects; response values contain the + service-populated clientId and principalId. Assigning an identity does not grant it access to + destination resources; required role assignments must be configured separately.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.HorizonDbClusterIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IdentityAssignment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A user-assigned managed identity authorized for a HorizonDB change data capture destination. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureIdentityAssignmentProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.ChangeDataCaptureIdentityAssignmentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ChangeDataCaptureIdentityAssignmentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IdentityValidationStatus(_Model): + """The current validation result for a change data capture identity assignment. + + :ivar state: The current validation state. Required. Known values are: "NotStarted", "Running", + "Succeeded", and "Failed". + :vartype state: str or ~azure.mgmt.horizondb.models.ChangeDataCaptureIdentityValidationState + :ivar validated_at_utc: The date and time, in UTC, when validation most recently completed. + :vartype validated_at_utc: ~datetime.datetime + :ivar error: The customer-safe validation error when validation failed. + :vartype error: ~azure.mgmt.horizondb.models.ErrorDetail + """ + + state: Union[str, "_models.ChangeDataCaptureIdentityValidationState"] = rest_field(visibility=["read"]) + """The current validation state. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", and \"Failed\".""" + validated_at_utc: Optional[datetime.datetime] = rest_field( + name="validatedAtUtc", visibility=["read"], format="rfc3339" + ) + """The date and time, in UTC, when validation most recently completed.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read"]) + """The customer-safe validation error when validation failed.""" + + +class LogCaptureConfiguration(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A predefined log capture configuration created by the service for a HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.LogCaptureConfigurationProperties + """ + + properties: Optional["_models.LogCaptureConfigurationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.LogCaptureConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogCaptureConfigurationForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A sparse update request for a log capture configuration. + + :ivar properties: The log capture properties to update. + :vartype properties: + ~azure.mgmt.horizondb.models.LogCaptureConfigurationPropertiesForPatchUpdate + """ + + properties: Optional["_models.LogCaptureConfigurationPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The log capture properties to update.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.LogCaptureConfigurationPropertiesForPatchUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogCaptureConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The settings for capturing a specific type of HorizonDB log. + + :ivar state: Specifies whether HorizonDB captures this type of log. Disabling capture stops the + production of new log files; existing files remain available until their retention period + expires. Required. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.LogCaptureState + :ivar retention_days: The number of days captured log files are retained. Required. + :vartype retention_days: int + :ivar provisioning_state: The provisioning state of the log capture configuration. Known values + are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + """ + + state: Union[str, "_models.LogCaptureState"] = rest_field(visibility=["read", "update"]) + """Specifies whether HorizonDB captures this type of log. Disabling capture stops the production + of new log files; existing files remain available until their retention period expires. + Required. Known values are: \"Enabled\" and \"Disabled\".""" + retention_days: int = rest_field(name="retentionDays", visibility=["read", "update"]) + """The number of days captured log files are retained. Required.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the log capture configuration. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.LogCaptureState"], + retention_days: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogCaptureConfigurationPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for updating the log capture configuration. Omitted properties preserve their + current values. + + :ivar state: Specifies whether HorizonDB captures this type of log. Disabling capture stops the + production of new log files; existing files remain available until their retention period + expires. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.LogCaptureState + :ivar retention_days: The number of days captured log files are retained. + :vartype retention_days: int + """ + + state: Optional[Union[str, "_models.LogCaptureState"]] = rest_field(visibility=["update"]) + """Specifies whether HorizonDB captures this type of log. Disabling capture stops the production + of new log files; existing files remain available until their retention period expires. Known + values are: \"Enabled\" and \"Disabled\".""" + retention_days: Optional[int] = rest_field(name="retentionDays", visibility=["update"]) + """The number of days captured log files are retained.""" + + @overload + def __init__( + self, + *, + state: Optional[Union[str, "_models.LogCaptureState"]] = None, + retention_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogFile(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A service-generated log file captured for a HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.LogFileProperties + """ + + properties: Optional["_models.LogFileProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.LogFileProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogFileDownloadUrl(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A short-lived signed URL for downloading a captured log file. + + :ivar download_uri: A short-lived signed URL from which the original log file can be + downloaded. Required. + :vartype download_uri: str + :ivar expires_at_utc: The date and time when the signed download URL expires, in UTC. Required. + :vartype expires_at_utc: ~datetime.datetime + """ + + download_uri: str = rest_field(name="downloadUri", visibility=["read", "create", "update", "delete", "query"]) + """A short-lived signed URL from which the original log file can be downloaded. Required.""" + expires_at_utc: datetime.datetime = rest_field( + name="expiresAtUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The date and time when the signed download URL expires, in UTC. Required.""" + + @overload + def __init__( + self, + *, + download_uri: str, + expires_at_utc: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogFileProperties(_Model): + """Metadata for a service-generated HorizonDB log file. + + :ivar log_type: The type of the captured log file. Required. "PostgreSqlServer" + :vartype log_type: str or ~azure.mgmt.horizondb.models.LogFileType + :ivar created_at_utc: The date and time when the log file was created, in UTC. Required. + :vartype created_at_utc: ~datetime.datetime + :ivar last_modified_at_utc: The date and time when the log file was last modified, in UTC. + Required. + :vartype last_modified_at_utc: ~datetime.datetime + :ivar retention_expires_at_utc: The date and time when the log file expires according to its + retention period, in UTC. Required. + :vartype retention_expires_at_utc: ~datetime.datetime + :ivar is_mutable: Whether the platform can still append to or otherwise modify the log file. + Required. + :vartype is_mutable: bool + :ivar size_in_kilobytes: The size of the log file in kilobytes, where one kilobyte is 1024 + bytes. Required. + :vartype size_in_kilobytes: int + :ivar pool: The name of the HorizonDB pool that the node generating the log file belongs to. + Required. + :vartype pool: str + :ivar node: The node that generated the log file in the HorizonDB cluster. Required. + :vartype node: str + :ivar role: The role performed by the node that generated the log file. Required. Known values + are: "ReadWrite", "ReadOnly", and "Unassigned". + :vartype role: str or ~azure.mgmt.horizondb.models.NodeRole + """ + + log_type: Union[str, "_models.LogFileType"] = rest_field(name="logType", visibility=["read"]) + """The type of the captured log file. Required. \"PostgreSqlServer\"""" + created_at_utc: datetime.datetime = rest_field(name="createdAtUtc", visibility=["read"], format="rfc3339") + """The date and time when the log file was created, in UTC. Required.""" + last_modified_at_utc: datetime.datetime = rest_field( + name="lastModifiedAtUtc", visibility=["read"], format="rfc3339" + ) + """The date and time when the log file was last modified, in UTC. Required.""" + retention_expires_at_utc: datetime.datetime = rest_field( + name="retentionExpiresAtUtc", visibility=["read"], format="rfc3339" + ) + """The date and time when the log file expires according to its retention period, in UTC. + Required.""" + is_mutable: bool = rest_field(name="isMutable", visibility=["read"]) + """Whether the platform can still append to or otherwise modify the log file. Required.""" + size_in_kilobytes: int = rest_field(name="sizeInKilobytes", visibility=["read"]) + """The size of the log file in kilobytes, where one kilobyte is 1024 bytes. Required.""" + pool: str = rest_field(visibility=["read"]) + """The name of the HorizonDB pool that the node generating the log file belongs to. Required.""" + node: str = rest_field(visibility=["read"]) + """The node that generated the log file in the HorizonDB cluster. Required.""" + role: Union[str, "_models.NodeRole"] = rest_field(visibility=["read"]) + """The role performed by the node that generated the log file. Required. Known values are: + \"ReadWrite\", \"ReadOnly\", and \"Unassigned\".""" + + +class MaintenanceEvent(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a maintenance event for a HorizonDB pool. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.MaintenanceEventProperties + """ + + properties: Optional["_models.MaintenanceEventProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MaintenanceEventProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceEventActionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The response from a maintenance event reschedule or apply-now action. + + :ivar maintenance_event_id: The maintenance event identifier. + :vartype maintenance_event_id: str + :ivar pool_resource_id: The full Azure resource ID of the HorizonDB pool. + :vartype pool_resource_id: str + :ivar status: The status of the maintenance event. Known values are: "Planned", "InProgress", + "Complete", "Rescheduled", and "Canceled". + :vartype status: str or ~azure.mgmt.horizondb.models.MaintenanceEventStatus + :ivar planned_start_time_utc: The planned start time of the maintenance event in UTC. + :vartype planned_start_time_utc: ~datetime.datetime + :ivar planned_end_time_utc: The planned end time of the maintenance event in UTC. + :vartype planned_end_time_utc: ~datetime.datetime + :ivar applied_now: Indicates whether the maintenance event was requested to be applied + immediately. The value is true for apply-now and false for reschedule. + :vartype applied_now: bool + :ivar last_updated_time_utc: The time when this maintenance event record was last updated, in + UTC. + :vartype last_updated_time_utc: ~datetime.datetime + """ + + maintenance_event_id: Optional[str] = rest_field( + name="maintenanceEventId", visibility=["read", "create", "update", "delete", "query"] + ) + """The maintenance event identifier.""" + pool_resource_id: Optional[str] = rest_field( + name="poolResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The full Azure resource ID of the HorizonDB pool.""" + status: Optional[Union[str, "_models.MaintenanceEventStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the maintenance event. Known values are: \"Planned\", \"InProgress\", + \"Complete\", \"Rescheduled\", and \"Canceled\".""" + planned_start_time_utc: Optional[datetime.datetime] = rest_field( + name="plannedStartTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The planned start time of the maintenance event in UTC.""" + planned_end_time_utc: Optional[datetime.datetime] = rest_field( + name="plannedEndTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The planned end time of the maintenance event in UTC.""" + applied_now: Optional[bool] = rest_field( + name="appliedNow", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the maintenance event was requested to be applied immediately. The value is + true for apply-now and false for reschedule.""" + last_updated_time_utc: Optional[datetime.datetime] = rest_field( + name="lastUpdatedTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time when this maintenance event record was last updated, in UTC.""" + + @overload + def __init__( + self, + *, + maintenance_event_id: Optional[str] = None, + pool_resource_id: Optional[str] = None, + status: Optional[Union[str, "_models.MaintenanceEventStatus"]] = None, + planned_start_time_utc: Optional[datetime.datetime] = None, + planned_end_time_utc: Optional[datetime.datetime] = None, + applied_now: Optional[bool] = None, + last_updated_time_utc: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceEventProperties(_Model): + """Properties of a maintenance event resource. + + :ivar maintenance_event_id: A service-generated identifier for this maintenance event, assigned + by the platform. The format is not contractual, and clients should not attempt to parse or + construct this value. + :vartype maintenance_event_id: str + :ivar maintenance_type: The maintenance type. Required. "PlannedMaintenance" + :vartype maintenance_type: str or ~azure.mgmt.horizondb.models.MaintenanceType + :ivar description: The human-readable description of the maintenance event. + :vartype description: str + :ivar status: The customer-facing status of the maintenance event. Required. Known values are: + "Planned", "InProgress", "Complete", "Rescheduled", and "Canceled". + :vartype status: str or ~azure.mgmt.horizondb.models.MaintenanceEventStatus + :ivar start_time_utc: The scheduled start time of the maintenance event in UTC. Required. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The scheduled end time of the maintenance event in UTC. Required. + :vartype end_time_utc: ~datetime.datetime + :ivar estimated_downtime: The estimated downtime as an ISO 8601 duration string, for example, + 'PT60S' for 60 seconds. + :vartype estimated_downtime: ~datetime.timedelta + :ivar deferrable: Indicates whether the customer can reschedule this maintenance event. + Required. + :vartype deferrable: bool + :ivar deferral_deadline_utc: The latest date and time to which this maintenance event can be + postponed, in UTC. This property is present only when deferrable is true. + :vartype deferral_deadline_utc: ~datetime.datetime + :ivar rescheduled_from_utc: The scheduled start time before the most recent reschedule, in UTC. + This property is absent if the event has never been rescheduled. + :vartype rescheduled_from_utc: ~datetime.datetime + :ivar last_updated_time_utc: The time when this maintenance event record was last updated, in + UTC. + :vartype last_updated_time_utc: ~datetime.datetime + :ivar original_start_time_utc: The initially scheduled start time before any reschedule, in + UTC. This value equals startTimeUtc when the event has never been rescheduled. Required. + :vartype original_start_time_utc: ~datetime.datetime + """ + + maintenance_event_id: Optional[str] = rest_field(name="maintenanceEventId", visibility=["read"]) + """A service-generated identifier for this maintenance event, assigned by the platform. The format + is not contractual, and clients should not attempt to parse or construct this value.""" + maintenance_type: Union[str, "_models.MaintenanceType"] = rest_field(name="maintenanceType", visibility=["read"]) + """The maintenance type. Required. \"PlannedMaintenance\"""" + description: Optional[str] = rest_field(visibility=["read"]) + """The human-readable description of the maintenance event.""" + status: Union[str, "_models.MaintenanceEventStatus"] = rest_field(visibility=["read"]) + """The customer-facing status of the maintenance event. Required. Known values are: \"Planned\", + \"InProgress\", \"Complete\", \"Rescheduled\", and \"Canceled\".""" + start_time_utc: datetime.datetime = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") + """The scheduled start time of the maintenance event in UTC. Required.""" + end_time_utc: datetime.datetime = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") + """The scheduled end time of the maintenance event in UTC. Required.""" + estimated_downtime: Optional[datetime.timedelta] = rest_field(name="estimatedDowntime", visibility=["read"]) + """The estimated downtime as an ISO 8601 duration string, for example, 'PT60S' for 60 seconds.""" + deferrable: bool = rest_field(visibility=["read"]) + """Indicates whether the customer can reschedule this maintenance event. Required.""" + deferral_deadline_utc: Optional[datetime.datetime] = rest_field( + name="deferralDeadlineUtc", visibility=["read"], format="rfc3339" + ) + """The latest date and time to which this maintenance event can be postponed, in UTC. This + property is present only when deferrable is true.""" + rescheduled_from_utc: Optional[datetime.datetime] = rest_field( + name="rescheduledFromUtc", visibility=["read"], format="rfc3339" + ) + """The scheduled start time before the most recent reschedule, in UTC. This property is absent if + the event has never been rescheduled.""" + last_updated_time_utc: Optional[datetime.datetime] = rest_field( + name="lastUpdatedTimeUtc", visibility=["read"], format="rfc3339" + ) + """The time when this maintenance event record was last updated, in UTC.""" + original_start_time_utc: datetime.datetime = rest_field( + name="originalStartTimeUtc", visibility=["read"], format="rfc3339" + ) + """The initially scheduled start time before any reschedule, in UTC. This value equals + startTimeUtc when the event has never been rescheduled. Required.""" + + +class MaintenanceEventRescheduleRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Parameters for rescheduling a maintenance event. + + :ivar postpone_to_date_time_utc: The new start time in RFC 3339 format. Required. + :vartype postpone_to_date_time_utc: ~datetime.datetime + """ + + postpone_to_date_time_utc: datetime.datetime = rest_field( + name="postponeToDateTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The new start time in RFC 3339 format. Required.""" + + @overload + def __init__( + self, + *, + postpone_to_date_time_utc: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAdministrator(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a PostgreSQL role that is a member of the azure_pg_admin role and is mapped to a + Microsoft Entra principal. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministratorProperties + """ + + properties: Optional["_models.MicrosoftEntraAdministratorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MicrosoftEntraAdministratorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAdministratorAdd(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request body for creating or updating a PostgreSQL role that is a member of azure_pg_admin + and mapped to a Microsoft Entra principal. + + :ivar properties: The PostgreSQL role and Microsoft Entra principal mapping properties. + Required. + :vartype properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministratorPropertiesForAdd + """ + + properties: "_models.MicrosoftEntraAdministratorPropertiesForAdd" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The PostgreSQL role and Microsoft Entra principal mapping properties. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.MicrosoftEntraAdministratorPropertiesForAdd", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAdministratorProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a PostgreSQL role that is a member of azure_pg_admin and mapped to a Microsoft + Entra principal. + + :ivar principal_name: The display name or user principal name of the Microsoft Entra principal + mapped to the PostgreSQL role. For users, this is typically the user principal name, such as + `admin@contoso.com `_. For groups, this is the group display name. + For service principals, this is the application display name. Required. + :vartype principal_name: str + :ivar principal_type: The type of Microsoft Entra principal mapped to the PostgreSQL role. + Required. Known values are: "Unknown", "User", "Group", and "ServicePrincipal". + :vartype principal_type: str or ~azure.mgmt.horizondb.models.PrincipalTypes + :ivar object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. On PUT requests, this value comes from the + URI path parameter. + :vartype object_id: str + :ivar tenant_id: The identifier of the Microsoft Entra tenant containing the mapped principal, + represented as an RFC 4122 GUID. If omitted, this value defaults to the tenant of the + subscription. + :vartype tenant_id: str + :ivar provisioning_state: The provisioning state of the PostgreSQL role and Microsoft Entra + principal mapping. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and + "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + """ + + principal_name: str = rest_field(name="principalName", visibility=["read", "create"]) + """The display name or user principal name of the Microsoft Entra principal mapped to the + PostgreSQL role. For users, this is typically the user principal name, such as + `admin@contoso.com `_. For groups, this is the group display name. + For service principals, this is the application display name. Required.""" + principal_type: Union[str, "_models.PrincipalTypes"] = rest_field( + name="principalType", visibility=["read", "create"] + ) + """The type of Microsoft Entra principal mapped to the PostgreSQL role. Required. Known values + are: \"Unknown\", \"User\", \"Group\", and \"ServicePrincipal\".""" + object_id: Optional[str] = rest_field(name="objectId", visibility=["read"]) + """The Microsoft Entra object identifier of the principal mapped to the PostgreSQL role, + represented as an RFC 4122 GUID. On PUT requests, this value comes from the URI path parameter.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create"]) + """The identifier of the Microsoft Entra tenant containing the mapped principal, represented as an + RFC 4122 GUID. If omitted, this value defaults to the tenant of the subscription.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the PostgreSQL role and Microsoft Entra principal mapping. Known + values are: \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, "_models.PrincipalTypes"], + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAdministratorPropertiesForAdd( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for creating or updating a PostgreSQL role that is a member of azure_pg_admin and + mapped to a Microsoft Entra principal. + + :ivar principal_name: The display name or user principal name of the Microsoft Entra principal + to map to the PostgreSQL role. For users, this is typically the user principal name, such as + `admin@contoso.com `_. For groups, this is the group display name. + For service principals, this is the application display name. Required. + :vartype principal_name: str + :ivar principal_type: The type of Microsoft Entra principal to map to the PostgreSQL role. + Required. Known values are: "Unknown", "User", "Group", and "ServicePrincipal". + :vartype principal_type: str or ~azure.mgmt.horizondb.models.PrincipalTypes + :ivar tenant_id: The identifier of the Microsoft Entra tenant containing the principal to map, + represented as an RFC 4122 GUID. If omitted, this value defaults to the tenant of the + subscription. + :vartype tenant_id: str + """ + + principal_name: str = rest_field(name="principalName", visibility=["read", "create", "update", "delete", "query"]) + """The display name or user principal name of the Microsoft Entra principal to map to the + PostgreSQL role. For users, this is typically the user principal name, such as + `admin@contoso.com `_. For groups, this is the group display name. + For service principals, this is the application display name. Required.""" + principal_type: Union[str, "_models.PrincipalTypes"] = rest_field( + name="principalType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of Microsoft Entra principal to map to the PostgreSQL role. Required. Known values + are: \"Unknown\", \"User\", \"Group\", and \"ServicePrincipal\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the Microsoft Entra tenant containing the principal to map, represented as an + RFC 4122 GUID. If omitted, this value defaults to the tenant of the subscription.""" + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, "_models.PrincipalTypes"], + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAuthentication(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The service-created Microsoft Entra authentication method for a HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationProperties + """ + + properties: Optional["_models.MicrosoftEntraAuthenticationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MicrosoftEntraAuthenticationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAuthenticationForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A sparse update request for Microsoft Entra authentication. + + :ivar properties: The Microsoft Entra authentication properties to update. + :vartype properties: + ~azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationPropertiesForPatchUpdate + """ + + properties: Optional["_models.MicrosoftEntraAuthenticationPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Microsoft Entra authentication properties to update.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MicrosoftEntraAuthenticationPropertiesForPatchUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAuthenticationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of the service-created Microsoft Entra authentication method. + + :ivar state: The state of Microsoft Entra authentication. Required. Known values are: "Enabled" + and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.AuthenticationState + :ivar provisioning_state: The provisioning state of the Microsoft Entra authentication method. + Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + """ + + state: Union[str, "_models.AuthenticationState"] = rest_field(visibility=["read", "create", "update"]) + """The state of Microsoft Entra authentication. Required. Known values are: \"Enabled\" and + \"Disabled\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """The provisioning state of the firewall rule. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" + """The provisioning state of the Microsoft Entra authentication method. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" @overload def __init__( self, *, - start_ip_address: str, - end_ip_address: str, - description: Optional[str] = None, + state: Union[str, "_models.AuthenticationState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MicrosoftEntraAuthenticationPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for updating Microsoft Entra authentication. State Enabled enables the feature and + State Disabled disables it. Disabling Microsoft Entra authentication does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :ivar state: The target Microsoft Entra authentication state. Omission preserves the current + state. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.AuthenticationState + """ + + state: Optional[Union[str, "_models.AuthenticationState"]] = rest_field(visibility=["update"]) + """The target Microsoft Entra authentication state. Omission preserves the current state. Known + values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + state: Optional[Union[str, "_models.AuthenticationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Network(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network properties. + + :ivar public_access: Specifies whether public access is enabled for the cluster. The service + defaults to Disabled when this property is omitted. Known values are: "Enabled" and "Disabled". + :vartype public_access: str or ~azure.mgmt.horizondb.models.PublicNetworkAccessState + """ + + public_access: Optional[Union[str, "_models.PublicNetworkAccessState"]] = rest_field( + name="publicAccess", visibility=["read", "create", "update"] + ) + """Specifies whether public access is enabled for the cluster. The service defaults to Disabled + when this property is omitted. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + public_access: Optional[Union[str, "_models.PublicNetworkAccessState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network properties for updating a HorizonDB cluster. + + :ivar public_access: Specifies whether public access is enabled for the cluster. Omission + preserves the current value. Known values are: "Enabled" and "Disabled". + :vartype public_access: str or ~azure.mgmt.horizondb.models.PublicNetworkAccessState + """ + + public_access: Optional[Union[str, "_models.PublicNetworkAccessState"]] = rest_field( + name="publicAccess", visibility=["update"] + ) + """Specifies whether public access is enabled for the cluster. Omission preserves the current + value. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + public_access: Optional[Union[str, "_models.PublicNetworkAccessState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Node(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A service-managed node allocated to a HorizonDB pool. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.NodeProperties + """ + + properties: Optional["_models.NodeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.NodeProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NodeProperties(_Model): + """Properties of a service-managed HorizonDB node. + + :ivar role: The current role performed by the node within its pool. Required. Known values are: + "ReadWrite", "ReadOnly", and "Unassigned". + :vartype role: str or ~azure.mgmt.horizondb.models.NodeRole + :ivar availability_zone: The availability zone in which the node is deployed. Required. + :vartype availability_zone: str + """ + + role: Union[str, "_models.NodeRole"] = rest_field(visibility=["read"]) + """The current role performed by the node within its pool. Required. Known values are: + \"ReadWrite\", \"ReadOnly\", and \"Unassigned\".""" + availability_zone: str = rest_field(name="availabilityZone", visibility=["read"]) + """The availability zone in which the node is deployed. Required.""" + + +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.horizondb.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.horizondb.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.horizondb.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, ) -> None: ... @overload @@ -921,11 +3442,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for an operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" -class HorizonDbParameterGroup(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only +class ParameterGroup(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the HorizonDB parameter group. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -944,10 +3496,10 @@ class HorizonDbParameterGroup(TrackedResource): # pylint: disable=docstring-key :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupProperties + :vartype properties: ~azure.mgmt.horizondb.models.ParameterGroupProperties """ - properties: Optional["_models.HorizonDbParameterGroupProperties"] = rest_field( + properties: Optional["_models.ParameterGroupProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" @@ -958,7 +3510,7 @@ def __init__( *, location: str, tags: Optional[dict[str, str]] = None, - properties: Optional["_models.HorizonDbParameterGroupProperties"] = None, + properties: Optional["_models.ParameterGroupProperties"] = None, ) -> None: ... @overload @@ -972,38 +3524,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbParameterGroupConnectionProperties(_Model): # pylint: disable=name-too-long +class ParameterGroupConnectionProperties(_Model): """Connection information for HorizonDB parameter group. - :ivar name: The name of the connected resource. - :vartype name: str - :ivar id: The resource ID of the connected resource. - :vartype id: str - :ivar type: The type of the resource. - :vartype type: str + :ivar pool_resource_id: The Azure resource ID of the connected HorizonDB pool. Required. + :vartype pool_resource_id: str """ - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the connected resource.""" - id: Optional[str] = rest_field(visibility=["read"]) - """The resource ID of the connected resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource.""" + pool_resource_id: str = rest_field(name="poolResourceId", visibility=["read"]) + """The Azure resource ID of the connected HorizonDB pool. Required.""" -class HorizonDbParameterGroupForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ParameterGroupForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """HorizonDB parameter group for update operations. :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar properties: The properties that can be updated for a HorizonDB parameter group. - :vartype properties: - ~azure.mgmt.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate + :vartype properties: ~azure.mgmt.horizondb.models.ParameterGroupPropertiesForPatchUpdate """ tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.HorizonDbParameterGroupPropertiesForPatchUpdate"] = rest_field( + properties: Optional["_models.ParameterGroupPropertiesForPatchUpdate"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The properties that can be updated for a HorizonDB parameter group.""" @@ -1013,7 +3556,7 @@ def __init__( self, *, tags: Optional[dict[str, str]] = None, - properties: Optional["_models.HorizonDbParameterGroupPropertiesForPatchUpdate"] = None, + properties: Optional["_models.ParameterGroupPropertiesForPatchUpdate"] = None, ) -> None: ... @overload @@ -1027,19 +3570,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbParameterGroupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ParameterGroupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a HorizonDB parameter group. :ivar parameters: Parameters in the parameter group. :vartype parameters: list[~azure.mgmt.horizondb.models.ParameterProperties] - :ivar description: Description of the parameter group. + :ivar description: Description of the parameter group. The maximum length is 1024 characters. :vartype description: str - :ivar pg_version: PostgreSQL version for the parameter group. - :vartype pg_version: int - :ivar version: Current version of the parameter group. - :vartype version: int - :ivar apply_immediately: Indicates whether the parameters should be applied immediately. - :vartype apply_immediately: bool + :ivar postgre_sql_version: The PostgreSQL major version for the parameter group. This property + is required during creation and is immutable thereafter. The service selects the unique + location-scoped default parameter group for this version in the resource location. The + DefaultParameterGroups APIs return at most one default parameter group for each PostgreSQL + version in a location, so this selection is unambiguous. Required. Known values are: "17" and + "18". + :vartype postgre_sql_version: str or ~azure.mgmt.horizondb.models.PostgreSqlVersion :ivar provisioning_state: The provisioning state of the parameter group. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState @@ -1048,13 +3592,15 @@ class HorizonDbParameterGroupProperties(_Model): # pylint: disable=docstring-ke parameters: Optional[list["_models.ParameterProperties"]] = rest_field(visibility=["read", "create", "update"]) """Parameters in the parameter group.""" description: Optional[str] = rest_field(visibility=["read", "create", "update"]) - """Description of the parameter group.""" - pg_version: Optional[int] = rest_field(name="pgVersion", visibility=["read", "create"]) - """PostgreSQL version for the parameter group.""" - version: Optional[int] = rest_field(visibility=["read"]) - """Current version of the parameter group.""" - apply_immediately: Optional[bool] = rest_field(name="applyImmediately", visibility=["read", "create", "update"]) - """Indicates whether the parameters should be applied immediately.""" + """Description of the parameter group. The maximum length is 1024 characters.""" + postgre_sql_version: Union[str, "_models.PostgreSqlVersion"] = rest_field( + name="postgreSqlVersion", visibility=["read", "create"] + ) + """The PostgreSQL major version for the parameter group. This property is required during creation + and is immutable thereafter. The service selects the unique location-scoped default parameter + group for this version in the resource location. The DefaultParameterGroups APIs return at most + one default parameter group for each PostgreSQL version in a location, so this selection is + unambiguous. Required. Known values are: \"17\" and \"18\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -1065,10 +3611,9 @@ class HorizonDbParameterGroupProperties(_Model): # pylint: disable=docstring-ke def __init__( self, *, + postgre_sql_version: Union[str, "_models.PostgreSqlVersion"], parameters: Optional[list["_models.ParameterProperties"]] = None, description: Optional[str] = None, - pg_version: Optional[int] = None, - apply_immediately: Optional[bool] = None, ) -> None: ... @overload @@ -1082,25 +3627,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbParameterGroupPropertiesForPatchUpdate( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only +class ParameterGroupPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a HorizonDB parameter group for update operations. :ivar parameters: Parameters in the parameter group. :vartype parameters: list[~azure.mgmt.horizondb.models.ParameterProperties] - :ivar description: Description of the parameter group. + :ivar description: Description of the parameter group. The maximum length is 1024 characters. :vartype description: str - :ivar apply_immediately: Indicates whether the parameters should be applied immediately. - :vartype apply_immediately: bool """ parameters: Optional[list["_models.ParameterProperties"]] = rest_field(visibility=["update"]) """Parameters in the parameter group.""" description: Optional[str] = rest_field(visibility=["update"]) - """Description of the parameter group.""" - apply_immediately: Optional[bool] = rest_field(name="applyImmediately", visibility=["update"]) - """Indicates whether the parameters should be applied immediately.""" + """Description of the parameter group. The maximum length is 1024 characters.""" @overload def __init__( @@ -1108,7 +3647,6 @@ def __init__( *, parameters: Optional[list["_models.ParameterProperties"]] = None, description: Optional[str] = None, - apply_immediately: Optional[bool] = None, ) -> None: ... @overload @@ -1122,8 +3660,87 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbPool(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the HorizonDB pool. +class ParameterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB parameter. + + :ivar name: The name of the parameter. + :vartype name: str + :ivar description: The description of the parameter. + :vartype description: str + :ivar value: The value of the configuration. + :vartype value: str + :ivar default_value: The system-defined default value of the parameter, independent of the + effective value. + :vartype default_value: str + :ivar value_source: The source of the effective parameter value. UserOverride means that the + value was explicitly supplied by the user, even when it equals defaultValue. Known values are: + "SystemDefault" and "UserOverride". + :vartype value_source: str or ~azure.mgmt.horizondb.models.ParameterValueSource + :ivar data_type: The data type of the parameter. + :vartype data_type: str + :ivar allowed_values: The allowed values for the parameter. + :vartype allowed_values: str + :ivar is_dynamic: Whether the parameter can be changed dynamically. + :vartype is_dynamic: bool + :ivar is_read_only: Whether the parameter is read-only. Read-only parameters cannot be + overridden. + :vartype is_read_only: bool + :ivar documentation_link: Link to parameter documentation. + :vartype documentation_link: str + :ivar unit: The unit of measurement for the parameter. + :vartype unit: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update"]) + """The name of the parameter.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The description of the parameter.""" + value: Optional[str] = rest_field(visibility=["read", "create", "update"]) + """The value of the configuration.""" + default_value: Optional[str] = rest_field(name="defaultValue", visibility=["read"]) + """The system-defined default value of the parameter, independent of the effective value.""" + value_source: Optional[Union[str, "_models.ParameterValueSource"]] = rest_field( + name="valueSource", visibility=["read"] + ) + """The source of the effective parameter value. UserOverride means that the value was explicitly + supplied by the user, even when it equals defaultValue. Known values are: \"SystemDefault\" and + \"UserOverride\".""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read"]) + """The data type of the parameter.""" + allowed_values: Optional[str] = rest_field(name="allowedValues", visibility=["read"]) + """The allowed values for the parameter.""" + is_dynamic: Optional[bool] = rest_field(name="isDynamic", visibility=["read"]) + """Whether the parameter can be changed dynamically.""" + is_read_only: Optional[bool] = rest_field(name="isReadOnly", visibility=["read"]) + """Whether the parameter is read-only. Read-only parameters cannot be overridden.""" + documentation_link: Optional[str] = rest_field(name="documentationLink", visibility=["read"]) + """Link to parameter documentation.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """The unit of measurement for the parameter.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PasswordAuthentication(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The service-created PostgreSQL username-and-password authentication method for a HorizonDB + cluster. This resource configures the authentication mechanism, including its enabled state and + administrator login credentials; it is not a password-only resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -1137,24 +3754,19 @@ class HorizonDbPool(ProxyResource): # pylint: disable=docstring-keyword-should- information. :vartype system_data: ~azure.mgmt.horizondb.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbPoolProperties - :ivar tags: Resource tags. - :vartype tags: dict[str, str] + :vartype properties: ~azure.mgmt.horizondb.models.PasswordAuthenticationProperties """ - properties: Optional["_models.HorizonDbPoolProperties"] = rest_field( + properties: Optional["_models.PasswordAuthenticationProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" @overload def __init__( self, *, - properties: Optional["_models.HorizonDbPoolProperties"] = None, - tags: Optional[dict[str, str]] = None, + properties: Optional["_models.PasswordAuthenticationProperties"] = None, ) -> None: ... @overload @@ -1168,48 +3780,81 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbPoolProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB pool. +class PasswordAuthenticationForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A sparse update request for PostgreSQL username-and-password authentication. - :ivar location: The location of the HorizonDB pool. - :vartype location: str - :ivar state: Current state of the pool. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". - :vartype state: str or ~azure.mgmt.horizondb.models.State - :ivar replica_count: Number of replicas in the pool. - :vartype replica_count: int - :ivar version: The version of the HorizonDB pool. - :vartype version: str - :ivar create_mode: The create mode for the pool. Known values are: "Create" and "Update". - :vartype create_mode: str or ~azure.mgmt.horizondb.models.CreateModePool - :ivar provisioning_state: The provisioning state of the pool. Known values are: "Succeeded", - "Failed", "Canceled", "InProgress", and "Provisioning". + :ivar properties: The PostgreSQL username-and-password authentication properties to update. + :vartype properties: + ~azure.mgmt.horizondb.models.PasswordAuthenticationPropertiesForPatchUpdate + """ + + properties: Optional["_models.PasswordAuthenticationPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The PostgreSQL username-and-password authentication properties to update.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.PasswordAuthenticationPropertiesForPatchUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PasswordAuthenticationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of the service-created PostgreSQL username-and-password authentication method. + + :ivar state: The state of PostgreSQL username-and-password authentication. Required. Known + values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.AuthenticationState + :ivar administrator_login: The PostgreSQL administrator login name. This value is not returned + in responses. After it is set, renaming is not supported. Setting the login requires password + authentication state to be Enabled in the same request. + :vartype administrator_login: str + :ivar administrator_login_password: The PostgreSQL administrator password. Setting the password + requires password authentication state to be Enabled in the same request. + :vartype administrator_login_password: str + :ivar provisioning_state: The provisioning state of the PostgreSQL username-and-password + authentication method. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and + "Provisioning". :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState """ - location: Optional[str] = rest_field(visibility=["read", "create"]) - """The location of the HorizonDB pool.""" - state: Optional[Union[str, "_models.State"]] = rest_field(visibility=["read"]) - """Current state of the pool. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and - \"Upgrading\".""" - replica_count: Optional[int] = rest_field(name="replicaCount", visibility=["read"]) - """Number of replicas in the pool.""" - version: Optional[str] = rest_field(visibility=["read"]) - """The version of the HorizonDB pool.""" - create_mode: Optional[Union[str, "_models.CreateModePool"]] = rest_field(name="createMode", visibility=["read"]) - """The create mode for the pool. Known values are: \"Create\" and \"Update\".""" + state: Union[str, "_models.AuthenticationState"] = rest_field(visibility=["read", "create", "update"]) + """The state of PostgreSQL username-and-password authentication. Required. Known values are: + \"Enabled\" and \"Disabled\".""" + administrator_login: Optional[str] = rest_field(name="administratorLogin", visibility=["create"]) + """The PostgreSQL administrator login name. This value is not returned in responses. After it is + set, renaming is not supported. Setting the login requires password authentication state to be + Enabled in the same request.""" + administrator_login_password: Optional[str] = rest_field( + name="administratorLoginPassword", visibility=["create", "update"] + ) + """The PostgreSQL administrator password. Setting the password requires password authentication + state to be Enabled in the same request.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """The provisioning state of the pool. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", - \"InProgress\", and \"Provisioning\".""" + """The provisioning state of the PostgreSQL username-and-password authentication method. Known + values are: \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" @overload def __init__( self, *, - location: Optional[str] = None, + state: Union[str, "_models.AuthenticationState"], + administrator_login: Optional[str] = None, + administrator_login_password: Optional[str] = None, ) -> None: ... @overload @@ -1223,8 +3868,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbPrivateLinkResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the HorizonDB private link resource. +class PasswordAuthenticationPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for updating PostgreSQL username-and-password authentication. Omitted properties + preserve their current values. This API version supports enabling or disabling the + authentication method, and resetting its password. Supported changes can be combined. + + :ivar state: The target password-authentication state. Enabled can be combined with + administratorLoginPassword to re-enable password authentication and reset the password for a + cluster that already has an administrator. Disabling password authentication does not remove or + modify existing database users or roles. Disabled cannot be combined with + administratorLoginPassword. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.horizondb.models.AuthenticationState + :ivar administrator_login_password: The PostgreSQL administrator password. Supplying this + property resets the configured administrator's password. When password authentication is + currently disabled for a cluster that already has an administrator, this property can be + combined with state Enabled to re-enable password authentication and reset the password. + :vartype administrator_login_password: str + """ + + state: Optional[Union[str, "_models.AuthenticationState"]] = rest_field(visibility=["update"]) + """The target password-authentication state. Enabled can be combined with + administratorLoginPassword to re-enable password authentication and reset the password for a + cluster that already has an administrator. Disabling password authentication does not remove or + modify existing database users or roles. Disabled cannot be combined with + administratorLoginPassword. Known values are: \"Enabled\" and \"Disabled\".""" + administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["update"]) + """The PostgreSQL administrator password. Supplying this property resets the configured + administrator's password. When password authentication is currently disabled for a cluster that + already has an administrator, this property can be combined with state Enabled to re-enable + password authentication and reset the password.""" + + @overload + def __init__( + self, + *, + state: Optional[Union[str, "_models.AuthenticationState"]] = None, + administrator_login_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Pool(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB pool. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -1238,19 +3934,24 @@ class HorizonDbPrivateLinkResource(ProxyResource): # pylint: disable=docstring- information. :vartype system_data: ~azure.mgmt.horizondb.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.PrivateLinkResourceProperties + :vartype properties: ~azure.mgmt.horizondb.models.PoolProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field( + properties: Optional["_models.PoolProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" @overload def __init__( self, *, - properties: Optional["_models.PrivateLinkResourceProperties"] = None, + properties: Optional["_models.PoolProperties"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1264,34 +3965,73 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplica(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the HorizonDB replica. +class PoolCapability(_Model): + """The HorizonDB Pool capabilities available in a location. + + :ivar recommended_compute_processor: The compute processor recommended for clients to select + for HorizonDB Pools in the region. This recommendation does not describe backend behavior when + the compute processor is omitted from a request. Required. Known values are: "Intel" and "AMD". + :vartype recommended_compute_processor: str or + ~azure.mgmt.horizondb.models.ComputeProcessorType + :ivar supported_processors: The processor families and their compute capabilities supported by + Pools in the region. Required. + :vartype supported_processors: list[~azure.mgmt.horizondb.models.ComputeProcessorCapability] + :ivar supported_features: Additional Pool features supported in the region independently of a + processor, generation, or compute model. Required. + :vartype supported_features: list[~azure.mgmt.horizondb.models.PoolFeatureCapability] + """ - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.horizondb.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaProperties + recommended_compute_processor: Union[str, "_models.ComputeProcessorType"] = rest_field( + name="recommendedComputeProcessor", visibility=["read"] + ) + """The compute processor recommended for clients to select for HorizonDB Pools in the region. This + recommendation does not describe backend behavior when the compute processor is omitted from a + request. Required. Known values are: \"Intel\" and \"AMD\".""" + supported_processors: list["_models.ComputeProcessorCapability"] = rest_field( + name="supportedProcessors", visibility=["read"] + ) + """The processor families and their compute capabilities supported by Pools in the region. + Required.""" + supported_features: list["_models.PoolFeatureCapability"] = rest_field( + name="supportedFeatures", visibility=["read"] + ) + """Additional Pool features supported in the region independently of a processor, generation, or + compute model. Required.""" + + +class PoolComputeModel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The compute model for a HorizonDB pool. + + :ivar type: The type of compute model. Required. "Provisioned" + :vartype type: str or ~azure.mgmt.horizondb.models.PoolComputeModelType + :ivar compute_processor: The processor type for the compute model. Required. Known values are: + "Intel" and "AMD". + :vartype compute_processor: str or ~azure.mgmt.horizondb.models.ComputeProcessorType + :ivar compute_generation: The compute generation for the compute model. Required. + :vartype compute_generation: int + :ivar v_cores: The number of vCores. Allowed values are 1 through 192. Required. + :vartype v_cores: int """ - properties: Optional["_models.HorizonDbReplicaProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Union[str, "_models.PoolComputeModelType"] = rest_field(visibility=["read", "create", "update"]) + """The type of compute model. Required. \"Provisioned\"""" + compute_processor: Union[str, "_models.ComputeProcessorType"] = rest_field( + name="computeProcessor", visibility=["read", "create", "update"] ) - """The resource-specific properties for this resource.""" + """The processor type for the compute model. Required. Known values are: \"Intel\" and \"AMD\".""" + compute_generation: int = rest_field(name="computeGeneration", visibility=["read", "create", "update"]) + """The compute generation for the compute model. Required.""" + v_cores: int = rest_field(name="vCores", visibility=["read", "create", "update"]) + """The number of vCores. Allowed values are 1 through 192. Required.""" @overload def __init__( self, *, - properties: Optional["_models.HorizonDbReplicaProperties"] = None, + type: Union[str, "_models.PoolComputeModelType"], + compute_processor: Union[str, "_models.ComputeProcessorType"], + compute_generation: int, + v_cores: int, ) -> None: ... @overload @@ -1305,23 +4045,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplicaForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """HorizonDB replica for update operations. - - :ivar properties: Properties of a HorizonDB replica for update operations. - :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate +class PoolComputeModelForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The compute model properties of a HorizonDB pool that can be updated. The object is recursively + mergeable: omitted properties preserve their current values. Properties that do not apply to + the current or target compute model type are rejected. When type changes, the request must + include the complete target compute model. Subtype-specific constraints are validated against + the effective merged configuration; invalid requests are rejected without changing the + resource. + + :ivar type: The compute model type. Omit this property to retain the current type. Resubmitting + the current type succeeds as an idempotent no-op. To change the type, supply all common + properties and all properties required by the target type. "Provisioned" + :vartype type: str or ~azure.mgmt.horizondb.models.PoolComputeModelType + :ivar compute_processor: The processor type for the compute model. Omission preserves the + current processor type. Known values are: "Intel" and "AMD". + :vartype compute_processor: str or ~azure.mgmt.horizondb.models.ComputeProcessorType + :ivar compute_generation: The compute generation for the compute model. Omission preserves the + current compute generation. + :vartype compute_generation: int + :ivar v_cores: The number of provisioned vCores. Allowed values are 1 through 192. This + property applies only to a Provisioned compute model. Omission preserves the current value. + :vartype v_cores: int """ - properties: Optional["_models.HorizonDbReplicaPropertiesForPatchUpdate"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Optional[Union[str, "_models.PoolComputeModelType"]] = rest_field(visibility=["update"]) + """The compute model type. Omit this property to retain the current type. Resubmitting the current + type succeeds as an idempotent no-op. To change the type, supply all common properties and all + properties required by the target type. \"Provisioned\"""" + compute_processor: Optional[Union[str, "_models.ComputeProcessorType"]] = rest_field( + name="computeProcessor", visibility=["update"] ) - """Properties of a HorizonDB replica for update operations.""" + """The processor type for the compute model. Omission preserves the current processor type. Known + values are: \"Intel\" and \"AMD\".""" + compute_generation: Optional[int] = rest_field(name="computeGeneration", visibility=["update"]) + """The compute generation for the compute model. Omission preserves the current compute + generation.""" + v_cores: Optional[int] = rest_field(name="vCores", visibility=["update"]) + """The number of provisioned vCores. Allowed values are 1 through 192. This property applies only + to a Provisioned compute model. Omission preserves the current value.""" @overload def __init__( self, *, - properties: Optional["_models.HorizonDbReplicaPropertiesForPatchUpdate"] = None, + type: Optional[Union[str, "_models.PoolComputeModelType"]] = None, + compute_processor: Optional[Union[str, "_models.ComputeProcessorType"]] = None, + compute_generation: Optional[int] = None, + v_cores: Optional[int] = None, ) -> None: ... @overload @@ -1335,47 +4105,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplicaProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB replica. +class PoolFeatureCapability(_Model): + """A HorizonDB Pool feature supported in a location. - :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". - :vartype role: str or ~azure.mgmt.horizondb.models.ReplicaRole - :ivar status: Current status of the replica. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". - :vartype status: str or ~azure.mgmt.horizondb.models.State - :ivar fully_qualified_domain_name: The fully qualified domain name of the replica. - :vartype fully_qualified_domain_name: str - :ivar availability_zone: The availability zone of the replica. - :vartype availability_zone: str - :ivar provisioning_state: The provisioning state of the replica. Known values are: "Succeeded", - "Failed", "Canceled", "InProgress", and "Provisioning". - :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + :ivar name: The name of the Pool feature. Required. + :vartype name: str """ - role: Optional[Union[str, "_models.ReplicaRole"]] = rest_field(visibility=["read", "create", "update"]) - """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" - status: Optional[Union[str, "_models.State"]] = rest_field(visibility=["read"]) - """Current status of the replica. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and - \"Upgrading\".""" - fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) - """The fully qualified domain name of the replica.""" - availability_zone: Optional[str] = rest_field( - name="availabilityZone", visibility=["read", "create", "update", "delete", "query"] - ) - """The availability zone of the replica.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + name: str = rest_field(visibility=["read"]) + """The name of the Pool feature. Required.""" + + +class PoolForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HorizonDB pool for update operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The properties that can be updated for a HorizonDB pool. + :vartype properties: ~azure.mgmt.horizondb.models.PoolPropertiesForPatchUpdate + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.PoolPropertiesForPatchUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The provisioning state of the replica. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" + """The properties that can be updated for a HorizonDB pool.""" @overload def __init__( self, *, - role: Optional[Union[str, "_models.ReplicaRole"]] = None, - availability_zone: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.PoolPropertiesForPatchUpdate"] = None, ) -> None: ... @overload @@ -1389,21 +4151,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplicaPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB replica for update operations. +class PoolHighAvailability(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The high-availability configuration for a HorizonDB pool. - :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". - :vartype role: str or ~azure.mgmt.horizondb.models.ReplicaRole + :ivar mode: The high-availability mode. Disabled is required when nodeCount is 1. AnyZone or + ZoneRedundant is required when nodeCount is 2 through 16. Required. Known values are: + "Disabled", "AnyZone", and "ZoneRedundant". + :vartype mode: str or ~azure.mgmt.horizondb.models.PoolHighAvailabilityMode """ - role: Optional[Union[str, "_models.ReplicaRole"]] = rest_field(visibility=["update"]) - """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" + mode: Union[str, "_models.PoolHighAvailabilityMode"] = rest_field(visibility=["read", "create", "update"]) + """The high-availability mode. Disabled is required when nodeCount is 1. AnyZone or ZoneRedundant + is required when nodeCount is 2 through 16. Required. Known values are: \"Disabled\", + \"AnyZone\", and \"ZoneRedundant\".""" @overload def __init__( self, *, - role: Optional[Union[str, "_models.ReplicaRole"]] = None, + mode: Union[str, "_models.PoolHighAvailabilityMode"], ) -> None: ... @overload @@ -1417,44 +4183,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed service identity (system assigned and/or user assigned identities). +class PoolHighAvailabilityPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The high-availability configuration for a HorizonDB pool update. - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.horizondb.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.horizondb.models.UserAssignedIdentity] + :ivar mode: The high-availability mode. Omission preserves the current mode before the service + validates it with the effective nodeCount. Known values are: "Disabled", "AnyZone", and + "ZoneRedundant". + :vartype mode: str or ~azure.mgmt.horizondb.models.PoolHighAvailabilityMode """ - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """The identities assigned to this resource by the user.""" + mode: Optional[Union[str, "_models.PoolHighAvailabilityMode"]] = rest_field(visibility=["update"]) + """The high-availability mode. Omission preserves the current mode before the service validates it + with the effective nodeCount. Known values are: \"Disabled\", \"AnyZone\", and + \"ZoneRedundant\".""" @overload def __init__( self, *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + mode: Optional[Union[str, "_models.PoolHighAvailabilityMode"]] = None, ) -> None: ... @overload @@ -1468,65 +4215,105 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Network(_Model): - """Network properties. - - :ivar public_network_access: The flag indicating whether public ip is requested. Known values - are: "Enabled" and "Disabled". - :vartype public_network_access: str or ~azure.mgmt.horizondb.models.PublicNetworkAccessState +class PoolParameterGroupReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to the parameter group associated with a HorizonDB pool. The schema represents both + default and customer-created parameter groups for create and update compatibility. In this API + version, initial pool creation accepts only the corresponding default parameter group; PUT + updates to an existing pool can associate either group type. + + :ivar parameter_group_resource_id: The Azure resource ID of the associated parameter group. + Initial pool creation in this API version requires the corresponding + Microsoft.HorizonDb/locations/parameterGroups resource. For an existing pool, PUT can specify + either the corresponding default group or a customer-created + Microsoft.HorizonDb/parameterGroups resource. Required. + :vartype parameter_group_resource_id: str + :ivar apply_method: Determines when dynamic parameter changes from the associated parameter + group become effective. Static parameter changes always require a customer-initiated pool + Restart, regardless of this value. Stop followed by Start and scheduled maintenance do not + apply pending parameter changes. Required. Known values are: "Immediate" and "PendingReboot". + :vartype apply_method: str or ~azure.mgmt.horizondb.models.ParameterApplyMethod + :ivar sync_status: The synchronization status between the pool and its parameter group. + PendingReboot changes remain pending across Stop, Start, and scheduled maintenance and become + effective only after a customer-initiated Restart. Known values are: "Applying", "InSync", + "FailedToApply", and "PendingReboot". + :vartype sync_status: str or ~azure.mgmt.horizondb.models.ParameterGroupSyncStatus """ - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessState"]] = rest_field( - name="publicNetworkAccess", visibility=["read"] + parameter_group_resource_id: str = rest_field( + name="parameterGroupResourceId", visibility=["read", "create", "update"] ) - """The flag indicating whether public ip is requested. Known values are: \"Enabled\" and - \"Disabled\".""" - + """The Azure resource ID of the associated parameter group. Initial pool creation in this API + version requires the corresponding Microsoft.HorizonDb/locations/parameterGroups resource. For + an existing pool, PUT can specify either the corresponding default group or a customer-created + Microsoft.HorizonDb/parameterGroups resource. Required.""" + apply_method: Union[str, "_models.ParameterApplyMethod"] = rest_field( + name="applyMethod", visibility=["read", "create", "update"] + ) + """Determines when dynamic parameter changes from the associated parameter group become effective. + Static parameter changes always require a customer-initiated pool Restart, regardless of this + value. Stop followed by Start and scheduled maintenance do not apply pending parameter changes. + Required. Known values are: \"Immediate\" and \"PendingReboot\".""" + sync_status: Optional[Union[str, "_models.ParameterGroupSyncStatus"]] = rest_field( + name="syncStatus", visibility=["read"] + ) + """The synchronization status between the pool and its parameter group. PendingReboot changes + remain pending across Stop, Start, and scheduled maintenance and become effective only after a + customer-initiated Restart. Known values are: \"Applying\", \"InSync\", \"FailedToApply\", and + \"PendingReboot\".""" -class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """REST API Operation. + @overload + def __init__( + self, + *, + parameter_group_resource_id: str, + apply_method: Union[str, "_models.ParameterApplyMethod"], + ) -> None: ... - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for Azure Resource Manager/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.horizondb.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.horizondb.models.Origin - :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions - that are for internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.horizondb.models.ActionType + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PoolParameterGroupReferenceForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A parameter group reference for updating an existing HorizonDB pool. The pool can switch in + either direction between its corresponding default parameter group and a customer-created + parameter group. + + :ivar parameter_group_resource_id: The Azure resource ID of the corresponding default or + customer-created parameter group to associate with the existing pool. + :vartype parameter_group_resource_id: str + :ivar apply_method: Determines when dynamic parameter changes from the associated parameter + group become effective. Static parameter changes always require a customer-initiated pool + Restart, regardless of this value. Stop followed by Start and scheduled maintenance do not + apply pending parameter changes. Known values are: "Immediate" and "PendingReboot". + :vartype apply_method: str or ~azure.mgmt.horizondb.models.ParameterApplyMethod """ - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - \"Microsoft.Compute/virtualMachines/write\", - \"Microsoft.Compute/virtualMachines/capture/action\".""" - is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) - """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and - \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + parameter_group_resource_id: Optional[str] = rest_field(name="parameterGroupResourceId", visibility=["update"]) + """The Azure resource ID of the corresponding default or customer-created parameter group to + associate with the existing pool.""" + apply_method: Optional[Union[str, "_models.ParameterApplyMethod"]] = rest_field( + name="applyMethod", visibility=["update"] ) - """Localized display information for this particular operation.""" - origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and - \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) - """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for - internal only APIs. \"Internal\"""" + """Determines when dynamic parameter changes from the associated parameter group become effective. + Static parameter changes always require a customer-initiated pool Restart, regardless of this + value. Stop followed by Start and scheduled maintenance do not apply pending parameter changes. + Known values are: \"Immediate\" and \"PendingReboot\".""" @overload def __init__( self, *, - display: Optional["_models.OperationDisplay"] = None, + parameter_group_resource_id: Optional[str] = None, + apply_method: Optional[Union[str, "_models.ParameterApplyMethod"]] = None, ) -> None: ... @overload @@ -1540,85 +4327,161 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_Model): - """Localized display information for an operation. +class PoolProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB pool. - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str + :ivar state: Current state of the pool. Known values are: "Ready", "Provisioning", "Deleting", + "Inaccessible", "Updating", "Starting", "Restarting", "Stopping", and "Stopped". + :vartype state: str or ~azure.mgmt.horizondb.models.PoolState + :ivar compute_model: The required compute model for the HorizonDB pool. Required. + :vartype compute_model: ~azure.mgmt.horizondb.models.PoolComputeModel + :ivar node_count: The required number of nodes to allocate and assign to the pool. Allowed + values are 1 through 16. To deallocate runtime compute without changing the configured node + count, stop the pool. Required. + :vartype node_count: int + :ivar high_availability: The required high-availability configuration for the pool. mode must + be Disabled when nodeCount is 1, and must be AnyZone or ZoneRedundant when nodeCount is 2 + through 16. Required. + :vartype high_availability: ~azure.mgmt.horizondb.models.PoolHighAvailability + :ivar parameter_group: The required parameter group associated with the pool. When creating a + new pool in this API version, the caller must supply the corresponding default parameter group; + customer-created parameter groups are not accepted during creation. For an existing pool, PUT + or PATCH can associate either the corresponding default parameter group or a customer-created + parameter group. The create-visible shape intentionally supports both resource ID forms so a + future API version can allow customer-created parameter groups during creation without a + breaking schema change. Required. + :vartype parameter_group: ~azure.mgmt.horizondb.models.PoolParameterGroupReference + :ivar scheduled_maintenance: The scheduled maintenance configuration for the pool. The + properties available depend on the selected maintenance management type. + :vartype scheduled_maintenance: ~azure.mgmt.horizondb.models.ScheduledMaintenanceProperties + :ivar provisioning_state: The provisioning state of the pool. Known values are: "Succeeded", + "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState """ - provider: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring - Insights\" or \"Microsoft Compute\".""" - resource: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly name of the resource type related to this operation. E.g. \"Virtual - Machines\" or \"Job Schedule Collections\".""" - operation: Optional[str] = rest_field(visibility=["read"]) - """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create - or Update Virtual Machine\", \"Restart Virtual Machine\".""" - description: Optional[str] = rest_field(visibility=["read"]) - """The short, localized friendly description of the operation; suitable for tool tips and detailed - views.""" + state: Optional[Union[str, "_models.PoolState"]] = rest_field(visibility=["read"]) + """Current state of the pool. Known values are: \"Ready\", \"Provisioning\", \"Deleting\", + \"Inaccessible\", \"Updating\", \"Starting\", \"Restarting\", \"Stopping\", and \"Stopped\".""" + compute_model: "_models.PoolComputeModel" = rest_field(name="computeModel", visibility=["read", "create", "update"]) + """The required compute model for the HorizonDB pool. Required.""" + node_count: int = rest_field(name="nodeCount", visibility=["read", "create", "update"]) + """The required number of nodes to allocate and assign to the pool. Allowed values are 1 through + 16. To deallocate runtime compute without changing the configured node count, stop the pool. + Required.""" + high_availability: "_models.PoolHighAvailability" = rest_field( + name="highAvailability", visibility=["read", "create", "update"] + ) + """The required high-availability configuration for the pool. mode must be Disabled when nodeCount + is 1, and must be AnyZone or ZoneRedundant when nodeCount is 2 through 16. Required.""" + parameter_group: "_models.PoolParameterGroupReference" = rest_field( + name="parameterGroup", visibility=["read", "create", "update"] + ) + """The required parameter group associated with the pool. When creating a new pool in this API + version, the caller must supply the corresponding default parameter group; customer-created + parameter groups are not accepted during creation. For an existing pool, PUT or PATCH can + associate either the corresponding default parameter group or a customer-created parameter + group. The create-visible shape intentionally supports both resource ID forms so a future API + version can allow customer-created parameter groups during creation without a breaking schema + change. Required.""" + scheduled_maintenance: Optional["_models.ScheduledMaintenanceProperties"] = rest_field( + name="scheduledMaintenance", visibility=["read", "create", "update"] + ) + """The scheduled maintenance configuration for the pool. The properties available depend on the + selected maintenance management type.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the pool. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"InProgress\", and \"Provisioning\".""" + @overload + def __init__( + self, + *, + compute_model: "_models.PoolComputeModel", + node_count: int, + high_availability: "_models.PoolHighAvailability", + parameter_group: "_models.PoolParameterGroupReference", + scheduled_maintenance: Optional["_models.ScheduledMaintenanceProperties"] = None, + ) -> None: ... -class ParameterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a HorizonDB parameters. + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ - :ivar name: The name of the parameter. - :vartype name: str - :ivar description: The description of the parameter. - :vartype description: str - :ivar value: The value of the configuration. - :vartype value: str - :ivar data_type: The data type of the parameter. - :vartype data_type: str - :ivar allowed_values: The allowed values for the parameter. - :vartype allowed_values: str - :ivar is_dynamic: Whether the parameter can be changed dynamically. - :vartype is_dynamic: bool - :ivar is_read_only: Whether the parameter is a read-only parameter. - :vartype is_read_only: bool - :ivar documentation_link: Link to parameter documentation. - :vartype documentation_link: str - :ivar unit: The unit of measurement for the parameter. - :vartype unit: str + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PoolPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB pool for update operations. + + :ivar compute_model: The compute model properties to update. Omitted properties preserve their + current values. To change the compute model type, supply the complete target compute model, + including type, computeProcessor, computeGeneration, and all properties required by the target + type. + :vartype compute_model: ~azure.mgmt.horizondb.models.PoolComputeModelForPatchUpdate + :ivar node_count: The number of nodes to allocate and assign to the pool. Allowed values are 1 + through 16. Omission preserves the current configured value. To deallocate runtime compute + without changing the configured node count, stop the pool. + :vartype node_count: int + :ivar high_availability: The high-availability configuration to update. Omission preserves the + current mode. The service recursively merges omitted PATCH properties with the existing + resource before validating the effective nodeCount and mode together. + :vartype high_availability: ~azure.mgmt.horizondb.models.PoolHighAvailabilityPatch + :ivar parameter_group: The corresponding default or a customer-created parameter group to + associate with the existing pool. Customers can switch in either direction between these group + types. Omission preserves the current association. + :vartype parameter_group: + ~azure.mgmt.horizondb.models.PoolParameterGroupReferenceForPatchUpdate + :ivar scheduled_maintenance: The scheduled maintenance configuration to update for the pool. + When supplied, the complete configuration for the selected maintenance management type is + required. Omission preserves the current configuration. + :vartype scheduled_maintenance: + ~azure.mgmt.horizondb.models.ScheduledMaintenancePropertiesForPatchUpdate """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the parameter.""" - description: Optional[str] = rest_field(visibility=["read"]) - """The description of the parameter.""" - value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The value of the configuration.""" - data_type: Optional[str] = rest_field(name="dataType", visibility=["read"]) - """The data type of the parameter.""" - allowed_values: Optional[str] = rest_field(name="allowedValues", visibility=["read"]) - """The allowed values for the parameter.""" - is_dynamic: Optional[bool] = rest_field(name="isDynamic", visibility=["read"]) - """Whether the parameter can be changed dynamically.""" - is_read_only: Optional[bool] = rest_field(name="isReadOnly", visibility=["read"]) - """Whether the parameter is a read-only parameter.""" - documentation_link: Optional[str] = rest_field(name="documentationLink", visibility=["read"]) - """Link to parameter documentation.""" - unit: Optional[str] = rest_field(visibility=["read"]) - """The unit of measurement for the parameter.""" + compute_model: Optional["_models.PoolComputeModelForPatchUpdate"] = rest_field( + name="computeModel", visibility=["update"] + ) + """The compute model properties to update. Omitted properties preserve their current values. To + change the compute model type, supply the complete target compute model, including type, + computeProcessor, computeGeneration, and all properties required by the target type.""" + node_count: Optional[int] = rest_field(name="nodeCount", visibility=["update"]) + """The number of nodes to allocate and assign to the pool. Allowed values are 1 through 16. + Omission preserves the current configured value. To deallocate runtime compute without changing + the configured node count, stop the pool.""" + high_availability: Optional["_models.PoolHighAvailabilityPatch"] = rest_field( + name="highAvailability", visibility=["update"] + ) + """The high-availability configuration to update. Omission preserves the current mode. The service + recursively merges omitted PATCH properties with the existing resource before validating the + effective nodeCount and mode together.""" + parameter_group: Optional["_models.PoolParameterGroupReferenceForPatchUpdate"] = rest_field( + name="parameterGroup", visibility=["update"] + ) + """The corresponding default or a customer-created parameter group to associate with the existing + pool. Customers can switch in either direction between these group types. Omission preserves + the current association.""" + scheduled_maintenance: Optional["_models.ScheduledMaintenancePropertiesForPatchUpdate"] = rest_field( + name="scheduledMaintenance", visibility=["update"] + ) + """The scheduled maintenance configuration to update for the pool. When supplied, the complete + configuration for the selected maintenance management type is required. Omission preserves the + current configuration.""" @overload def __init__( self, *, - name: Optional[str] = None, - value: Optional[str] = None, + compute_model: Optional["_models.PoolComputeModelForPatchUpdate"] = None, + node_count: Optional[int] = None, + high_availability: Optional["_models.PoolHighAvailabilityPatch"] = None, + parameter_group: Optional["_models.PoolParameterGroupReferenceForPatchUpdate"] = None, + scheduled_maintenance: Optional["_models.ScheduledMaintenancePropertiesForPatchUpdate"] = None, ) -> None: ... @overload @@ -1632,6 +4495,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class PostgreSqlVersionCapability(_Model): + """The capabilities of a PostgreSQL major version supported by HorizonDB. + + :ivar name: The PostgreSQL major version. Required. Known values are: "17" and "18". + :vartype name: str or ~azure.mgmt.horizondb.models.PostgreSqlCapabilityVersion + :ivar supported_versions_to_upgrade: The PostgreSQL major versions to which this version can be + upgraded in place. API version 2026-10-01-preview does not support in-place PostgreSQL + major-version upgrades, so this array is always empty. Required. + :vartype supported_versions_to_upgrade: list[str or + ~azure.mgmt.horizondb.models.PostgreSqlCapabilityVersion] + """ + + name: Union[str, "_models.PostgreSqlCapabilityVersion"] = rest_field(visibility=["read"]) + """The PostgreSQL major version. Required. Known values are: \"17\" and \"18\".""" + supported_versions_to_upgrade: list[Union[str, "_models.PostgreSqlCapabilityVersion"]] = rest_field( + name="supportedVersionsToUpgrade", visibility=["read"] + ) + """The PostgreSQL major versions to which this version can be upgraded in place. API version + 2026-10-01-preview does not support in-place PostgreSQL major-version upgrades, so this array + is always empty. Required.""" + + class PrivateEndpoint(_Model): """The private endpoint resource. @@ -1737,6 +4622,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class PrivateLinkResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB private link resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.PrivateLinkResourceProperties + """ + + properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.PrivateLinkResourceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class PrivateLinkResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a private link resource. @@ -1821,6 +4747,143 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ProvisionedComputeModelCapability(ComputeModelCapability, discriminator="Provisioned"): + """The capabilities of the Provisioned compute model. + + :ivar type: The compute model represented by these capabilities. Required. Provisioned compute + model. + :vartype type: str or ~azure.mgmt.horizondb.models.PROVISIONED + :ivar recommended_v_core_count: The provisioned vCore count recommended for clients to select. + This recommendation does not describe backend behavior when vCores is omitted from a request. + Required. + :vartype recommended_v_core_count: int + :ivar supported_compute_sizes: The supported provisioned compute sizes. Required. + :vartype supported_compute_sizes: list[~azure.mgmt.horizondb.models.ComputeSizeCapability] + """ + + type: Literal[PoolComputeModelType.PROVISIONED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The compute model represented by these capabilities. Required. Provisioned compute model.""" + recommended_v_core_count: int = rest_field(name="recommendedVCoreCount", visibility=["read"]) + """The provisioned vCore count recommended for clients to select. This recommendation does not + describe backend behavior when vCores is omitted from a request. Required.""" + supported_compute_sizes: list["_models.ComputeSizeCapability"] = rest_field( + name="supportedComputeSizes", visibility=["read"] + ) + """The supported provisioned compute sizes. Required.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = PoolComputeModelType.PROVISIONED # type: ignore + + +class ReadWritePoolProperties(_Model): + """The pool currently designated to host a HorizonDB cluster's read-write node. When a pool is + created while the cluster currently has no pools, the service automatically designates the new + pool as the read-write pool. This behavior also applies after all pools that existed earlier in + the cluster's lifetime have been deleted. + + :ivar designated_pool_resource_id: The Azure resource ID of the pool designated to host the + cluster's read-write node. The pool is a child resource of this cluster. When a pool is created + while the cluster currently has no pools, the service automatically sets this property to the + new pool's resource ID, including when all pools that existed earlier in the cluster's lifetime + were deleted. This property is absent when no pool is designated, such as after + clearReadWritePool succeeds. + :vartype designated_pool_resource_id: str + """ + + designated_pool_resource_id: Optional[str] = rest_field(name="designatedPoolResourceId", visibility=["read"]) + """The Azure resource ID of the pool designated to host the cluster's read-write node. The pool is + a child resource of this cluster. When a pool is created while the cluster currently has no + pools, the service automatically sets this property to the new pool's resource ID, including + when all pools that existed earlier in the cluster's lifetime were deleted. This property is + absent when no pool is designated, such as after clearReadWritePool succeeds.""" + + +class ScheduledMaintenanceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The scheduled maintenance configuration for a HorizonDB pool. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SystemScheduledMaintenanceProperties + + :ivar maintenance_management_type: Specifies whether scheduled maintenance is managed by the + system or by the user. Required. "System" + :vartype maintenance_management_type: str or + ~azure.mgmt.horizondb.models.ScheduledMaintenanceManagementType + """ + + __mapping__: dict[str, _Model] = {} + maintenance_management_type: str = rest_discriminator( + name="maintenanceManagementType", visibility=["read", "create", "update"] + ) + """Specifies whether scheduled maintenance is managed by the system or by the user. Required. + \"System\"""" + + @overload + def __init__( + self, + *, + maintenance_management_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduledMaintenancePropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The scheduled maintenance configuration for a pool update operation. + + :ivar maintenance_management_type: Specifies whether scheduled maintenance is managed by the + system or by the user. When scheduledMaintenance is supplied, this property is required by the + service. "System" + :vartype maintenance_management_type: str or + ~azure.mgmt.horizondb.models.ScheduledMaintenanceManagementType + """ + + maintenance_management_type: Optional[Union[str, "_models.ScheduledMaintenanceManagementType"]] = rest_field( + name="maintenanceManagementType", visibility=["update"] + ) + """Specifies whether scheduled maintenance is managed by the system or by the user. When + scheduledMaintenance is supplied, this property is required by the service. \"System\"""" + + @overload + def __init__( + self, + *, + maintenance_management_type: Optional[Union[str, "_models.ScheduledMaintenanceManagementType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. @@ -1888,6 +4951,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class SystemScheduledMaintenanceProperties(ScheduledMaintenanceProperties, discriminator="System"): + """The system-managed scheduled maintenance configuration for a HorizonDB pool. User-managed + schedule properties must be absent. + + :ivar maintenance_management_type: Specifies that scheduled maintenance is managed by the + system. Required. Scheduled maintenance is managed by the system. + :vartype maintenance_management_type: str or ~azure.mgmt.horizondb.models.SYSTEM + """ + + maintenance_management_type: Literal[ScheduledMaintenanceManagementType.SYSTEM] = rest_discriminator(name="maintenanceManagementType", visibility=["read", "create", "update"]) # type: ignore + """Specifies that scheduled maintenance is managed by the system. Required. Scheduled maintenance + is managed by the system.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.maintenance_management_type = ScheduledMaintenanceManagementType.SYSTEM # type: ignore + + class UserAssignedIdentity(_Model): """User assigned identity properties. diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py index 660c577f1dc7..9c131611bcc1 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py @@ -13,14 +13,27 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._operations import HorizonDbClustersOperations # type: ignore -from ._operations import HorizonDbPoolsOperations # type: ignore -from ._operations import HorizonDbReplicasOperations # type: ignore -from ._operations import HorizonDbFirewallRulesOperations # type: ignore -from ._operations import HorizonDbPrivateEndpointConnectionsOperations # type: ignore -from ._operations import HorizonDbPrivateLinkResourcesOperations # type: ignore -from ._operations import HorizonDbParameterGroupsOperations # type: ignore -from ._operations import HorizonDbAdministratorsOperations # type: ignore +from ._operations import CapabilitiesOperations # type: ignore +from ._operations import ClustersOperations # type: ignore +from ._operations import PoolsOperations # type: ignore +from ._operations import FirewallRulesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import PrivateLinkResourcesOperations # type: ignore +from ._operations import ParameterGroupsOperations # type: ignore +from ._operations import DefaultParameterGroupsOperations # type: ignore +from ._operations import MicrosoftEntraAdministratorsOperations # type: ignore +from ._operations import AuthenticationsOperations # type: ignore +from ._operations import PasswordAuthenticationsOperations # type: ignore +from ._operations import MicrosoftEntraAuthenticationsOperations # type: ignore +from ._operations import ChangeDataCaptureCapabilitiesOperations # type: ignore +from ._operations import ChangeDataCaptureDestinationsOperations # type: ignore +from ._operations import IdentityAssignmentsOperations # type: ignore +from ._operations import ChangeDataCaptureConfigurationsOperations # type: ignore +from ._operations import EndpointsOperations # type: ignore +from ._operations import MaintenanceEventsOperations # type: ignore +from ._operations import NodesOperations # type: ignore +from ._operations import LogCaptureConfigurationsOperations # type: ignore +from ._operations import LogFilesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -28,14 +41,27 @@ __all__ = [ "Operations", - "HorizonDbClustersOperations", - "HorizonDbPoolsOperations", - "HorizonDbReplicasOperations", - "HorizonDbFirewallRulesOperations", - "HorizonDbPrivateEndpointConnectionsOperations", - "HorizonDbPrivateLinkResourcesOperations", - "HorizonDbParameterGroupsOperations", - "HorizonDbAdministratorsOperations", + "CapabilitiesOperations", + "ClustersOperations", + "PoolsOperations", + "FirewallRulesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ParameterGroupsOperations", + "DefaultParameterGroupsOperations", + "MicrosoftEntraAdministratorsOperations", + "AuthenticationsOperations", + "PasswordAuthenticationsOperations", + "MicrosoftEntraAuthenticationsOperations", + "ChangeDataCaptureCapabilitiesOperations", + "ChangeDataCaptureDestinationsOperations", + "IdentityAssignmentsOperations", + "ChangeDataCaptureConfigurationsOperations", + "EndpointsOperations", + "MaintenanceEventsOperations", + "NodesOperations", + "LogCaptureConfigurationsOperations", + "LogFilesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py index a837d1891469..d19a3b2f8bc4 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py @@ -12,11 +12,12 @@ from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import PipelineClient +from azure.core import MatchConditions, PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -36,7 +37,7 @@ from .._configuration import HorizonDBMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer -from .._validation import api_version_validation +from .._utils.utils import prep_if_match, prep_if_none_match T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -50,7 +51,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,13 +66,63 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_get_request( +def build_capabilities_get_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HorizonDb/locations/{location}/capabilities/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_capabilities_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HorizonDb/locations/{location}/capabilities" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_get_request( resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,14 +144,14 @@ def build_horizon_db_clusters_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_create_or_update_request( # pylint: disable=name-too-long +def build_clusters_create_or_replace_request( resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,14 +175,14 @@ def build_horizon_db_clusters_create_or_update_request( # pylint: disable=name- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_update_request( +def build_clusters_update_request( resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,12 +206,12 @@ def build_horizon_db_clusters_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_delete_request( +def build_clusters_delete_request( resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}" path_format_arguments = { @@ -177,13 +228,13 @@ def build_horizon_db_clusters_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_horizon_db_clusters_list_by_resource_group_request( # pylint: disable=name-too-long +def build_clusters_list_by_resource_group_request( # pylint: disable=name-too-long resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,13 +255,13 @@ def build_horizon_db_clusters_list_by_resource_group_request( # pylint: disable return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_list_by_subscription_request( # pylint: disable=name-too-long +def build_clusters_list_by_subscription_request( # pylint: disable=name-too-long subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,17 +281,17 @@ def build_horizon_db_clusters_list_by_subscription_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_start_request( +def build_clusters_failover_request( resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/start" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/failover" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -258,21 +309,22 @@ def build_horizon_db_clusters_start_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_stop_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +def build_pools_get_request( + resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/stop" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -283,24 +335,26 @@ def build_horizon_db_clusters_stop_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_clusters_restart_request( # pylint: disable=name-too-long - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +def build_pools_create_or_replace_request( + resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/restart" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -309,18 +363,21 @@ def build_horizon_db_clusters_restart_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_pools_get_request( +def build_pools_update_request( resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -338,26 +395,26 @@ def build_horizon_db_pools_get_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_pools_list_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +def build_pools_delete_request( + resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -365,29 +422,24 @@ def build_horizon_db_pools_list_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_horizon_db_replicas_get_request( - resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, subscription_id: str, **kwargs: Any +def build_pools_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "replicaName": _SERIALIZER.url("replica_name", replica_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -401,17 +453,17 @@ def build_horizon_db_replicas_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_replicas_list_request( +def build_pools_start_request( resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/start" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -427,27 +479,25 @@ def build_horizon_db_replicas_list_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_replicas_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, subscription_id: str, **kwargs: Any +def build_pools_stop_request( + resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/stop" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "replicaName": _SERIALIZER.url("replica_name", replica_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -456,31 +506,27 @@ def build_horizon_db_replicas_create_or_update_request( # pylint: disable=name- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_replicas_update_request( - resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, subscription_id: str, **kwargs: Any +def build_pools_restart_request( + resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/restart" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "replicaName": _SERIALIZER.url("replica_name", replica_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -489,38 +535,12 @@ def build_horizon_db_replicas_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_horizon_db_replicas_delete_request( - resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "replicaName": _SERIALIZER.url("replica_name", replica_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_firewall_rules_get_request( # pylint: disable=name-too-long +def build_firewall_rules_get_request( resource_group_name: str, cluster_name: str, pool_name: str, @@ -531,7 +551,7 @@ def build_horizon_db_firewall_rules_get_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -555,13 +575,13 @@ def build_horizon_db_firewall_rules_get_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_firewall_rules_list_request( # pylint: disable=name-too-long +def build_firewall_rules_list_request( resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -584,7 +604,7 @@ def build_horizon_db_firewall_rules_list_request( # pylint: disable=name-too-lo return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_firewall_rules_create_or_update_request( # pylint: disable=name-too-long +def build_firewall_rules_create_or_replace_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, pool_name: str, @@ -596,7 +616,7 @@ def build_horizon_db_firewall_rules_create_or_update_request( # pylint: disable _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -622,7 +642,7 @@ def build_horizon_db_firewall_rules_create_or_update_request( # pylint: disable return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_firewall_rules_delete_request( # pylint: disable=name-too-long +def build_firewall_rules_delete_request( resource_group_name: str, cluster_name: str, pool_name: str, @@ -632,7 +652,7 @@ def build_horizon_db_firewall_rules_delete_request( # pylint: disable=name-too- ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}" path_format_arguments = { @@ -651,7 +671,7 @@ def build_horizon_db_firewall_rules_delete_request( # pylint: disable=name-too- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_horizon_db_private_endpoint_connections_get_request( # pylint: disable=name-too-long +def build_private_endpoint_connections_get_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, @@ -661,7 +681,7 @@ def build_horizon_db_private_endpoint_connections_get_request( # pylint: disabl _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,13 +706,13 @@ def build_horizon_db_private_endpoint_connections_get_request( # pylint: disabl return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_private_endpoint_connections_list_request( # pylint: disable=name-too-long +def build_private_endpoint_connections_list_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -714,7 +734,7 @@ def build_horizon_db_private_endpoint_connections_list_request( # pylint: disab return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_private_endpoint_connections_update_status_request( # pylint: disable=name-too-long +def build_private_endpoint_connections_approve_or_reject_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, @@ -725,7 +745,7 @@ def build_horizon_db_private_endpoint_connections_update_status_request( # pyli _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -752,7 +772,7 @@ def build_horizon_db_private_endpoint_connections_update_status_request( # pyli return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_private_endpoint_connections_delete_request( # pylint: disable=name-too-long +def build_private_endpoint_connections_delete_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, @@ -761,7 +781,7 @@ def build_horizon_db_private_endpoint_connections_delete_request( # pylint: dis ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -781,13 +801,13 @@ def build_horizon_db_private_endpoint_connections_delete_request( # pylint: dis return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_horizon_db_private_link_resources_get_request( # pylint: disable=name-too-long +def build_private_link_resources_get_request( resource_group_name: str, cluster_name: str, group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -810,13 +830,13 @@ def build_horizon_db_private_link_resources_get_request( # pylint: disable=name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_private_link_resources_list_request( # pylint: disable=name-too-long +def build_private_link_resources_list_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -838,13 +858,13 @@ def build_horizon_db_private_link_resources_list_request( # pylint: disable=nam return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_get_request( # pylint: disable=name-too-long +def build_parameter_groups_get_request( resource_group_name: str, parameter_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -866,14 +886,14 @@ def build_horizon_db_parameter_groups_get_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_create_or_update_request( # pylint: disable=name-too-long +def build_parameter_groups_create_or_replace_request( # pylint: disable=name-too-long resource_group_name: str, parameter_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -897,14 +917,14 @@ def build_horizon_db_parameter_groups_create_or_update_request( # pylint: disab return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_update_request( # pylint: disable=name-too-long +def build_parameter_groups_update_request( resource_group_name: str, parameter_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -928,12 +948,12 @@ def build_horizon_db_parameter_groups_update_request( # pylint: disable=name-to return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_delete_request( # pylint: disable=name-too-long +def build_parameter_groups_delete_request( resource_group_name: str, parameter_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}" path_format_arguments = { @@ -950,13 +970,13 @@ def build_horizon_db_parameter_groups_delete_request( # pylint: disable=name-to return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_horizon_db_parameter_groups_list_by_resource_group_request( # pylint: disable=name-too-long +def build_parameter_groups_list_by_resource_group_request( # pylint: disable=name-too-long resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -977,13 +997,13 @@ def build_horizon_db_parameter_groups_list_by_resource_group_request( # pylint: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_list_by_subscription_request( # pylint: disable=name-too-long +def build_parameter_groups_list_by_subscription_request( # pylint: disable=name-too-long subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1003,13 +1023,13 @@ def build_horizon_db_parameter_groups_list_by_subscription_request( # pylint: d return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_list_connections_request( # pylint: disable=name-too-long +def build_parameter_groups_list_connections_request( # pylint: disable=name-too-long resource_group_name: str, parameter_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1031,34 +1051,54 @@ def build_horizon_db_parameter_groups_list_connections_request( # pylint: disab return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_parameter_groups_list_versions_request( # pylint: disable=name-too-long - resource_group_name: str, - parameter_group_name: str, - subscription_id: str, - *, - version: Optional[int] = None, - **kwargs: Any +def build_default_parameter_groups_list_by_subscription_and_region_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}/versions" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HorizonDb/locations/{location}/parameterGroups" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "parameterGroupName": _SERIALIZER.url("parameter_group_name", parameter_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_default_parameter_groups_get_request( # pylint: disable=name-too-long + location: str, name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HorizonDb/locations/{location}/parameterGroups/{name}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if version is not None: - _params["version"] = _SERIALIZER.query("version", version, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1066,17 +1106,17 @@ def build_horizon_db_parameter_groups_list_versions_request( # pylint: disable= return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_administrators_get_request( # pylint: disable=name-too-long +def build_microsoft_entra_administrators_get_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, object_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators/{objectId}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/microsoftEntraAdministrators/{objectId}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1095,18 +1135,18 @@ def build_horizon_db_administrators_get_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_administrators_create_or_update_request( # pylint: disable=name-too-long +def build_microsoft_entra_administrators_create_or_replace_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, object_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators/{objectId}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/microsoftEntraAdministrators/{objectId}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1127,14 +1167,14 @@ def build_horizon_db_administrators_create_or_update_request( # pylint: disable return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_administrators_delete_request( # pylint: disable=name-too-long +def build_microsoft_entra_administrators_delete_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, object_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators/{objectId}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/microsoftEntraAdministrators/{objectId}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1150,17 +1190,17 @@ def build_horizon_db_administrators_delete_request( # pylint: disable=name-too- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_horizon_db_administrators_list_request( # pylint: disable=name-too-long +def build_microsoft_entra_administrators_list_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/microsoftEntraAdministrators" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1178,104 +1218,6530 @@ def build_horizon_db_administrators_list_request( # pylint: disable=name-too-lo return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. +def build_authentications_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`operations` attribute. - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """List the operations for the provider. + _url: str = _url.format(**path_format_arguments) # type: ignore - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - def prepare_request(next_link=None): - if not next_link: - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_password_authentications_get_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") - return _request + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications/passwordMethod" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _url: str = _url.format(**path_format_arguments) # type: ignore - def get_next(next_link=None): - _request = prepare_request(next_link) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_password_authentications_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications/passwordMethod" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_password_authentications_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications/passwordMethod" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_microsoft_entra_authentications_get_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications/microsoftEntra" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_microsoft_entra_authentications_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications/microsoftEntra" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_microsoft_entra_authentications_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/authentications/microsoftEntra" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_capabilities_get_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCapture/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_capabilities_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCapture/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_capabilities_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCapture/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_capabilities_delete_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCapture/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_change_data_capture_capabilities_list_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCapture" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_destinations_get_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, destination_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_destinations_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, destination_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_destinations_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, destination_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_destinations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, destination_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_change_data_capture_destinations_list_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_destinations_activate_identity_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + destination_name: str, + subscription_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}/activateIdentity" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_identity_assignments_get_request( + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}/identityAssignments/{assignmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + "assignmentName": _SERIALIZER.url("assignment_name", assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_identity_assignments_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}/identityAssignments/{assignmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + "assignmentName": _SERIALIZER.url("assignment_name", assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_identity_assignments_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}/identityAssignments/{assignmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + "assignmentName": _SERIALIZER.url("assignment_name", assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_identity_assignments_list_request( + resource_group_name: str, cluster_name: str, destination_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureDestinations/{destinationName}/identityAssignments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "destinationName": _SERIALIZER.url("destination_name", destination_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureConfigurations/{configurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_configurations_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureConfigurations/{configurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_configurations_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureConfigurations/{configurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_data_capture_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureConfigurations/{configurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_change_data_capture_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/changeDataCaptureConfigurations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_endpoints_get_request( + resource_group_name: str, cluster_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/endpoints/{endpointName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_endpoints_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/endpoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_get_request( + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/maintenanceEvents/{maintenanceEventId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "maintenanceEventId": _SERIALIZER.url("maintenance_event_id", maintenance_event_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_list_request( + resource_group_name: str, + cluster_name: str, + pool_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/maintenanceEvents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_reschedule_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/maintenanceEvents/{maintenanceEventId}/reschedule" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "maintenanceEventId": _SERIALIZER.url("maintenance_event_id", maintenance_event_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_apply_now_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/maintenanceEvents/{maintenanceEventId}/applyNow" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "maintenanceEventId": _SERIALIZER.url("maintenance_event_id", maintenance_event_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nodes_get_request( + resource_group_name: str, cluster_name: str, pool_name: str, node_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/nodes/{nodeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "nodeName": _SERIALIZER.url("node_name", node_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nodes_list_request( + resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/nodes" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_log_capture_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/logCaptureConfigurations/{logCaptureConfigurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "logCaptureConfigurationName": _SERIALIZER.url( + "log_capture_configuration_name", log_capture_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_log_capture_configurations_update_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/logCaptureConfigurations/{logCaptureConfigurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "logCaptureConfigurationName": _SERIALIZER.url( + "log_capture_configuration_name", log_capture_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_log_capture_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/logCaptureConfigurations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_log_files_get_request( + resource_group_name: str, cluster_name: str, log_file_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/logFiles/{logFileName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "logFileName": _SERIALIZER.url("log_file_name", log_file_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_log_files_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/logFiles" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_log_files_list_download_urls_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, log_file_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/logFiles/{logFileName}/listDownloadUrls" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "logFileName": _SERIALIZER.url("log_file_name", log_file_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class CapabilitiesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`capabilities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, **kwargs: Any) -> _models.Capability: + """Gets the singleton HorizonDB capability catalog entry available to a subscription in a specific + region. + + :param location: The name of the Azure region. Required. + :type location: str + :return: Capability. The Capability is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Capability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Capability] = kwargs.pop("cls", None) + + _request = build_capabilities_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Capability, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.Capability"]: + """Lists the singleton HorizonDB capability catalog entry available to a subscription in a + specific region. The result contains one item. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of Capability + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Capability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Capability]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_capabilities_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Capability], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ClustersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: + """Gets information about a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + _request = build_clusters_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.Cluster, _types.Cluster, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _models.Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.Cluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _types.Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.Cluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.Cluster, _types.Cluster, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Creates a new HorizonDB cluster or replaces an existing cluster. PointInTimeRestore creates the + new Cluster resource and hydrates its service-owned database storage from an available source + backup. It does not clone source pools, Pool-scoped endpoints, firewall rules, parameter-group + associations, or other child resources. The new Cluster receives its service-generated + Cluster-scoped Endpoint named cluster. For restore, postgreSqlVersion must be omitted because + the service obtains it from backup metadata; all other new-cluster configuration comes from the + request or service defaults. Same-location restore requires and honors pointInTimeUtc and + allows creationSourceClusterLocation to be omitted. Cross-location restore requires + creationSourceClusterLocation to identify the source cluster's Azure location and requires + pointInTimeUtc, but ignores the supplied timestamp and restores the latest available backup. + Cross-location responses omit pointInTimeUtc. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is either a Cluster type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.horizondb.models.Cluster or ~azure.mgmt.horizondb.types.Cluster or + IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[_models.ClusterForPatchUpdate, _types.ClusterForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _models.ClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ClusterForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _types.ClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ClusterForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[_models.ClusterForPatchUpdate, _types.ClusterForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Updates an existing HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Is either a ClusterForPatchUpdate + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ClusterForPatchUpdate or + ~azure.mgmt.horizondb.types.ClusterForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a HorizonDB cluster, its Cluster-scoped Endpoint, and all remaining child resources. + For an accepted deletion, the long-running operation remains nonterminal until physical + deletion completes and point GET returns 404 Not Found. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Cluster"]: + """Lists all HorizonDB clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Cluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Cluster"]: + """Lists all HorizonDB clusters in a subscription. + + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Cluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_failover_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[_models.Cluster]: + """Triggers failover within the cluster's designated read-write pool. HorizonDB selects the + replacement node using the same eligibility and node-selection rules as automatic failover. The + request fails with 409 Conflict when the designated pool is not eligible for failover or + another conflicting operation is in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class PoolsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any) -> _models.Pool: + """Gets information about a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Pool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + + _request = build_pools_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Pool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: Union[_models.Pool, _types.Pool, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pools_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: _models.Pool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.Pool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: _types.Pool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.Pool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + resource: Union[_models.Pool, _types.Pool, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Creates a new HorizonDB pool or replaces an existing pool, including its node allocation, + compute model, high-availability configuration, or associated parameter group. nodeCount and + highAvailability.mode are required and have no service defaults. nodeCount must be 1 through + 16. Disabled is valid only when nodeCount is 1. AnyZone and ZoneRedundant are valid only when + nodeCount is 2 through 16. AnyZone permits same-zone or cross-zone placement, while + ZoneRedundant requires nodes to be allocated across availability zones. Node allocation and + high-availability reconfiguration are atomic: if all requested nodes or the required zonal + topology cannot be provisioned, the long-running operation fails and the previous resource + state is preserved. A pool name must differ from its parent cluster name because the + Cluster-scoped ReadWrite Endpoint is named after the Cluster and the Pool-scoped ReadOnly + Endpoint is named after the Pool; the service rejects a request whose names would collide. + Creating a pool also creates exactly one service-managed Pool-scoped ReadOnly Endpoint + representing that Pool and its network boundary. The Endpoint's associatedResourceId identifies + the Pool, and the Endpoint cannot outlive or be deleted independently from it. When the first + pool is created, the service automatically designates it to host the cluster's read-write node + when an eligible node is available. A Cluster must contain at least one Pool before a private + endpoint connection can be created or approved. This API version supports at most one pool per + cluster; an attempt to create another pool is rejected with 409 Conflict. parameterGroup, + parameterGroupResourceId, and applyMethod are required. When creating a new pool in this API + version, parameterGroupResourceId must identify the corresponding default parameter group; a + customer-created parameter group is rejected. When replacing an existing pool, the request can + switch its association in either direction between the corresponding default parameter group + and a customer-created parameter group. applyMethod controls when dynamic parameter changes + become effective. Static parameter changes always require a customer-initiated Restart; Stop + followed by Start and scheduled maintenance do not apply pending changes. Subtype-specific + compute constraints are validated before the resource is changed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param resource: Resource create parameters. Is either a Pool type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.horizondb.models.Pool or ~azure.mgmt.horizondb.types.Pool or + IO[bytes] + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: Union[_models.PoolForPatchUpdate, _types.PoolForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pools_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: _models.PoolForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.PoolForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: _types.PoolForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.PoolForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + properties: Union[_models.PoolForPatchUpdate, _types.PoolForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Updates an existing HorizonDB pool, including its node allocation, selected compute model + properties, compute model type, high-availability configuration, or associated parameter group. + Omitted nodeCount and highAvailability.mode values preserve their existing values; the service + recursively merges the PATCH before atomically validating the effective tuple. nodeCount, when + supplied, must be 1 through 16. Disabled is valid only when the effective nodeCount is 1. + AnyZone and ZoneRedundant are valid only when the effective nodeCount is 2 through 16. + Therefore, crossing between those node-count ranges requires nodeCount and + highAvailability.mode to be changed together. AnyZone permits same-zone or cross-zone + placement. Changing from AnyZone to ZoneRedundant may allocate a replacement node in another + availability zone and replace a read-only node, disconnecting connections to the replaced node. + If all requested nodes or the required zonal topology cannot be provisioned, the long-running + operation fails and the previous resource state is preserved. To deallocate runtime compute + without changing the configured nodeCount, use the Pool stop action. When parameterGroup is + supplied, both parameterGroupResourceId and applyMethod are required. The pool can switch its + association in either direction between the corresponding default parameter group and a + customer-created parameter group. applyMethod controls when dynamic parameter changes become + effective. Static parameter changes always require a customer-initiated Restart; Stop followed + by Start and scheduled maintenance do not apply pending changes. Subtype-specific compute + constraints are validated against the recursively merged configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param properties: The resource properties to be updated. Is either a PoolForPatchUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.PoolForPatchUpdate or + ~azure.mgmt.horizondb.types.PoolForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_pools_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a HorizonDB pool together with the Pool-scoped Endpoint whose associatedResourceId + identifies that Pool and all FirewallRule children of that Endpoint. The Endpoint cannot + outlive or be deleted independently from its Pool. When this is the Cluster's last surviving + Pool, the service also disconnects every existing private endpoint connection associated with + the Cluster by setting its privateLinkServiceConnectionState.status to Rejected and providing a + description that the last Pool was deleted. The HorizonDB private endpoint connection resources + remain available for inspection and cleanup, and customer-owned + Microsoft.Network/privateEndpoints resources are not deleted. The delete long-running operation + completes only after all required private endpoint disconnections have completed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.Pool"]: + """Lists all HorizonDB pools in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Pool + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_pools_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Pool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _start_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_pools_start_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_start( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Starts a stopped HorizonDB pool. Power operations are supported only at pool scope in this API + version; there is no cluster-level start action. Start does not apply pending dynamic or static + parameter changes; parameterGroup.syncStatus remains PendingReboot until a customer-initiated + Restart. When the pool is already Ready, the operation succeeds as a true idempotent no-op and + likewise leaves pending parameter changes pending. The operation is allowed when the pool has + no allocated nodes. After the Pool is running, its Pool-scoped ReadOnly Endpoint routes only + when at least one allocated node is not currently playing the read-write role. The request + fails with 409 Conflict when another operation is in progress or the pool is in any other + incompatible state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _stop_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_pools_stop_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_stop( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Stops a running HorizonDB pool and deallocates compute. Power operations are supported only at + pool scope in this API version; there is no cluster-level stop action. Stop does not apply + pending dynamic or static parameter changes; parameterGroup.syncStatus remains PendingReboot. A + subsequent Start also preserves those pending changes. The operation succeeds as an idempotent + no-op when the pool is already Stopped. It is allowed when the pool has no allocated nodes. The + Pool-scoped ReadOnly Endpoint remains discoverable but has no routing destination while the + Pool is Stopped. The request fails with 409 Conflict when another operation is in progress or + the pool is in any other incompatible state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _restart_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_pools_restart_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_restart( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> LROPoller[_models.Pool]: + """Restarts the PostgreSQL container on all allocated nodes in a ready HorizonDB pool and applies + pending dynamic and static parameter changes. This customer-initiated Restart is the only + operation that applies static parameter changes or dynamic parameter changes requested with + PendingReboot; Stop followed by Start and scheduled maintenance do not apply them. Power + operations are supported only at pool scope in this API version; there is no cluster-level + restart action. When the pool has no allocated nodes, the operation succeeds without restarting + any nodes, pending changes are considered applied, parameterGroup.syncStatus becomes InSync, + and the resulting configuration applies to nodes allocated later. The request fails with 409 + Conflict when another operation is in progress or the pool is in any other incompatible state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An instance of LROPoller that returns Pool. The Pool is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.Pool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class FirewallRulesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.FirewallRule: + """Gets information about a HorizonDB pool firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. + :type firewall_rule_name: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + + _request = build_firewall_rules_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.FirewallRule"]: + """Lists all HorizonDB firewall rules in a pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An iterator like instance of FirewallRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_rules_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: Union[_models.FirewallRule, _types.FirewallRule, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_firewall_rules_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: _models.FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.FirewallRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FirewallRule. The FirewallRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: _types.FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.FirewallRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FirewallRule. The FirewallRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FirewallRule. The FirewallRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: Union[_models.FirewallRule, _types.FirewallRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FirewallRule]: + """Creates or replaces a HorizonDB pool firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Is either a FirewallRule type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.horizondb.models.FirewallRule or + ~azure.mgmt.horizondb.types.FirewallRule or IO[bytes] + :return: An instance of LROPoller that returns FirewallRule. The FirewallRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FirewallRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FirewallRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FirewallRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_firewall_rules_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a HorizonDB pool firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB pool firewall rule. Required. + :type firewall_rule_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateEndpointConnectionResource"]: + """Lists private endpoint connections in a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of PrivateEndpointConnectionResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnectionResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _approve_or_reject_initial( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_approve_or_reject_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: _models.PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: _types.PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_approve_or_reject( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnectionResource]: + """Approves or rejects an existing private endpoint connection. Approval requires the parent + Cluster to contain at least one Pool. An approval attempt when the Cluster has no Pools fails + with 409 Conflict and the stable error code PrivateEndpointRequiresPool. Rejection remains + allowed when the Cluster has no Pools so that existing connections can be cleaned up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Is either a PrivateEndpointConnectionResource type + or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource or + ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnectionResource. The + PrivateEndpointConnectionResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._approve_or_reject_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnectionResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnectionResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class PrivateLinkResourcesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, group_name: str, **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets a private link resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param group_name: The name of the private link resource. Required. + :type group_name: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) + + _request = build_private_link_resources_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + group_name=group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateLinkResource"]: + """Lists private link resources in a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of PrivateLinkResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.PrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_resources_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateLinkResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ParameterGroupsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`parameter_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> _models.ParameterGroup: + """Gets information about a HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: ParameterGroup. The ParameterGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ParameterGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ParameterGroup] = kwargs.pop("cls", None) + + _request = build_parameter_groups_get_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ParameterGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_replace_initial( + self, + resource_group_name: str, + parameter_group_name: str, + resource: Union[_models.ParameterGroup, _types.ParameterGroup, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_parameter_groups_create_or_replace_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + parameter_group_name: str, + resource: _models.ParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.ParameterGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + parameter_group_name: str, + resource: _types.ParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.ParameterGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + parameter_group_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + parameter_group_name: str, + resource: Union[_models.ParameterGroup, _types.ParameterGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Creates a new HorizonDB parameter group or replaces an existing parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param resource: Resource create parameters. Is either a ParameterGroup type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.ParameterGroup or + ~azure.mgmt.horizondb.types.ParameterGroup or IO[bytes] + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ParameterGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ParameterGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ParameterGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ParameterGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + parameter_group_name: str, + properties: Union[_models.ParameterGroupForPatchUpdate, _types.ParameterGroupForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_parameter_groups_update_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: _models.ParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ParameterGroupForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: _types.ParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ParameterGroupForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: Union[_models.ParameterGroupForPatchUpdate, _types.ParameterGroupForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ParameterGroup]: + """Updates an existing HorizonDB parameter group. Each connected pool's applyMethod setting + controls whether dynamic parameter changes become effective immediately or remain pending until + a customer-initiated pool Restart. Static parameter changes always remain pending until a + customer-initiated pool Restart. Stop followed by Start and scheduled maintenance do not apply + pending changes. The operation fails with a conflict while a previous update to this parameter + group is still being processed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Is either a + ParameterGroupForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ParameterGroupForPatchUpdate or + ~azure.mgmt.horizondb.types.ParameterGroupForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns ParameterGroup. The ParameterGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ParameterGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ParameterGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ParameterGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ParameterGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_parameter_groups_delete_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a HorizonDB parameter group. Deletion fails with a conflict when the parameter group is + associated with one or more pools. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.ParameterGroup"]: + """Lists all HorizonDB parameter groups in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ParameterGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_parameter_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ParameterGroup"]: + """Lists all HorizonDB parameter groups in a subscription. + + :return: An iterator like instance of ParameterGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.ParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_parameter_groups_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_connections( + self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.ParameterGroupConnectionProperties"]: + """Gets all connections to a parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: An iterator like instance of ParameterGroupConnectionProperties + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.ParameterGroupConnectionProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ParameterGroupConnectionProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_parameter_groups_list_connections_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ParameterGroupConnectionProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DefaultParameterGroupsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`default_parameter_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription_and_region( + self, location: str, **kwargs: Any + ) -> ItemPaged["_models.DefaultParameterGroup"]: + """Lists default parameter groups available for a subscription in a specific region. The response + contains at most one default parameter group for each PostgreSQL version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of DefaultParameterGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.DefaultParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DefaultParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_default_parameter_groups_list_by_subscription_and_region_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DefaultParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1287,35 +7753,17 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class HorizonDbClustersOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_clusters` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.HorizonDbCluster: - """Gets information about a HorizonDB cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :return: HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbCluster + def get(self, location: str, name: str, **kwargs: Any) -> _models.DefaultParameterGroup: + """Gets a default parameter group available for a subscription in a specific region. Each + PostgreSQL version has at most one default parameter group in a location. + + :param location: The name of the Azure region. Required. + :type location: str + :param name: The name of the DefaultParameterGroup. Required. + :type name: str + :return: DefaultParameterGroup. The DefaultParameterGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.DefaultParameterGroup :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1329,11 +7777,11 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultParameterGroup] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, + _request = build_default_parameter_groups_get_request( + location=location, + name=name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1368,255 +7816,115 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbCluster, response.json()) + deserialized = _deserialize(_models.DefaultParameterGroup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_clusters_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.HorizonDbCluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _types.HorizonDbCluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbCluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ +class MicrosoftEntraAdministratorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`microsoft_entra_administrators` attribute. + """ - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDB cluster or updates an existing cluster. + def get( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> _models.MicrosoftEntraAdministrator: + """Gets information about a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Is either a HorizonDbCluster type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster or - ~azure.mgmt.horizondb.types.HorizonDbCluster or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :return: MicrosoftEntraAdministrator. The MicrosoftEntraAdministrator is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbCluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbCluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MicrosoftEntraAdministrator] = kwargs.pop("cls", None) + _request = build_microsoft_entra_administrators_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.HorizonDbCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.HorizonDbCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.MicrosoftEntraAdministrator, response.json()) - def _update_initial( + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_replace_initial( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], + object_id: str, + resource: Union[_models.MicrosoftEntraAdministratorAdd, _types.MicrosoftEntraAdministratorAdd, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1635,14 +7943,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_clusters_update_request( + _request = build_microsoft_entra_administrators_create_or_replace_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + object_id=object_id, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -1663,7 +7972,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1676,9 +7985,10 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1688,126 +7998,147 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - properties: _models.HorizonDbClusterForPatchUpdate, + object_id: str, + resource: _models.MicrosoftEntraAdministratorAdd, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> LROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministratorAdd :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of LROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - properties: _types.HorizonDbClusterForPatchUpdate, + object_id: str, + resource: _types.MicrosoftEntraAdministratorAdd, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> LROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.MicrosoftEntraAdministratorAdd :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of LROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - properties: IO[bytes], + object_id: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> LROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :return: An instance of LROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], + object_id: str, + resource: Union[_models.MicrosoftEntraAdministratorAdd, _types.MicrosoftEntraAdministratorAdd, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). + ) -> LROPoller[_models.MicrosoftEntraAdministrator]: + """Creates or replaces a PostgreSQL role that is a member of azure_pg_admin and mapped to a + Microsoft Entra principal. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Is either a - HorizonDbClusterForPatchUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate or - ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str + :param resource: Resource create parameters. Is either a MicrosoftEntraAdministratorAdd type or + a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAdministratorAdd or + ~azure.mgmt.horizondb.types.MicrosoftEntraAdministratorAdd or IO[bytes] + :return: An instance of LROPoller that returns MicrosoftEntraAdministrator. The + MicrosoftEntraAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.MicrosoftEntraAdministrator] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - properties=properties, + object_id=object_id, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -1818,10 +8149,16 @@ def begin_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbCluster, response.json()) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.MicrosoftEntraAdministrator, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized path_format_arguments = { @@ -1837,17 +8174,19 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.HorizonDbCluster].from_continuation_token( + return LROPoller[_models.MicrosoftEntraAdministrator].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.HorizonDbCluster]( + return LROPoller[_models.MicrosoftEntraAdministrator]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + def _delete_initial( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1861,9 +8200,10 @@ def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_delete_request( + _request = build_microsoft_entra_administrators_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + object_id=object_id, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1910,14 +8250,20 @@ def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: return deserialized # type: ignore @distributed_trace - def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a HorizonDB cluster. + def begin_delete( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a PostgreSQL role that is a member of azure_pg_admin and mapped to a Microsoft Entra + principal. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str + :param object_id: The Microsoft Entra object identifier of the principal mapped to the + PostgreSQL role, represented as an RFC 4122 GUID. Required. + :type object_id: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1933,6 +8279,7 @@ def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: An raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + object_id=object_id, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1967,20 +8314,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.HorizonDbCluster"]: - """Lists all HorizonDB clusters in a resource group. + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.MicrosoftEntraAdministrator"]: + """Lists the PostgreSQL roles in a cluster that are members of azure_pg_admin and mapped to + Microsoft Entra principals. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of HorizonDbCluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbCluster] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of MicrosoftEntraAdministrator + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.MicrosoftEntraAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.MicrosoftEntraAdministrator]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1993,8 +8345,9 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_clusters_list_by_resource_group_request( + _request = build_microsoft_entra_administrators_list_request( resource_group_name=resource_group_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2035,7 +8388,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbCluster], + List[_models.MicrosoftEntraAdministrator], deserialized.get("value", []), ) if cls: @@ -2063,18 +8416,42 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + +class AuthenticationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbCluster"]: - """Lists all HorizonDB clusters in a subscription. + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.Authentication"]: + """Lists the two service-created authentication configurations for the cluster: passwordMethod and + microsoftEntra. - :return: An iterator like instance of HorizonDbCluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbCluster] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Authentication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Authentication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Authentication]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2087,7 +8464,9 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbClu def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_clusters_list_by_subscription_request( + _request = build_authentications_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2128,7 +8507,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbCluster], + List[_models.Authentication], deserialized.get("value", []), ) if cls: @@ -2156,14 +8535,37 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def _start_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + +class PasswordAuthenticationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`password_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.PasswordAuthentication: + """Gets the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: PasswordAuthentication. The PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PasswordAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2175,128 +8577,59 @@ def _start_initial(self, resource_group_name: str, cluster_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.PasswordAuthentication] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_start_request( + _request = build_password_authentications_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Starts a stopped HorizonDB cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + deserialized = _deserialize(_models.PasswordAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.PasswordAuthentication, _types.PasswordAuthentication, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2305,16 +8638,26 @@ def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: A } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_stop_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_password_authentications_create_or_replace_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2331,7 +8674,7 @@ def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: A response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -2344,12 +8687,10 @@ def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: A raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -2358,37 +8699,128 @@ def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: A return deserialized # type: ignore + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _models.PasswordAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.PasswordAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _types.PasswordAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.PasswordAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def begin_stop(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Stops a running HorizonDB cluster. + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.PasswordAuthentication, _types.PasswordAuthentication, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Creates or replaces the service-created PostgreSQL username-and-password authentication method. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param resource: Resource create parameters. Is either a PasswordAuthentication type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.PasswordAuthentication or + ~azure.mgmt.horizondb.types.PasswordAuthentication or IO[bytes] + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PasswordAuthentication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._stop_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2397,9 +8829,18 @@ def begin_stop(self, resource_group_name: str, cluster_name: str, **kwargs: Any) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.PasswordAuthentication, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -2414,22 +8855,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.PasswordAuthentication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.PasswordAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def _restart_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.PasswordAuthenticationForPatchUpdate, _types.PasswordAuthenticationForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2438,16 +8882,26 @@ def _restart_initial(self, resource_group_name: str, cluster_name: str, **kwargs } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_clusters_restart_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_password_authentications_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2491,37 +8945,154 @@ def _restart_initial(self, resource_group_name: str, cluster_name: str, **kwargs return deserialized # type: ignore + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _models.PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.PasswordAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _types.PasswordAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.PasswordAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def begin_restart(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Restarts a HorizonDB cluster. + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.PasswordAuthenticationForPatchUpdate, _types.PasswordAuthenticationForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.PasswordAuthentication]: + """Updates the service-created PostgreSQL username-and-password authentication method. The request + is sparse and omitted properties preserve their current values. This API version supports + enabling the method, disabling the method, and resetting its password. For a cluster that + already has an administrator but currently has password authentication disabled, state Enabled + and administratorLoginPassword can be supplied together to re-enable password authentication + and reset the password. Disabling cannot include credentials and does not remove or modify + existing database users or roles. Administrator rename is not supported in this API version. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param properties: The resource properties to be updated. Is either a + PasswordAuthenticationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.PasswordAuthenticationForPatchUpdate or + ~azure.mgmt.horizondb.types.PasswordAuthenticationForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns PasswordAuthentication. The + PasswordAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PasswordAuthentication] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PasswordAuthentication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._restart_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + properties=properties, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2530,9 +9101,12 @@ def begin_restart(self, resource_group_name: str, cluster_name: str, **kwargs: A raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PasswordAuthentication, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -2547,23 +9121,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.PasswordAuthentication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.PasswordAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) -class HorizonDbPoolsOperations: # pylint: disable=docstring-missing-param +class MicrosoftEntraAuthenticationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_pools` attribute. + :attr:`microsoft_entra_authentications` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2574,18 +9150,17 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any) -> _models.HorizonDbPool: - """Gets information about a HorizonDB pool. + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.MicrosoftEntraAuthentication: + """Gets the service-created Microsoft Entra authentication method. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :return: HorizonDbPool. The HorizonDbPool is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPool + :return: MicrosoftEntraAuthentication. The MicrosoftEntraAuthentication is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2599,12 +9174,11 @@ def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPool] = kwargs.pop("cls", None) + cls: ClsType[_models.MicrosoftEntraAuthentication] = kwargs.pop("cls", None) - _request = build_horizon_db_pools_get_request( + _request = build_microsoft_entra_authentications_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2639,31 +9213,20 @@ def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwa if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbPool, response.json()) + deserialized = _deserialize(_models.MicrosoftEntraAuthentication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.HorizonDbPool"]: - """Lists all HorizonDB pools in a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :return: An iterator like instance of HorizonDbPool - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.HorizonDbPool]] = kwargs.pop("cls", None) - + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.MicrosoftEntraAuthentication, _types.MicrosoftEntraAuthentication, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2672,117 +9235,264 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> It } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_horizon_db_pools_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_microsoft_entra_authentications_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbPool], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized # type: ignore -class HorizonDbReplicasOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _models.MicrosoftEntraAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_replicas` attribute. - """ + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: _types.MicrosoftEntraAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.MicrosoftEntraAuthentication + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.MicrosoftEntraAuthentication, _types.MicrosoftEntraAuthentication, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Creates or replaces the service-created Microsoft Entra authentication method. State Enabled + enables the feature and State Disabled disables it; no additional properties are required. + Repeating the same request is idempotent. Disabling the feature does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is either a MicrosoftEntraAuthentication type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication or + ~azure.mgmt.horizondb.types.MicrosoftEntraAuthentication or IO[bytes] + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MicrosoftEntraAuthentication] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + deserialized = _deserialize(_models.MicrosoftEntraAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> _models.HorizonDbReplica: - """Gets information about a HorizonDB replica. + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :return: HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbReplica - :raises ~azure.core.exceptions.HttpResponseError: - """ + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MicrosoftEntraAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MicrosoftEntraAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.MicrosoftEntraAuthenticationForPatchUpdate, + _types.MicrosoftEntraAuthenticationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2791,18 +9501,26 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_replicas_get_request( + _request = build_microsoft_entra_authentications_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2812,19 +9530,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -2832,128 +9549,299 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _models.MicrosoftEntraAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: _types.MicrosoftEntraAuthenticationForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbReplica"]: - """Lists all HorizonDB replicas in a pool. + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: Union[ + _models.MicrosoftEntraAuthenticationForPatchUpdate, + _types.MicrosoftEntraAuthenticationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> LROPoller[_models.MicrosoftEntraAuthentication]: + """Updates the service-created Microsoft Entra authentication method. State Enabled enables the + feature and State Disabled disables it; no additional properties are required. Disabling the + feature does not remove or modify database roles or users previously created through the + MicrosoftEntraAdministrators control-plane API or directly through pgaadauth extension + functions. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :return: An iterator like instance of HorizonDbReplica - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbReplica] + :param properties: The resource properties to be updated. Is either a + MicrosoftEntraAuthenticationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.MicrosoftEntraAuthenticationForPatchUpdate or + ~azure.mgmt.horizondb.types.MicrosoftEntraAuthenticationForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns MicrosoftEntraAuthentication. The + MicrosoftEntraAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MicrosoftEntraAuthentication] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbReplica]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MicrosoftEntraAuthentication] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MicrosoftEntraAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MicrosoftEntraAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MicrosoftEntraAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - _request = build_horizon_db_replicas_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +class ChangeDataCaptureCapabilitiesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`change_data_capture_capabilities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ChangeDataCaptureCapability: + """Gets the singleton change data capture capability for a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: ChangeDataCaptureCapability. The ChangeDataCaptureCapability is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - return _request + cls: ClsType[_models.ChangeDataCaptureCapability] = kwargs.pop("cls", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbReplica], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _request = build_change_data_capture_capabilities_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def get_next(next_link=None): - _request = prepare_request(next_link) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ChangeDataCaptureCapability, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore - def _create_or_update_initial( + def _create_or_replace_initial( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], + resource: Union[_models.ChangeDataCaptureCapability, _types.ChangeDataCaptureCapability, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2977,11 +9865,9 @@ def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_replicas_create_or_update_request( + _request = build_change_data_capture_capabilities_create_or_replace_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3029,151 +9915,129 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - resource: _models.HorizonDbReplica, + resource: _models.ChangeDataCaptureCapability, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - resource: _types.HorizonDbReplica, + resource: _types.ChangeDataCaptureCapability, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbReplica + :type resource: ~azure.mgmt.horizondb.types.ChangeDataCaptureCapability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], + resource: Union[_models.ChangeDataCaptureCapability, _types.ChangeDataCaptureCapability, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDB replica or updates an existing replica. + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Creates or replaces the singleton change data capture capability and reconciles shared engine + prerequisites. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Is either a HorizonDbReplica type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica or - ~azure.mgmt.horizondb.types.HorizonDbReplica or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :param resource: Resource create parameters. Is either a ChangeDataCaptureCapability type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapability or + ~azure.mgmt.horizondb.types.ChangeDataCaptureCapability or IO[bytes] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[_models.ChangeDataCaptureCapability] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -3186,7 +10050,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + deserialized = _deserialize(_models.ChangeDataCaptureCapability, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3204,13 +10068,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.HorizonDbReplica].from_continuation_token( + return LROPoller[_models.ChangeDataCaptureCapability].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.HorizonDbReplica]( + return LROPoller[_models.ChangeDataCaptureCapability]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -3218,9 +10082,11 @@ def _update_initial( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], + properties: Union[ + _models.ChangeDataCaptureCapabilityForPatchUpdate, + _types.ChangeDataCaptureCapabilityForPatchUpdate, + IO[bytes], + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3244,11 +10110,9 @@ def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_replicas_update_request( + _request = build_change_data_capture_capabilities_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3283,6 +10147,9 @@ def _update_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -3298,32 +10165,27 @@ def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: _models.HorizonDbReplicaForPatchUpdate, + properties: _models.ChangeDataCaptureCapabilityForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3332,32 +10194,27 @@ def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: _types.HorizonDbReplicaForPatchUpdate, + properties: _types.ChangeDataCaptureCapabilityForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate + :type properties: ~azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3366,32 +10223,27 @@ def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3400,36 +10252,35 @@ def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], + properties: Union[ + _models.ChangeDataCaptureCapabilityForPatchUpdate, + _types.ChangeDataCaptureCapabilityForPatchUpdate, + IO[bytes], + ], **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDB replica (e.g., role). + ) -> LROPoller[_models.ChangeDataCaptureCapability]: + """Updates mutable change data capture capability properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str :param properties: The resource properties to be updated. Is either a - HorizonDbReplicaForPatchUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate or - ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + ChangeDataCaptureCapabilityForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureCapabilityForPatchUpdate or + ~azure.mgmt.horizondb.types.ChangeDataCaptureCapabilityForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns ChangeDataCaptureCapability. The + ChangeDataCaptureCapability is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[_models.ChangeDataCaptureCapability] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -3437,8 +10288,6 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -3451,7 +10300,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + deserialized = _deserialize(_models.ChangeDataCaptureCapability, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3469,19 +10318,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.HorizonDbReplica].from_continuation_token( + return LROPoller[_models.ChangeDataCaptureCapability].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.HorizonDbReplica]( + return LROPoller[_models.ChangeDataCaptureCapability]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3495,11 +10342,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_replicas_delete_request( + _request = build_change_data_capture_capabilities_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3543,82 +10388,178 @@ def _delete_initial( if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized # type: ignore + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the change data capture capability after all change data capture destinations and + configurations have been removed. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.ChangeDataCaptureCapability"]: + """Lists the optional singleton change data capture capability for a cluster. The result contains + zero or one item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ChangeDataCaptureCapability + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.ChangeDataCaptureCapability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ChangeDataCaptureCapability]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_change_data_capture_capabilities_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a HorizonDB replica. + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ChangeDataCaptureCapability], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDB replica. Required. - :type replica_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def get_next(next_link=None): + _request = prepare_request(next_link) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + response = pipeline_response.http_response - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + return pipeline_response - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return ItemPaged(get_next, extract_data) -class HorizonDbFirewallRulesOperations: # pylint: disable=docstring-missing-param +class ChangeDataCaptureDestinationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_firewall_rules` attribute. + :attr:`change_data_capture_destinations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3630,21 +10571,21 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.HorizonDbFirewallRule: - """Gets information about a HorizonDB firewall rule. + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any + ) -> _models.ChangeDataCaptureDestination: + """Gets a change data capture destination. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. - :type firewall_rule_name: str - :return: HorizonDbFirewallRule. The HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :return: ChangeDataCaptureDestination. The ChangeDataCaptureDestination is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestination :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3658,13 +10599,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + cls: ClsType[_models.ChangeDataCaptureDestination] = kwargs.pop("cls", None) - _request = build_horizon_db_firewall_rules_get_request( + _request = build_change_data_capture_destinations_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + destination_name=destination_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3699,35 +10639,21 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) + deserialized = _deserialize(_models.ChangeDataCaptureDestination, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbFirewallRule"]: - """Lists all HorizonDB firewall rules in a pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :return: An iterator like instance of HorizonDbFirewallRule - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.HorizonDbFirewallRule]] = kwargs.pop("cls", None) - + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: Union[_models.ChangeDataCaptureDestination, _types.ChangeDataCaptureDestination, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3736,88 +10662,265 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_horizon_db_firewall_rules_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_destinations_create_or_replace_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: _models.ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestination + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: _types.ChangeDataCaptureDestination, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.ChangeDataCaptureDestination + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ - return _request + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbFirewallRule], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ - def get_next(next_link=None): - _request = prepare_request(next_link) + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + resource: Union[_models.ChangeDataCaptureDestination, _types.ChangeDataCaptureDestination, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Creates or replaces a Microsoft Fabric change data capture destination. - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param resource: Resource create parameters. Is either a ChangeDataCaptureDestination type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestination or + ~azure.mgmt.horizondb.types.ChangeDataCaptureDestination or IO[bytes] + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureDestination] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + deserialized = _deserialize(_models.ChangeDataCaptureDestination, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return ItemPaged(get_next, extract_data) + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ChangeDataCaptureDestination].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ChangeDataCaptureDestination]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _create_or_update_initial( + def _update_initial( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], + destination_name: str, + properties: Union[ + _models.ChangeDataCaptureDestinationForPatchUpdate, + _types.ChangeDataCaptureDestinationForPatchUpdate, + IO[bytes], + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3836,16 +10939,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(properties, (IOBase, bytes)): + _content = properties else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_firewall_rules_create_or_update_request( + _request = build_change_data_capture_destinations_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + destination_name=destination_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3866,7 +10968,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3879,10 +10981,11 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -3893,152 +10996,155 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: _models.HorizonDbFirewallRule, + destination_name: str, + properties: _models.ChangeDataCaptureDestinationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. - :type firewall_rule_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbFirewallRule. The HorizonDbFirewallRule - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: _types.HorizonDbFirewallRule, + destination_name: str, + properties: _types.ChangeDataCaptureDestinationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. - :type firewall_rule_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbFirewallRule + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ChangeDataCaptureDestinationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbFirewallRule. The HorizonDbFirewallRule - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: IO[bytes], + destination_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. - :type firewall_rule_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbFirewallRule. The HorizonDbFirewallRule - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, - pool_name: str, - firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], + destination_name: str, + properties: Union[ + _models.ChangeDataCaptureDestinationForPatchUpdate, + _types.ChangeDataCaptureDestinationForPatchUpdate, + IO[bytes], + ], **kwargs: Any - ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDB firewall rule or updates an existing rule. + ) -> LROPoller[_models.ChangeDataCaptureDestination]: + """Updates mutable change data capture destination properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. - :type firewall_rule_name: str - :param resource: Resource create parameters. Is either a HorizonDbFirewallRule type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule or - ~azure.mgmt.horizondb.types.HorizonDbFirewallRule or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbFirewallRule. The HorizonDbFirewallRule - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param properties: The resource properties to be updated. Is either a + ChangeDataCaptureDestinationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureDestinationForPatchUpdate or + ~azure.mgmt.horizondb.types.ChangeDataCaptureDestinationForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns ChangeDataCaptureDestination. The + ChangeDataCaptureDestination is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + cls: ClsType[_models.ChangeDataCaptureDestination] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - firewall_rule_name=firewall_rule_name, - resource=resource, + destination_name=destination_name, + properties=properties, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4050,7 +11156,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) + deserialized = _deserialize(_models.ChangeDataCaptureDestination, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4068,18 +11174,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.HorizonDbFirewallRule].from_continuation_token( + return LROPoller[_models.ChangeDataCaptureDestination].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.HorizonDbFirewallRule]( + return LROPoller[_models.ChangeDataCaptureDestination]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4094,11 +11200,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_firewall_rules_delete_request( + _request = build_change_data_capture_destinations_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + destination_name=destination_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4146,19 +11251,19 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a HorizonDB firewall rule. + """Deletes a change data capture destination after all referencing configurations and identity + assignments have been removed. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDB pool. Required. - :type pool_name: str - :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. - :type firewall_rule_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -4174,156 +11279,59 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + destination_name=destination_name, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class HorizonDbPrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param,name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Gets a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + kwargs.pop("error_map", None) - cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - _request = build_horizon_db_private_endpoint_connections_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateEndpointConnectionResource"]: - """Lists private endpoint connections in a HorizonDB cluster. + ) -> ItemPaged["_models.ChangeDataCaptureDestination"]: + """Lists change data capture destinations in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of PrivateEndpointConnectionResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :return: An iterator like instance of ChangeDataCaptureDestination + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.ChangeDataCaptureDestination] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ChangeDataCaptureDestination]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4336,7 +11344,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_private_endpoint_connections_list_request( + _request = build_change_data_capture_destinations_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -4379,7 +11387,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PrivateEndpointConnectionResource], + List[_models.ChangeDataCaptureDestination], deserialized.get("value", []), ) if cls: @@ -4407,143 +11415,353 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + def _activate_identity_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + body: Union[ + _models.ActivateChangeDataCaptureIdentityRequest, _types.ActivateChangeDataCaptureIdentityRequest, IO[bytes] + ], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_destinations_activate_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def update_status( + def begin_activate_identity( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: _models.PrivateEndpointConnectionResource, + destination_name: str, + body: _models.ActivateChangeDataCaptureIdentityRequest, *, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> LROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of LROPoller that returns ActivateChangeDataCaptureIdentityResult. The + ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update_status( + def begin_activate_identity( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: _types.PrivateEndpointConnectionResource, + destination_name: str, + body: _types.ActivateChangeDataCaptureIdentityRequest, *, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> LROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.types.ActivateChangeDataCaptureIdentityRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of LROPoller that returns ActivateChangeDataCaptureIdentityResult. The + ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update_status( + def begin_activate_identity( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: IO[bytes], + destination_name: str, + body: IO[bytes], *, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> LROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :return: An instance of LROPoller that returns ActivateChangeDataCaptureIdentityResult. The + ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "private_endpoint_connection_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - def update_status( + def begin_activate_identity( self, resource_group_name: str, cluster_name: str, - private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], + destination_name: str, + body: Union[ + _models.ActivateChangeDataCaptureIdentityRequest, _types.ActivateChangeDataCaptureIdentityRequest, IO[bytes] + ], + *, + etag: str, + match_condition: MatchConditions, **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Approves or rejects a private endpoint connection. + ) -> LROPoller[_models.ActivateChangeDataCaptureIdentityResult]: + """Atomically activates a validated identity assignment for this destination. If-Match is + evaluated against the destination entity tag. Activating the already-active assignment succeeds + idempotently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Is either a PrivateEndpointConnectionResource type - or a IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource or - ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource or IO[bytes] - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param body: The content of the action request. Is either a + ActivateChangeDataCaptureIdentityRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityRequest or + ~azure.mgmt.horizondb.types.ActivateChangeDataCaptureIdentityRequest or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ActivateChangeDataCaptureIdentityResult. The + ActivateChangeDataCaptureIdentityResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ActivateChangeDataCaptureIdentityResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActivateChangeDataCaptureIdentityResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._activate_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + body=body, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ActivateChangeDataCaptureIdentityResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ActivateChangeDataCaptureIdentityResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ActivateChangeDataCaptureIdentityResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class IdentityAssignmentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`identity_assignments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, destination_name: str, assignment_name: str, **kwargs: Any + ) -> _models.IdentityAssignment: + """Gets a change data capture identity assignment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :return: IdentityAssignment. The IdentityAssignment is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.IdentityAssignment :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4554,27 +11772,18 @@ def update_status( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.IdentityAssignment] = kwargs.pop("cls", None) - _request = build_horizon_db_private_endpoint_connections_update_status_request( + _request = build_identity_assignments_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - private_endpoint_connection_name=private_endpoint_connection_name, + destination_name=destination_name, + assignment_name=assignment_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4591,7 +11800,7 @@ def update_status( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -4607,15 +11816,21 @@ def update_status( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) + deserialized = _deserialize(_models.IdentityAssignment, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _delete_initial( - self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any + def _create_or_replace_initial( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: Union[_models.IdentityAssignment, _types.IdentityAssignment, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4625,17 +11840,28 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_private_endpoint_connections_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_identity_assignments_create_or_replace_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - private_endpoint_connection_name=private_endpoint_connection_name, + destination_name=destination_name, + assignment_name=assignment_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -4652,7 +11878,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4665,12 +11891,10 @@ def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -4679,36 +11903,170 @@ def _delete_initial( return deserialized # type: ignore + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: _models.IdentityAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.IdentityAssignment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IdentityAssignment. The IdentityAssignment is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: _types.IdentityAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.IdentityAssignment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IdentityAssignment. The IdentityAssignment is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IdentityAssignment. The IdentityAssignment is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a private endpoint connection. + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + destination_name: str, + assignment_name: str, + resource: Union[_models.IdentityAssignment, _types.IdentityAssignment, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IdentityAssignment]: + """Creates or idempotently replaces a change data capture identity assignment. The identity + resource ID is immutable and must reference a user-assigned managed identity already attached + to the parent cluster. The service also validates destination permissions, which are not + granted by attaching the identity to the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :param resource: Resource create parameters. Is either a IdentityAssignment type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.IdentityAssignment or + ~azure.mgmt.horizondb.types.IdentityAssignment or IO[bytes] + :return: An instance of LROPoller that returns IdentityAssignment. The IdentityAssignment is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.IdentityAssignment] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IdentityAssignment] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - private_endpoint_connection_name=private_endpoint_connection_name, + destination_name=destination_name, + assignment_name=assignment_name, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4717,9 +12075,18 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.IdentityAssignment, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -4734,50 +12101,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.IdentityAssignment].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class HorizonDbPrivateLinkResourcesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_private_link_resources` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, group_name: str, **kwargs: Any - ) -> _models.HorizonDbPrivateLinkResource: - """Gets a private link resource. + return LROPoller[_models.IdentityAssignment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param group_name: The name of the private link resource. Required. - :type group_name: str - :return: HorizonDbPrivateLinkResource. The HorizonDbPrivateLinkResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _delete_initial( + self, resource_group_name: str, cluster_name: str, destination_name: str, assignment_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4789,12 +12125,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPrivateLinkResource] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_private_link_resources_get_request( + _request = build_identity_assignments_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - group_name=group_name, + destination_name=destination_name, + assignment_name=assignment_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4806,19 +12143,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -4826,35 +12162,109 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbPrivateLinkResource, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, destination_name: str, assignment_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an inactive change data capture identity assignment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :param assignment_name: The caller-selected name of the identity assignment. Required. + :type assignment_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + destination_name=destination_name, + assignment_name=assignment_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return deserialized # type: ignore + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbPrivateLinkResource"]: - """Lists private link resources in a HorizonDB cluster. + self, resource_group_name: str, cluster_name: str, destination_name: str, **kwargs: Any + ) -> ItemPaged["_models.IdentityAssignment"]: + """Lists identity assignments for a change data capture destination. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbPrivateLinkResource - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource] + :param destination_name: The caller-selected name of the change data capture destination. + Required. + :type destination_name: str + :return: An iterator like instance of IdentityAssignment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.IdentityAssignment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbPrivateLinkResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.IdentityAssignment]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4867,9 +12277,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_private_link_resources_list_request( + _request = build_identity_assignments_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + destination_name=destination_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4910,7 +12321,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbPrivateLinkResource], + List[_models.IdentityAssignment], deserialized.get("value", []), ) if cls: @@ -4939,14 +12350,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class HorizonDbParameterGroupsOperations: # pylint: disable=docstring-missing-param +class ChangeDataCaptureConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_parameter_groups` attribute. + :attr:`change_data_capture_configurations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -4958,17 +12369,22 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> _models.HorizonDbParameterGroup: - """Gets information about a HorizonDB parameter group. + self, resource_group_name: str, cluster_name: str, configuration_name: str, **kwargs: Any + ) -> _models.ChangeDataCaptureConfiguration: + """Gets a change data capture configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :return: HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :return: ChangeDataCaptureConfiguration. The ChangeDataCaptureConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4982,11 +12398,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.ChangeDataCaptureConfiguration] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_get_request( + _request = build_change_data_capture_configurations_get_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5021,18 +12438,19 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + deserialized = _deserialize(_models.ChangeDataCaptureConfiguration, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( + def _create_or_replace_initial( self, resource_group_name: str, - parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], + cluster_name: str, + configuration_name: str, + resource: Union[_models.ChangeDataCaptureConfiguration, _types.ChangeDataCaptureConfiguration, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5056,9 +12474,10 @@ def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_parameter_groups_create_or_update_request( + _request = build_change_data_capture_configurations_create_or_replace_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -5092,10 +12511,288 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: _models.ChangeDataCaptureConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: _types.ChangeDataCaptureConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.ChangeDataCaptureConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + resource: Union[_models.ChangeDataCaptureConfiguration, _types.ChangeDataCaptureConfiguration, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Creates or replaces a change data capture configuration that enrolls a PostgreSQL database for + Microsoft Fabric Mirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param resource: Resource create parameters. Is either a ChangeDataCaptureConfiguration type or + a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration or + ~azure.mgmt.horizondb.types.ChangeDataCaptureConfiguration or IO[bytes] + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ChangeDataCaptureConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_replace_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ChangeDataCaptureConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ChangeDataCaptureConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ChangeDataCaptureConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + configuration_name: str, + properties: Union[ + _models.ChangeDataCaptureConfigurationForPatchUpdate, + _types.ChangeDataCaptureConfigurationForPatchUpdate, + IO[bytes], + ], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_change_data_capture_configurations_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -5106,126 +12803,159 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, - parameter_group_name: str, - resource: _models.HorizonDbParameterGroup, + cluster_name: str, + configuration_name: str, + properties: _models.ChangeDataCaptureConfigurationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, - parameter_group_name: str, - resource: _types.HorizonDbParameterGroup, + cluster_name: str, + configuration_name: str, + properties: _types.ChangeDataCaptureConfigurationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbParameterGroup + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, - parameter_group_name: str, - resource: IO[bytes], + cluster_name: str, + configuration_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_update( self, resource_group_name: str, - parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], + cluster_name: str, + configuration_name: str, + properties: Union[ + _models.ChangeDataCaptureConfigurationForPatchUpdate, + _types.ChangeDataCaptureConfigurationForPatchUpdate, + IO[bytes], + ], **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDB parameter group or updates an existing parameter group. + ) -> LROPoller[_models.ChangeDataCaptureConfiguration]: + """Updates mutable change data capture configuration properties. Omitted properties preserve their + current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Is either a HorizonDbParameterGroup type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup or - ~azure.mgmt.horizondb.types.HorizonDbParameterGroup or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :param properties: The resource properties to be updated. Is either a + ChangeDataCaptureConfigurationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.ChangeDataCaptureConfigurationForPatchUpdate or + ~azure.mgmt.horizondb.types.ChangeDataCaptureConfigurationForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns ChangeDataCaptureConfiguration. The + ChangeDataCaptureConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.ChangeDataCaptureConfiguration] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - resource=resource, + cluster_name=cluster_name, + configuration_name=configuration_name, + properties=properties, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -5237,7 +12967,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + deserialized = _deserialize(_models.ChangeDataCaptureConfiguration, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5255,24 +12985,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.HorizonDbParameterGroup].from_continuation_token( + return LROPoller[_models.ChangeDataCaptureConfiguration].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.HorizonDbParameterGroup]( + return LROPoller[_models.ChangeDataCaptureConfiguration]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _update_initial( - self, - resource_group_name: str, - parameter_group_name: str, - properties: Union[ - _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] - ], - **kwargs: Any + def _delete_initial( + self, resource_group_name: str, cluster_name: str, configuration_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5282,26 +13006,17 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_parameter_groups_update_request( + _request = build_change_data_capture_configurations_delete_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5318,7 +13033,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5332,6 +13047,9 @@ def _update_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -5342,169 +13060,209 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - parameter_group_name: str, - properties: _models.HorizonDbParameterGroupForPatchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, configuration_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a change data capture configuration after destination-side replication has been stopped + or detached. This operation never deletes the Microsoft Fabric mirrored-database item. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param configuration_name: The caller-selected ARM-safe name of the change data capture + configuration. The exact PostgreSQL database name is stored in properties.databaseName. + Required. + :type configuration_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def begin_update( - self, - resource_group_name: str, - parameter_group_name: str, - properties: _types.HorizonDbParameterGroupForPatchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + configuration_name=configuration_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.ChangeDataCaptureConfiguration"]: + """Lists change data capture configurations in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ChangeDataCaptureConfiguration + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.ChangeDataCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def begin_update( - self, - resource_group_name: str, - parameter_group_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + cls: ClsType[List[_models.ChangeDataCaptureConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_change_data_capture_configurations_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ChangeDataCaptureConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) + + +class EndpointsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`endpoints` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def begin_update( - self, - resource_group_name: str, - parameter_group_name: str, - properties: Union[ - _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDB parameter group. + def get(self, resource_group_name: str, cluster_name: str, endpoint_name: str, **kwargs: Any) -> _models.Endpoint: + """Gets information about a service-generated HorizonDB Cluster- or Pool-scoped Endpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :param properties: The resource properties to be updated. Is either a - HorizonDbParameterGroupForPatchUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate or - ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param endpoint_name: The platform-assigned name of the HorizonDB endpoint. A Cluster-scoped + ReadWrite Endpoint has exactly the same name as its associated Cluster. A Pool-scoped Endpoint + has exactly the same name as its associated Pool. Required. + :type endpoint_name: str + :return: Endpoint. The Endpoint is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Endpoint :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - properties=properties, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.HorizonDbParameterGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.HorizonDbParameterGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5516,11 +13274,12 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.Endpoint] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_delete_request( + _request = build_endpoints_get_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + endpoint_name=endpoint_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5532,18 +13291,19 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -5551,95 +13311,245 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Endpoint, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def begin_delete(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a HorizonDB parameter group. + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.Endpoint"]: + """Lists the service-generated Endpoints in a cluster. The collection contains the Cluster-scoped + Endpoint named cluster and one Pool-scoped Endpoint for each pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Endpoint + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Endpoint] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + cls: ClsType[List[_models.Endpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_endpoints_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Endpoint], + deserialized.get("value", []), ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class MaintenanceEventsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`maintenance_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, maintenance_event_id: str, **kwargs: Any + ) -> _models.MaintenanceEvent: + """Gets information about a maintenance event for a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :return: MaintenanceEvent. The MaintenanceEvent is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.MaintenanceEvent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceEvent] = kwargs.pop("cls", None) + _request = build_maintenance_events_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + deserialized = _deserialize(_models.MaintenanceEvent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbParameterGroup"]: - """Lists all HorizonDB parameter groups in a resource group. + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.MaintenanceEvent"]: + """Lists maintenance events for a HorizonDB pool. Use the OData $filter query parameter to filter + by properties/status with the eq and or operators. For example, properties/status eq 'Planned' + or properties/status eq 'InProgress' returns upcoming events. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :keyword filter: The OData filter expression to apply to the list operation. Default value is + None. + :paramtype filter: str + :return: An iterator like instance of MaintenanceEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.MaintenanceEvent] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.MaintenanceEvent]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5652,9 +13562,12 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_by_resource_group_request( + _request = build_maintenance_events_list_request( resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, + filter=filter, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5694,7 +13607,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.MaintenanceEvent], deserialized.get("value", []), ) if cls: @@ -5722,19 +13635,281 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + def _reschedule_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, _types.MaintenanceEventRescheduleRequest, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_events_reschedule_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: _models.MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.models.MaintenanceEventRescheduleRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: _types.MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.horizondb.types.MaintenanceEventRescheduleRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbParameterGroup"]: - """Lists all HorizonDB parameter groups in a subscription. + def begin_reschedule( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, _types.MaintenanceEventRescheduleRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Is either a MaintenanceEventRescheduleRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.horizondb.models.MaintenanceEventRescheduleRequest or + ~azure.mgmt.horizondb.types.MaintenanceEventRescheduleRequest or IO[bytes] + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reschedule_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _apply_now_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, maintenance_event_id: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5743,99 +13918,170 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbPar } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_horizon_db_parameter_groups_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_maintenance_events_apply_now_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + response = pipeline_response.http_response - def get_next(next_link=None): - _request = prepare_request(next_link) + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") ) - response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def list_connections( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbParameterGroupConnectionProperties"]: - """Gets all connections to a parameter group. + def begin_apply_now( + self, resource_group_name: str, cluster_name: str, pool_name: str, maintenance_event_id: str, **kwargs: Any + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Applies the maintenance event immediately. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :return: An iterator like instance of HorizonDbParameterGroupConnectionProperties + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param maintenance_event_id: The identifier of the maintenance event. Required. + :type maintenance_event_id: str + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties] + ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroupConnectionProperties]] = kwargs.pop("cls", None) + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._apply_now_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + maintenance_event_id=maintenance_event_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NodesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`nodes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, node_name: str, **kwargs: Any + ) -> _models.Node: + """Gets a node allocated to a HorizonDB pool. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param node_name: The name of the Node. Required. + :type node_name: str + :return: Node. The Node is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.Node + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5844,101 +14090,78 @@ def list_connections( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_parameter_groups_list_connections_request( - resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - return _request + cls: ClsType[_models.Node] = kwargs.pop("cls", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroupConnectionProperties], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _request = build_nodes_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + node_name=node_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def get_next(next_link=None): - _request = prepare_request(next_link) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Node, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def list_versions( - self, resource_group_name: str, parameter_group_name: str, *, version: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbParameterGroup"]: - """Lists parameter groups filtered by version number. + def list( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.Node"]: + """Lists the nodes allocated to a HorizonDB pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDB parameter group. Required. - :type parameter_group_name: str - :keyword version: The version number to filter by. Default value is None. - :paramtype version: int - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An iterator like instance of Node + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.Node] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Node]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5951,11 +14174,11 @@ def list_versions( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_versions_request( + _request = build_nodes_list_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, - version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5995,7 +14218,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.Node], deserialized.get("value", []), ) if cls: @@ -6024,14 +14247,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class HorizonDbAdministratorsOperations: # pylint: disable=docstring-missing-param +class LogCaptureConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_administrators` attribute. + :attr:`log_capture_configurations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6042,34 +14265,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "object_id", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) def get( - self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> _models.HorizonDbAdministrator: - """Gets information about a HorizonDB administrator. + self, resource_group_name: str, cluster_name: str, log_capture_configuration_name: str, **kwargs: Any + ) -> _models.LogCaptureConfiguration: + """Gets a log capture configuration for a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :return: HorizonDbAdministrator. The HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbAdministrator + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :return: LogCaptureConfiguration. The LogCaptureConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.LogCaptureConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6083,12 +14292,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) + cls: ClsType[_models.LogCaptureConfiguration] = kwargs.pop("cls", None) - _request = build_horizon_db_administrators_get_request( + _request = build_log_capture_configurations_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - object_id=object_id, + log_capture_configuration_name=log_capture_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6123,34 +14332,21 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) + deserialized = _deserialize(_models.LogCaptureConfiguration, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "object_id", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - def _create_or_update_initial( + def _update_initial( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], + log_capture_configuration_name: str, + properties: Union[ + _models.LogCaptureConfigurationForPatchUpdate, _types.LogCaptureConfigurationForPatchUpdate, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6169,15 +14365,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(properties, (IOBase, bytes)): + _content = properties else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_administrators_create_or_update_request( + _request = build_log_capture_configurations_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - object_id=object_id, + log_capture_configuration_name=log_capture_configuration_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6198,7 +14394,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6211,10 +14407,11 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6225,203 +14422,315 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: _models.HorizonDbAdministratorAdd, + log_capture_configuration_name: str, + properties: _models.LogCaptureConfigurationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + ) -> LROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.LogCaptureConfigurationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :return: An instance of LROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, cluster_name: str, - object_id: str, - resource: _types.HorizonDbAdministratorAdd, + log_capture_configuration_name: str, + properties: _types.LogCaptureConfigurationForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + ) -> LROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.LogCaptureConfigurationForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :return: An instance of LROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + log_capture_configuration_name: str, + properties: Union[ + _models.LogCaptureConfigurationForPatchUpdate, _types.LogCaptureConfigurationForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.LogCaptureConfiguration]: + """Updates a log capture configuration. Omitted properties preserve their current values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param log_capture_configuration_name: The name of the LogCaptureConfiguration. Required. + :type log_capture_configuration_name: str + :param properties: The resource properties to be updated. Is either a + LogCaptureConfigurationForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.LogCaptureConfigurationForPatchUpdate or + ~azure.mgmt.horizondb.types.LogCaptureConfigurationForPatchUpdate or IO[bytes] + :return: An instance of LROPoller that returns LogCaptureConfiguration. The + LogCaptureConfiguration is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.LogCaptureConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LogCaptureConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + log_capture_configuration_name=log_capture_configuration_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LogCaptureConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LogCaptureConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogCaptureConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.LogCaptureConfiguration"]: + """Lists the log capture configurations for a HorizonDB cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of LogCaptureConfiguration + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.LogCaptureConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LogCaptureConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_log_capture_configurations_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LogCaptureConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - object_id: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) + + +class LogFilesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`log_files` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "object_id", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - object_id: str, - resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.HorizonDbAdministrator]: - """Creates a new HorizonDB administrator or updates an existing administrator. + def get(self, resource_group_name: str, cluster_name: str, log_file_name: str, **kwargs: Any) -> _models.LogFile: + """Gets metadata for a captured HorizonDB log file. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :param resource: Resource create parameters. Is either a HorizonDbAdministratorAdd type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd or - ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd or IO[bytes] - :return: An instance of LROPoller that returns HorizonDbAdministrator. The - HorizonDbAdministrator is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :param log_file_name: The name of the LogFile. Required. + :type log_file_name: str + :return: LogFile. The LogFile is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.LogFile :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - object_id=object_id, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.HorizonDbAdministrator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.HorizonDbAdministrator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def _delete_initial( - self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6433,12 +14742,12 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.LogFile] = kwargs.pop("cls", None) - _request = build_horizon_db_administrators_delete_request( + _request = build_log_files_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - object_id=object_id, + log_file_name=log_file_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6450,18 +14759,19 @@ def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -6469,116 +14779,33 @@ def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LogFile, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def begin_delete( - self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a HorizonDB administrator. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDB cluster. Required. - :type cluster_name: str - :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. - :type object_id: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - object_id=object_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-05-01-preview"], - ) - def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbAdministrator"]: - """Lists all HorizonDB administrators in a cluster. + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.LogFile"]: + """Lists captured log files for a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbAdministrator - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :return: An iterator like instance of LogFile + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.LogFile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbAdministrator]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.LogFile]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6591,7 +14818,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_administrators_list_request( + _request = build_log_files_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -6634,7 +14861,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbAdministrator], + List[_models.LogFile], deserialized.get("value", []), ) if cls: @@ -6661,3 +14888,80 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_download_urls( + self, resource_group_name: str, cluster_name: str, log_file_name: str, **kwargs: Any + ) -> _models.LogFileDownloadUrl: + """Gets a short-lived signed URL for downloading a captured log file. The signed URL is returned + only by this action so routine resource GET and LIST responses do not expose bearer + credentials. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param log_file_name: The name of the LogFile. Required. + :type log_file_name: str + :return: LogFileDownloadUrl. The LogFileDownloadUrl is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.LogFileDownloadUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogFileDownloadUrl] = kwargs.pop("cls", None) + + _request = build_log_files_list_download_urls_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + log_file_name=log_file_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LogFileDownloadUrl, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py index 5e333ef4bd38..fae5f219495d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,27 +7,75 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING, Union +from typing import Any, Literal, TYPE_CHECKING, Union from typing_extensions import Required, TypedDict +from .models._enums import ( + ChangeDataCaptureDestinationType, + ChangeDataCaptureProtocol, + ScheduledMaintenanceManagementType, +) + if TYPE_CHECKING: from .models import ( + AiModelManagementStatus, AuthenticationState, - CreateModeCluster, + ChangeDataCaptureDesiredState, + ChangeDataCaptureDestinationEffectiveState, + ChangeDataCaptureEffectiveState, + ChangeDataCaptureEngineConfigurationState, + ChangeDataCaptureExtensionState, + ChangeDataCaptureIdentityActivationState, + ChangeDataCaptureIdentityAssignmentState, + ChangeDataCaptureIdentityValidationState, + ChangeDataCaptureReadWriteEndpointState, + ChangeDataCaptureReplicationArchitecture, + ChangeDataCaptureReplicationState, + ChangeDataCaptureTopologyBindingState, + ChangeDataCaptureUsageProfile, + ClusterCreateMode, + ClusterState, + ComputeProcessorType, CreatedByType, - HorizonDbComputeModelType, - ManagedServiceIdentityType, + GeoRedundancyState, + HorizonDbClusterDataEncryptionType, + HorizonDbClusterEncryptionKeyStatus, + HorizonDbClusterIdentityType, + LogCaptureState, + ParameterApplyMethod, + ParameterGroupSyncStatus, + ParameterValueSource, + PoolComputeModelType, + PoolHighAvailabilityMode, + PoolState, + PostgreSqlVersion, PrincipalTypes, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, ProvisioningState, PublicNetworkAccessState, - ReplicaRole, - State, - ZonePlacementPolicy, ) +class ActivateChangeDataCaptureIdentityRequest(TypedDict, total=False): + """The request to activate an identity assignment for a change data capture destination. + + :ivar identityAssignmentResourceId: The resource ID of an inactive, successfully validated + identity assignment under the destination receiving the action. Required. + :vartype identityAssignmentResourceId: str + :ivar drainExistingSessions: Whether existing destination sessions should drain before the + identity cutover. The default is false. + :vartype drainExistingSessions: bool + """ + + identityAssignmentResourceId: Required[str] + """The resource ID of an inactive, successfully validated identity assignment under the + destination receiving the action. Required.""" + drainExistingSessions: bool + """Whether existing destination sessions should drain before the identity cutover. The default is + false.""" + + class Resource(TypedDict, total=False): """Resource. @@ -73,42 +121,554 @@ class ProxyResource(Resource): """ -class HorizonDbAdministratorAdd(TypedDict, total=False): - """The request body for adding a HorizonDB administrator. +class BackupProperties(TypedDict, total=False): + """Backup configuration properties for a HorizonDB cluster. - :ivar properties: The properties for adding a HorizonDB administrator. Required. - :vartype properties: "HorizonDbAdministratorPropertiesForAdd" + :ivar geoRedundancy: The geo-redundancy state. Geo-redundant backup is not supported when + dataEncryption.type is AzureKeyVault. Required. Known values are: "Enabled" and "Disabled". + :vartype geoRedundancy: Union[str, "GeoRedundancyState"] + :ivar retentionDays: The number of days that automatic backups are retained. The service + defaults to 7 days when this property is omitted. + :vartype retentionDays: int + :ivar earliestRestorePointUtc: The earliest point in time, in UTC, to which the cluster can + currently be restored. + :vartype earliestRestorePointUtc: str """ - properties: Required["HorizonDbAdministratorPropertiesForAdd"] - """The properties for adding a HorizonDB administrator. Required.""" + geoRedundancy: Required[Union[str, "GeoRedundancyState"]] + """The geo-redundancy state. Geo-redundant backup is not supported when dataEncryption.type is + AzureKeyVault. Required. Known values are: \"Enabled\" and \"Disabled\".""" + retentionDays: int + """The number of days that automatic backups are retained. The service defaults to 7 days when + this property is omitted.""" + earliestRestorePointUtc: str + """The earliest point in time, in UTC, to which the cluster can currently be restored.""" -class HorizonDbAdministratorPropertiesForAdd(TypedDict, total=False): - """The properties for adding a HorizonDB administrator. +class BackupPropertiesForPatchUpdate(TypedDict, total=False): + """Backup configuration properties for updating a HorizonDB cluster. - :ivar principalName: The display name or UPN of the Entra ID principal. For users, typically - the User Principal Name (e.g., `admin@contoso.com `_). For groups, - the group display name. For service principals, the application display name. Required. - :vartype principalName: str - :ivar principalType: The type of the Entra ID principal. Required. Known values are: "Unknown", - "User", "Group", and "ServicePrincipal". - :vartype principalType: Union[str, "PrincipalTypes"] - :ivar tenantId: The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the - tenant of the subscription. + :ivar retentionDays: The number of days that automatic backups are retained. + :vartype retentionDays: int + """ + + retentionDays: int + """The number of days that automatic backups are retained.""" + + +class ChangeDataCaptureCapability(ProxyResource): + """The singleton change data capture capability for a HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "ChangeDataCaptureCapabilityProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: "ChangeDataCaptureCapabilityProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class ChangeDataCaptureCapabilityForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """A sparse update request for the singleton change data capture capability. + + :ivar properties: The capability properties to update. + :vartype properties: "ChangeDataCaptureCapabilityPropertiesForPatchUpdate" + """ + + properties: "ChangeDataCaptureCapabilityPropertiesForPatchUpdate" + """The capability properties to update.""" + + +class ChangeDataCaptureCapabilityProperties(TypedDict, total=False): + """The properties of the singleton change data capture capability. + + :ivar desiredState: The requested capability state. Required. Known values are: "Enabled" and + "Disabled". + :vartype desiredState: Union[str, "ChangeDataCaptureDesiredState"] + :ivar effectiveState: The current effective capability state. Required. Known values are: + "Enabling", "Enabled", "Disabling", "Disabled", "Degraded", and "Failed". + :vartype effectiveState: Union[str, "ChangeDataCaptureEffectiveState"] + :ivar provisioningState: The provisioning state of the latest capability mutation. Known values + are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar autoUpgradeExtension: Whether HorizonDB may automatically upgrade the service-owned + change data capture extension within the supported compatibility policy. + :vartype autoUpgradeExtension: bool + :ivar replicationArchitecture: The implementation architecture currently used for change + capture. Required. Known values are: "ComputeBased", "StorageBased", and "Hybrid". + :vartype replicationArchitecture: Union[str, "ChangeDataCaptureReplicationArchitecture"] + :ivar extension: The installed change data capture extension and its current lifecycle state. + Required. + :vartype extension: "ChangeDataCaptureExtensionStatus" + :ivar prerequisites: The current readiness of change data capture engine and read-write + endpoint prerequisites. Required. + :vartype prerequisites: "ChangeDataCapturePrerequisiteStatus" + :ivar destinationCount: The number of change data capture destinations under this cluster. + Required. + :vartype destinationCount: int + :ivar configurationCount: The number of change data capture configurations under this cluster. + Required. + :vartype configurationCount: int + :ivar status: Customer-safe health information for the capability. Required. + :vartype status: "ChangeDataCaptureStatus" + """ + + desiredState: Required[Union[str, "ChangeDataCaptureDesiredState"]] + """The requested capability state. Required. Known values are: \"Enabled\" and \"Disabled\".""" + effectiveState: Required[Union[str, "ChangeDataCaptureEffectiveState"]] + """The current effective capability state. Required. Known values are: \"Enabling\", \"Enabled\", + \"Disabling\", \"Disabled\", \"Degraded\", and \"Failed\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the latest capability mutation. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + autoUpgradeExtension: bool + """Whether HorizonDB may automatically upgrade the service-owned change data capture extension + within the supported compatibility policy.""" + replicationArchitecture: Required[Union[str, "ChangeDataCaptureReplicationArchitecture"]] + """The implementation architecture currently used for change capture. Required. Known values are: + \"ComputeBased\", \"StorageBased\", and \"Hybrid\".""" + extension: Required["ChangeDataCaptureExtensionStatus"] + """The installed change data capture extension and its current lifecycle state. Required.""" + prerequisites: Required["ChangeDataCapturePrerequisiteStatus"] + """The current readiness of change data capture engine and read-write endpoint prerequisites. + Required.""" + destinationCount: Required[int] + """The number of change data capture destinations under this cluster. Required.""" + configurationCount: Required[int] + """The number of change data capture configurations under this cluster. Required.""" + status: Required["ChangeDataCaptureStatus"] + """Customer-safe health information for the capability. Required.""" + + +class ChangeDataCaptureCapabilityPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for updating the singleton change data capture capability. Omitted properties + preserve their current values. + + :ivar desiredState: The requested capability state. Known values are: "Enabled" and "Disabled". + :vartype desiredState: Union[str, "ChangeDataCaptureDesiredState"] + :ivar autoUpgradeExtension: Whether HorizonDB may automatically upgrade the service-owned + change data capture extension within the supported compatibility policy. + :vartype autoUpgradeExtension: bool + """ + + desiredState: Union[str, "ChangeDataCaptureDesiredState"] + """The requested capability state. Known values are: \"Enabled\" and \"Disabled\".""" + autoUpgradeExtension: bool + """Whether HorizonDB may automatically upgrade the service-owned change data capture extension + within the supported compatibility policy.""" + + +class ChangeDataCaptureConfiguration(ProxyResource): + """A HorizonDB database enrollment for Microsoft Fabric Mirroring. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "ChangeDataCaptureConfigurationProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: "ChangeDataCaptureConfigurationProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class ChangeDataCaptureConfigurationForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """A sparse update request for a change data capture configuration. + + :ivar properties: The configuration properties to update. + :vartype properties: "ChangeDataCaptureConfigurationPropertiesForPatchUpdate" + """ + + properties: "ChangeDataCaptureConfigurationPropertiesForPatchUpdate" + """The configuration properties to update.""" + + +class ChangeDataCaptureConfigurationProperties(TypedDict, total=False): + """The properties of a Microsoft Fabric Mirroring configuration. + + :ivar databaseName: The exact PostgreSQL database name enrolled in this logical stream. This + value is immutable. Required. + :vartype databaseName: str + :ivar usageProfile: The immutable usage profile. API version 2026-10-01-preview accepts + Mirroring only. Required. "Mirroring" + :vartype usageProfile: Union[str, "ChangeDataCaptureUsageProfile"] + :ivar destinationResourceId: The immutable resource ID of an enabled change data capture + destination under the same cluster. Required. + :vartype destinationResourceId: str + :ivar logicalStreamId: A service-generated identifier for the logical stream, represented as an + RFC 4122 GUID. This value remains stable when a writer role moves and the service materializes + a replacement ARM resource under the new writer cluster. Required. + :vartype logicalStreamId: str + :ivar desiredState: The requested configuration state. Required. Known values are: "Enabled" + and "Disabled". + :vartype desiredState: Union[str, "ChangeDataCaptureDesiredState"] + :ivar effectiveState: The current effective configuration state. Required. Known values are: + "Enabling", "Enabled", "Disabling", "Disabled", "Degraded", and "Failed". + :vartype effectiveState: Union[str, "ChangeDataCaptureEffectiveState"] + :ivar provisioningState: The provisioning state of the latest configuration mutation. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar extension: The change data capture extension state for the enrolled database. Required. + :vartype extension: "ChangeDataCaptureExtensionStatus" + :ivar replication: The known status of the destination-owned replication session. Required. + :vartype replication: "ChangeDataCaptureReplicationStatus" + :ivar topology: The current writer-topology binding for this logical stream. Required. + :vartype topology: "ChangeDataCaptureTopologyBindingStatus" + :ivar status: Customer-safe health information for the configuration. Required. + :vartype status: "ChangeDataCaptureStatus" + """ + + databaseName: Required[str] + """The exact PostgreSQL database name enrolled in this logical stream. This value is immutable. + Required.""" + usageProfile: Required[Union[str, "ChangeDataCaptureUsageProfile"]] + """The immutable usage profile. API version 2026-10-01-preview accepts Mirroring only. Required. + \"Mirroring\"""" + destinationResourceId: Required[str] + """The immutable resource ID of an enabled change data capture destination under the same cluster. + Required.""" + logicalStreamId: Required[str] + """A service-generated identifier for the logical stream, represented as an RFC 4122 GUID. This + value remains stable when a writer role moves and the service materializes a replacement ARM + resource under the new writer cluster. Required.""" + desiredState: Required[Union[str, "ChangeDataCaptureDesiredState"]] + """The requested configuration state. Required. Known values are: \"Enabled\" and \"Disabled\".""" + effectiveState: Required[Union[str, "ChangeDataCaptureEffectiveState"]] + """The current effective configuration state. Required. Known values are: \"Enabling\", + \"Enabled\", \"Disabling\", \"Disabled\", \"Degraded\", and \"Failed\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the latest configuration mutation. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + extension: Required["ChangeDataCaptureExtensionStatus"] + """The change data capture extension state for the enrolled database. Required.""" + replication: Required["ChangeDataCaptureReplicationStatus"] + """The known status of the destination-owned replication session. Required.""" + topology: Required["ChangeDataCaptureTopologyBindingStatus"] + """The current writer-topology binding for this logical stream. Required.""" + status: Required["ChangeDataCaptureStatus"] + """Customer-safe health information for the configuration. Required.""" + + +class ChangeDataCaptureConfigurationPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for updating a change data capture configuration. Omitted properties preserve their + current values. + + :ivar desiredState: The requested configuration state. Known values are: "Enabled" and + "Disabled". + :vartype desiredState: Union[str, "ChangeDataCaptureDesiredState"] + """ + + desiredState: Union[str, "ChangeDataCaptureDesiredState"] + """The requested configuration state. Known values are: \"Enabled\" and \"Disabled\".""" + + +class ChangeDataCaptureDestination(ProxyResource): + """A reusable Microsoft Fabric destination for HorizonDB change data capture configurations. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "ChangeDataCaptureDestinationProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: "ChangeDataCaptureDestinationProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class ChangeDataCaptureDestinationForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """A sparse update request for a change data capture destination. + + :ivar properties: The destination properties to update. + :vartype properties: "ChangeDataCaptureDestinationPropertiesForPatchUpdate" + """ + + properties: "ChangeDataCaptureDestinationPropertiesForPatchUpdate" + """The destination properties to update.""" + + +class ChangeDataCaptureDestinationProperties(TypedDict, total=False): + """The properties of a Microsoft Fabric change data capture destination. + + :ivar destination: The immutable Microsoft Fabric destination settings. Resubmitting the same + values is accepted; changing them requires deleting and recreating the destination. Required. + :vartype destination: "ChangeDataCaptureDestinationDetails" + :ivar desiredState: The requested destination state. Required. Known values are: "Enabled" and + "Disabled". + :vartype desiredState: Union[str, "ChangeDataCaptureDesiredState"] + :ivar effectiveState: The current effective destination state. Required. Known values are: + "WaitingForIdentity", "Enabling", "Enabled", "Disabling", "Disabled", "Degraded", and "Failed". + :vartype effectiveState: Union[str, "ChangeDataCaptureDestinationEffectiveState"] + :ivar provisioningState: The provisioning state of the latest destination mutation. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar activeIdentityAssignmentResourceId: The resource ID of the currently active identity + assignment, if one is active. + :vartype activeIdentityAssignmentResourceId: str + :ivar configurationCount: The number of change data capture configurations that reference this + destination. Required. + :vartype configurationCount: int + :ivar status: Customer-safe health information for the destination. Required. + :vartype status: "ChangeDataCaptureStatus" + """ + + destination: Required["ChangeDataCaptureDestinationDetails"] + """The immutable Microsoft Fabric destination settings. Resubmitting the same values is accepted; + changing them requires deleting and recreating the destination. Required.""" + desiredState: Required[Union[str, "ChangeDataCaptureDesiredState"]] + """The requested destination state. Required. Known values are: \"Enabled\" and \"Disabled\".""" + effectiveState: Required[Union[str, "ChangeDataCaptureDestinationEffectiveState"]] + """The current effective destination state. Required. Known values are: \"WaitingForIdentity\", + \"Enabling\", \"Enabled\", \"Disabling\", \"Disabled\", \"Degraded\", and \"Failed\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the latest destination mutation. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + activeIdentityAssignmentResourceId: str + """The resource ID of the currently active identity assignment, if one is active.""" + configurationCount: Required[int] + """The number of change data capture configurations that reference this destination. Required.""" + status: Required["ChangeDataCaptureStatus"] + """Customer-safe health information for the destination. Required.""" + + +class ChangeDataCaptureDestinationPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for updating a change data capture destination. Omitted properties preserve their + current values. + + :ivar desiredState: The requested destination state. Known values are: "Enabled" and + "Disabled". + :vartype desiredState: Union[str, "ChangeDataCaptureDesiredState"] + """ + + desiredState: Union[str, "ChangeDataCaptureDesiredState"] + """The requested destination state. Known values are: \"Enabled\" and \"Disabled\".""" + + +class ChangeDataCaptureExtensionStatus(TypedDict, total=False): + """The installed HorizonDB change data capture extension and its current state. + + :ivar name: The extension name. Required. + :vartype name: str + :ivar version: The installed extension version. Required. + :vartype version: str + :ivar state: The current extension lifecycle state. Required. Known values are: "NotInstalled", + "Installing", "Ready", "Upgrading", "Removing", and "Failed". + :vartype state: Union[str, "ChangeDataCaptureExtensionState"] + """ + + name: Required[str] + """The extension name. Required.""" + version: Required[str] + """The installed extension version. Required.""" + state: Required[Union[str, "ChangeDataCaptureExtensionState"]] + """The current extension lifecycle state. Required. Known values are: \"NotInstalled\", + \"Installing\", \"Ready\", \"Upgrading\", \"Removing\", and \"Failed\".""" + + +class ChangeDataCaptureIdentityAssignmentProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of a change data capture identity assignment. + + :ivar identityResourceId: The immutable resource ID of the user-assigned managed identity + selected for this destination. The ID must exactly match a key in the parent cluster's + top-level identity.userAssignedIdentities dictionary; otherwise creation is rejected. Attaching + the identity to the cluster does not grant destination access, so required role assignments + must be configured separately. Resubmitting the same value is accepted; changing it requires + deleting and recreating the assignment. Required. + :vartype identityResourceId: str + :ivar effectiveState: The current assignment lifecycle state. Required. Known values are: + "Assigning", "Assigned", "Removing", and "Failed". + :vartype effectiveState: Union[str, "ChangeDataCaptureIdentityAssignmentState"] + :ivar activationState: The current activation state within the parent destination. Required. + Known values are: "Inactive", "Activating", "Active", "Deactivating", and "Failed". + :vartype activationState: Union[str, "ChangeDataCaptureIdentityActivationState"] + :ivar principalId: The Microsoft Entra principal ID resolved from the user-assigned managed + identity, represented as an RFC 4122 GUID. Required. + :vartype principalId: str + :ivar tenantId: The Microsoft Entra tenant ID resolved from the user-assigned managed identity, + represented as an RFC 4122 GUID. Required. :vartype tenantId: str + :ivar provisioningState: The provisioning state of the latest identity-assignment mutation. + Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar validation: The latest validation result for this identity assignment. Required. + :vartype validation: "IdentityValidationStatus" + :ivar status: Customer-safe health information for the identity assignment. Required. + :vartype status: "ChangeDataCaptureStatus" """ - principalName: Required[str] - """The display name or UPN of the Entra ID principal. For users, typically the User Principal Name - (e.g., `admin@contoso.com `_). For groups, the group display name. - For service principals, the application display name. Required.""" - principalType: Required[Union[str, "PrincipalTypes"]] - """The type of the Entra ID principal. Required. Known values are: \"Unknown\", \"User\", - \"Group\", and \"ServicePrincipal\".""" - tenantId: str - """The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the tenant of the - subscription.""" + identityResourceId: Required[str] + """The immutable resource ID of the user-assigned managed identity selected for this destination. + The ID must exactly match a key in the parent cluster's top-level + identity.userAssignedIdentities dictionary; otherwise creation is rejected. Attaching the + identity to the cluster does not grant destination access, so required role assignments must be + configured separately. Resubmitting the same value is accepted; changing it requires deleting + and recreating the assignment. Required.""" + effectiveState: Required[Union[str, "ChangeDataCaptureIdentityAssignmentState"]] + """The current assignment lifecycle state. Required. Known values are: \"Assigning\", + \"Assigned\", \"Removing\", and \"Failed\".""" + activationState: Required[Union[str, "ChangeDataCaptureIdentityActivationState"]] + """The current activation state within the parent destination. Required. Known values are: + \"Inactive\", \"Activating\", \"Active\", \"Deactivating\", and \"Failed\".""" + principalId: Required[str] + """The Microsoft Entra principal ID resolved from the user-assigned managed identity, represented + as an RFC 4122 GUID. Required.""" + tenantId: Required[str] + """The Microsoft Entra tenant ID resolved from the user-assigned managed identity, represented as + an RFC 4122 GUID. Required.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the latest identity-assignment mutation. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + validation: Required["IdentityValidationStatus"] + """The latest validation result for this identity assignment. Required.""" + status: Required["ChangeDataCaptureStatus"] + """Customer-safe health information for the identity assignment. Required.""" + + +class ChangeDataCapturePrerequisiteStatus(TypedDict, total=False): + """The current readiness of prerequisites shared by change data capture configurations. + + :ivar engineConfigurationState: The readiness of the required engine configuration. Required. + Known values are: "Ready", "NotReady", "Reconciling", and "Failed". + :vartype engineConfigurationState: Union[str, "ChangeDataCaptureEngineConfigurationState"] + :ivar readWriteEndpointState: The availability of the read-write endpoint required for engine + mutations. Required. Known values are: "Ready" and "Unavailable". + :vartype readWriteEndpointState: Union[str, "ChangeDataCaptureReadWriteEndpointState"] + """ + + engineConfigurationState: Required[Union[str, "ChangeDataCaptureEngineConfigurationState"]] + """The readiness of the required engine configuration. Required. Known values are: \"Ready\", + \"NotReady\", \"Reconciling\", and \"Failed\".""" + readWriteEndpointState: Required[Union[str, "ChangeDataCaptureReadWriteEndpointState"]] + """The availability of the read-write endpoint required for engine mutations. Required. Known + values are: \"Ready\" and \"Unavailable\".""" + + +class ChangeDataCaptureReplicationStatus(TypedDict, total=False): + """The destination-owned replication-session status known to HorizonDB. + + :ivar state: The current replication-session state. Required. Known values are: + "NotApplicable", "NotConnected", "Connecting", "Replicating", "Reconnecting", "Paused", + "Stopping", "Degraded", and "Failed". + :vartype state: Union[str, "ChangeDataCaptureReplicationState"] + :ivar externalArtifactId: An opaque identifier of a destination-owned artifact, such as a + Microsoft Fabric mirrored-database item. HorizonDB does not create, update, or delete the + identified artifact. + :vartype externalArtifactId: str + :ivar lastConnectedAtUtc: The date and time, in UTC, when a destination session most recently + connected. + :vartype lastConnectedAtUtc: str + """ + + state: Required[Union[str, "ChangeDataCaptureReplicationState"]] + """The current replication-session state. Required. Known values are: \"NotApplicable\", + \"NotConnected\", \"Connecting\", \"Replicating\", \"Reconnecting\", \"Paused\", \"Stopping\", + \"Degraded\", and \"Failed\".""" + externalArtifactId: str + """An opaque identifier of a destination-owned artifact, such as a Microsoft Fabric + mirrored-database item. HorizonDB does not create, update, or delete the identified artifact.""" + lastConnectedAtUtc: str + """The date and time, in UTC, when a destination session most recently connected.""" + + +class ChangeDataCaptureStatus(TypedDict, total=False): + """Customer-safe health information for a HorizonDB change data capture resource. + + :ivar code: A stable machine-readable status code. Required. + :vartype code: str + :ivar message: A localized customer-safe description of the current status. Required. + :vartype message: str + """ + + code: Required[str] + """A stable machine-readable status code. Required.""" + message: Required[str] + """A localized customer-safe description of the current status. Required.""" + + +class ChangeDataCaptureTopologyBindingStatus(TypedDict, total=False): + """The current writer-topology binding of a change data capture configuration. + + :ivar state: The configuration's relationship to the current writer topology. Required. Known + values are: "Active", "Reconciling", "RebindRequired", "Superseded", and "Conflict". + :vartype state: Union[str, "ChangeDataCaptureTopologyBindingState"] + :ivar generation: A monotonically increasing topology generation for this logical stream. + Required. + :vartype generation: int + :ivar activeClusterResourceId: The Azure resource ID of the cluster that currently owns the + active configuration projection. Required. + :vartype activeClusterResourceId: str + :ivar replacementConfigurationResourceId: The replacement configuration resource ID when this + projection has been superseded or requires rebinding. + :vartype replacementConfigurationResourceId: str + """ + + state: Required[Union[str, "ChangeDataCaptureTopologyBindingState"]] + """The configuration's relationship to the current writer topology. Required. Known values are: + \"Active\", \"Reconciling\", \"RebindRequired\", \"Superseded\", and \"Conflict\".""" + generation: Required[int] + """A monotonically increasing topology generation for this logical stream. Required.""" + activeClusterResourceId: Required[str] + """The Azure resource ID of the cluster that currently owns the active configuration projection. + Required.""" + replacementConfigurationResourceId: str + """The replacement configuration resource ID when this projection has been superseded or requires + rebinding.""" class TrackedResource(Resource): @@ -137,7 +697,7 @@ class TrackedResource(Resource): """The geo-location where the resource lives. Required.""" -class HorizonDbCluster(TrackedResource): +class Cluster(TrackedResource): """Represents the HorizonDB cluster. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -156,251 +716,272 @@ class HorizonDbCluster(TrackedResource): :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: "HorizonDbClusterProperties" - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: "ManagedServiceIdentity" + :vartype properties: "ClusterProperties" + :ivar identity: The managed service identities assigned to this resource. Omitting the entire + identity property from PUT or PATCH preserves all current assignments. When provided, PUT + replaces the user-assigned identity set and PATCH merges it; null PATCH dictionary entries + remove individual identities. Setting type to None clears all assignments. + :vartype identity: "HorizonDbClusterManagedServiceIdentity" """ - properties: "HorizonDbClusterProperties" + properties: "ClusterProperties" """The resource-specific properties for this resource.""" - identity: "ManagedServiceIdentity" - """The managed service identities assigned to this resource.""" - - -class HorizonDbClusterAuthConfig(TypedDict, total=False): - """Authentication configuration for a HorizonDB cluster. - - :ivar entraIdAuth: Indicates whether Microsoft Entra ID authentication is enabled or disabled. - Known values are: "Enabled" and "Disabled". - :vartype entraIdAuth: Union[str, "AuthenticationState"] - :ivar tenantId: The Microsoft Entra tenant ID. - :vartype tenantId: str - :ivar passwordAuth: Indicates whether password authentication is enabled or disabled. Known - values are: "Enabled" and "Disabled". - :vartype passwordAuth: Union[str, "AuthenticationState"] - """ - - entraIdAuth: Union[str, "AuthenticationState"] - """Indicates whether Microsoft Entra ID authentication is enabled or disabled. Known values are: - \"Enabled\" and \"Disabled\".""" - tenantId: str - """The Microsoft Entra tenant ID.""" - passwordAuth: Union[str, "AuthenticationState"] - """Indicates whether password authentication is enabled or disabled. Known values are: \"Enabled\" - and \"Disabled\".""" + identity: "HorizonDbClusterManagedServiceIdentity" + """The managed service identities assigned to this resource. Omitting the entire identity property + from PUT or PATCH preserves all current assignments. When provided, PUT replaces the + user-assigned identity set and PATCH merges it; null PATCH dictionary entries remove individual + identities. Setting type to None clears all assignments.""" -class HorizonDbClusterForPatchUpdate(TypedDict, total=False): +class ClusterForPatchUpdate(TypedDict, total=False): """HorizonDB cluster for update operations. :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: "ManagedServiceIdentity" + :ivar identity: The managed service identities assigned to this resource. Omitting the entire + identity property from PUT or PATCH preserves all current assignments. When provided, PUT + replaces the user-assigned identity set and PATCH merges it; null PATCH dictionary entries + remove individual identities. Setting type to None clears all assignments. + :vartype identity: "HorizonDbClusterManagedServiceIdentity" :ivar properties: The properties that can be updated for a HorizonDB cluster. - :vartype properties: "HorizonDbClusterPropertiesForPatchUpdate" + :vartype properties: "ClusterPropertiesForPatchUpdate" """ tags: dict[str, str] """Resource tags.""" - identity: "ManagedServiceIdentity" - """The managed service identities assigned to this resource.""" - properties: "HorizonDbClusterPropertiesForPatchUpdate" + identity: "HorizonDbClusterManagedServiceIdentity" + """The managed service identities assigned to this resource. Omitting the entire identity property + from PUT or PATCH preserves all current assignments. When provided, PUT replaces the + user-assigned identity set and PATCH merges it; null PATCH dictionary entries remove individual + identities. Setting type to None clears all assignments.""" + properties: "ClusterPropertiesForPatchUpdate" """The properties that can be updated for a HorizonDB cluster.""" -class HorizonDbClusterMirroring(TypedDict, total=False): - """Mirroring configuration for a HorizonDB cluster. +class ClusterProperties(TypedDict, total=False): + """Properties of a HorizonDB cluster. - :ivar databaseNames: The names of the databases to mirror. - :vartype databaseNames: list[str] - :ivar userAssignedIdentityId: The resource ID of the user-assigned managed identity used for - mirroring. - :vartype userAssignedIdentityId: str + :ivar postgreSqlVersion: The PostgreSQL major version used by the HorizonDB cluster. API + version 2026-10-01-preview supports versions 17 and 18. For ordinary cluster creation, the + version is supplied in the request and is immutable after creation. For point-in-time restore, + the service obtains the version from the source backup metadata and the request must omit this + property. This API version does not support in-place PostgreSQL major-version upgrades. Known + values are: "17" and "18". + :vartype postgreSqlVersion: Union[str, "PostgreSqlVersion"] + :ivar creationMode: The mode used to create the cluster. When this property is omitted while + creating a new cluster, the service records Create. PointInTimeRestore creates a new cluster + from an available backup; pointInTimeUtc and creationSourceClusterResourceId are then required, + postgreSqlVersion must be omitted because it is obtained from the backup metadata, and + creationSourceClusterLocation is required when the source and target cluster locations differ. + This property is immutable and is returned as creation provenance. On replacement, omission + preserves the recorded value, resubmitting the same value is accepted, and changing it is + rejected. Known values are: "Create" and "PointInTimeRestore". + :vartype creationMode: Union[str, "ClusterCreateMode"] + :ivar pointInTimeUtc: The requested point in time, in UTC. This property is required in every + PointInTimeRestore request. For a same-location restore, the service restores the latest backup + available at or before this value. For a cross-location restore, the service requires but + ignores this value and restores the latest available backup; cross-location responses omit this + property. This property must be absent for other creation modes or when creationMode is omitted + and can only be specified during resource creation. + :vartype pointInTimeUtc: str + :ivar creationSourceClusterResourceId: The Azure resource ID of the source HorizonDB cluster + used by the selected creation mode. This property is required for PointInTimeRestore and other + source-based creation modes, and must be absent when creationMode is Create or omitted. A + source cluster does not need to have a pool to be restored, provided an available backup + exists. This immutable creation-provenance value does not change after creation. + :vartype creationSourceClusterResourceId: str + :ivar creationSourceClusterLocation: The Azure location of the source HorizonDB cluster used + for point-in-time restore. This property is optional when the source and target cluster + locations are the same. It is required when the source cluster location differs from the target + cluster location and must identify the source cluster's location. This property must be absent + for creation modes other than PointInTimeRestore or when creationMode is omitted. This + immutable creation-provenance value does not change after creation. + :vartype creationSourceClusterLocation: str + :ivar network: The network configuration for the cluster. When this object is omitted, the + service defaults it to publicAccess Disabled. + :vartype network: "Network" + :ivar backup: The backup configuration for the cluster. + :vartype backup: "BackupProperties" + :ivar dataEncryption: The data encryption configuration for the cluster. When omitted during + initial cluster creation, the service uses SystemManaged encryption. When supplied during + initial cluster creation, type is required. For PUT updates of an existing cluster, type may be + omitted; if provided, it must match the existing encryption type. The encryption type is + selected at cluster creation; switching between SystemManaged and AzureKeyVault after creation + is not supported. + :vartype dataEncryption: "HorizonDbClusterDataEncryption" + :ivar aiModelManagement: Specifies whether AI Model Management is enabled for the cluster. + Known values are: "Enabled" and "Disabled". + :vartype aiModelManagement: Union[str, "AiModelManagementStatus"] + :ivar state: Current state of the cluster. Required. Known values are: "Ready", "Provisioning", + "Deleting", "Inaccessible", and "Updating". + :vartype state: Union[str, "ClusterState"] + :ivar provisioningState: The provisioning state of the cluster. Required. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar readWritePool: The pool currently designated to host the cluster's read-write node. + Required. + :vartype readWritePool: "ReadWritePoolProperties" """ - databaseNames: list[str] - """The names of the databases to mirror.""" - userAssignedIdentityId: str - """The resource ID of the user-assigned managed identity used for mirroring.""" + postgreSqlVersion: Union[str, "PostgreSqlVersion"] + """The PostgreSQL major version used by the HorizonDB cluster. API version 2026-10-01-preview + supports versions 17 and 18. For ordinary cluster creation, the version is supplied in the + request and is immutable after creation. For point-in-time restore, the service obtains the + version from the source backup metadata and the request must omit this property. This API + version does not support in-place PostgreSQL major-version upgrades. Known values are: \"17\" + and \"18\".""" + creationMode: Union[str, "ClusterCreateMode"] + """The mode used to create the cluster. When this property is omitted while creating a new + cluster, the service records Create. PointInTimeRestore creates a new cluster from an available + backup; pointInTimeUtc and creationSourceClusterResourceId are then required, postgreSqlVersion + must be omitted because it is obtained from the backup metadata, and + creationSourceClusterLocation is required when the source and target cluster locations differ. + This property is immutable and is returned as creation provenance. On replacement, omission + preserves the recorded value, resubmitting the same value is accepted, and changing it is + rejected. Known values are: \"Create\" and \"PointInTimeRestore\".""" + pointInTimeUtc: str + """The requested point in time, in UTC. This property is required in every PointInTimeRestore + request. For a same-location restore, the service restores the latest backup available at or + before this value. For a cross-location restore, the service requires but ignores this value + and restores the latest available backup; cross-location responses omit this property. This + property must be absent for other creation modes or when creationMode is omitted and can only + be specified during resource creation.""" + creationSourceClusterResourceId: str + """The Azure resource ID of the source HorizonDB cluster used by the selected creation mode. This + property is required for PointInTimeRestore and other source-based creation modes, and must be + absent when creationMode is Create or omitted. A source cluster does not need to have a pool to + be restored, provided an available backup exists. This immutable creation-provenance value does + not change after creation.""" + creationSourceClusterLocation: str + """The Azure location of the source HorizonDB cluster used for point-in-time restore. This + property is optional when the source and target cluster locations are the same. It is required + when the source cluster location differs from the target cluster location and must identify the + source cluster's location. This property must be absent for creation modes other than + PointInTimeRestore or when creationMode is omitted. This immutable creation-provenance value + does not change after creation.""" + network: "Network" + """The network configuration for the cluster. When this object is omitted, the service defaults it + to publicAccess Disabled.""" + backup: "BackupProperties" + """The backup configuration for the cluster.""" + dataEncryption: "HorizonDbClusterDataEncryption" + """The data encryption configuration for the cluster. When omitted during initial cluster + creation, the service uses SystemManaged encryption. When supplied during initial cluster + creation, type is required. For PUT updates of an existing cluster, type may be omitted; if + provided, it must match the existing encryption type. The encryption type is selected at + cluster creation; switching between SystemManaged and AzureKeyVault after creation is not + supported.""" + aiModelManagement: Union[str, "AiModelManagementStatus"] + """Specifies whether AI Model Management is enabled for the cluster. Known values are: \"Enabled\" + and \"Disabled\".""" + state: Required[Union[str, "ClusterState"]] + """Current state of the cluster. Required. Known values are: \"Ready\", \"Provisioning\", + \"Deleting\", \"Inaccessible\", and \"Updating\".""" + provisioningState: Required[Union[str, "ProvisioningState"]] + """The provisioning state of the cluster. Required. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + readWritePool: Required["ReadWritePoolProperties"] + """The pool currently designated to host the cluster's read-write node. Required.""" -class HorizonDbClusterParameterGroupConnectionProperties(TypedDict, total=False): # pylint: disable=name-too-long - """Connection information for HorizonDB parameter group. +class ClusterPropertiesForPatchUpdate(TypedDict, total=False): + """Properties of a HorizonDB cluster for update operations. - :ivar id: The resource ID of the connected parameter group. - :vartype id: str - :ivar syncStatus: Indication of if parameter group is applied on HorizonDB resource. - :vartype syncStatus: str - :ivar applyImmediately: Indicates whether the parameters should be applied immediately. - :vartype applyImmediately: bool + :ivar network: The network configuration to update for the cluster. + :vartype network: "NetworkForPatchUpdate" + :ivar backup: The backup configuration for the cluster. + :vartype backup: "BackupPropertiesForPatchUpdate" + :ivar dataEncryption: The data encryption configuration to update for the cluster. Omitted + properties preserve their current values. Updates can modify settings within the existing + encryption type, but switching between SystemManaged and AzureKeyVault after cluster creation + is not supported. + :vartype dataEncryption: "HorizonDbClusterDataEncryptionForPatchUpdate" + :ivar aiModelManagement: Specifies whether AI Model Management is enabled for the cluster. + Known values are: "Enabled" and "Disabled". + :vartype aiModelManagement: Union[str, "AiModelManagementStatus"] """ - id: str - """The resource ID of the connected parameter group.""" - syncStatus: str - """Indication of if parameter group is applied on HorizonDB resource.""" - applyImmediately: bool - """Indicates whether the parameters should be applied immediately.""" + network: "NetworkForPatchUpdate" + """The network configuration to update for the cluster.""" + backup: "BackupPropertiesForPatchUpdate" + """The backup configuration for the cluster.""" + dataEncryption: "HorizonDbClusterDataEncryptionForPatchUpdate" + """The data encryption configuration to update for the cluster. Omitted properties preserve their + current values. Updates can modify settings within the existing encryption type, but switching + between SystemManaged and AzureKeyVault after cluster creation is not supported.""" + aiModelManagement: Union[str, "AiModelManagementStatus"] + """Specifies whether AI Model Management is enabled for the cluster. Known values are: \"Enabled\" + and \"Disabled\".""" -class HorizonDbClusterProperties(TypedDict, total=False): - """Properties of a HorizonDB cluster. +class ErrorAdditionalInfo(TypedDict, total=False): + """The resource management error additional info. - :ivar administratorLogin: The administrator login name. Required. - :vartype administratorLogin: str - :ivar administratorLoginPassword: The administrator login password. - :vartype administratorLoginPassword: str - :ivar version: The version of the HorizonDB cluster. - :vartype version: str - :ivar createMode: The mode to create a new HorizonDB cluster. Known values are: "Create", - "Update", and "PointInTimeRestore". - :vartype createMode: Union[str, "CreateModeCluster"] - :ivar pointInTimeUTC: Restore point creation time specifying the time to restore from. - :vartype pointInTimeUTC: str - :ivar sourceClusterResourceId: The source cluster resource ID for restore or replica creation. - :vartype sourceClusterResourceId: str - :ivar poolName: The pool name for restore or replica operations. - :vartype poolName: str - :ivar replicaCount: Number of replicas. - :vartype replicaCount: int - :ivar vCores: Number of vCores. - :vartype vCores: int - :ivar processorType: The processor type for the HorizonDB cluster. - :vartype processorType: str - :ivar network: The network related info. - :vartype network: "Network" - :ivar state: Current state of the cluster. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". - :vartype state: Union[str, "State"] - :ivar fullyQualifiedDomainName: The fully qualified domain name of the cluster. - :vartype fullyQualifiedDomainName: str - :ivar readonlyEndpoint: The fully qualified domain name used for readonly endpoint for the - cluster. - :vartype readonlyEndpoint: str - :ivar provisioningState: The provisioning state of the cluster. Known values are: "Succeeded", - "Failed", "Canceled", "InProgress", and "Provisioning". - :vartype provisioningState: Union[str, "ProvisioningState"] - :ivar zonePlacementPolicy: Defines how replicas are placed across availability zones. Known - values are: "Strict" and "BestEffort". - :vartype zonePlacementPolicy: Union[str, "ZonePlacementPolicy"] - :ivar parameterGroup: Defines connection to a parameter group. - :vartype parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" - :ivar authConfig: Authentication configuration for the HorizonDB cluster. - :vartype authConfig: "HorizonDbClusterAuthConfig" - :ivar computeModel: The compute model for the cluster. - :vartype computeModel: "HorizonDbComputeModel" - :ivar mirroring: Mirroring configuration for the HorizonDB cluster. - :vartype mirroring: "HorizonDbClusterMirroring" - """ - - administratorLogin: Required[str] - """The administrator login name. Required.""" - administratorLoginPassword: str - """The administrator login password.""" - version: str - """The version of the HorizonDB cluster.""" - createMode: Union[str, "CreateModeCluster"] - """The mode to create a new HorizonDB cluster. Known values are: \"Create\", \"Update\", and - \"PointInTimeRestore\".""" - pointInTimeUTC: str - """Restore point creation time specifying the time to restore from.""" - sourceClusterResourceId: str - """The source cluster resource ID for restore or replica creation.""" - poolName: str - """The pool name for restore or replica operations.""" - replicaCount: int - """Number of replicas.""" - vCores: int - """Number of vCores.""" - processorType: str - """The processor type for the HorizonDB cluster.""" - network: "Network" - """The network related info.""" - state: Union[str, "State"] - """Current state of the cluster. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and - \"Upgrading\".""" - fullyQualifiedDomainName: str - """The fully qualified domain name of the cluster.""" - readonlyEndpoint: str - """The fully qualified domain name used for readonly endpoint for the cluster.""" - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the cluster. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" - zonePlacementPolicy: Union[str, "ZonePlacementPolicy"] - """Defines how replicas are placed across availability zones. Known values are: \"Strict\" and - \"BestEffort\".""" - parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" - """Defines connection to a parameter group.""" - authConfig: "HorizonDbClusterAuthConfig" - """Authentication configuration for the HorizonDB cluster.""" - computeModel: "HorizonDbComputeModel" - """The compute model for the cluster.""" - mirroring: "HorizonDbClusterMirroring" - """Mirroring configuration for the HorizonDB cluster.""" - - -class HorizonDbClusterPropertiesForPatchUpdate(TypedDict, total=False): - """Properties of a HorizonDB cluster for update operations. + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: Any + """ - :ivar administratorLoginPassword: The administrator login password. - :vartype administratorLoginPassword: str - :ivar vCores: Number of vCores. - :vartype vCores: int - :ivar parameterGroup: Defines connection to a parameter group. - :vartype parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" - :ivar authConfig: Authentication configuration for the HorizonDB cluster. - :vartype authConfig: "HorizonDbClusterAuthConfig" - :ivar computeModel: The compute model for the cluster. - :vartype computeModel: "HorizonDbComputeModel" - :ivar mirroring: Mirroring configuration for the HorizonDB cluster. - :vartype mirroring: "HorizonDbClusterMirroring" + type: str + """The additional info type.""" + info: Any + """The additional info.""" + + +class ErrorDetail(TypedDict, total=False): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list["ErrorDetail"] + :ivar additionalInfo: The error additional info. + :vartype additionalInfo: list["ErrorAdditionalInfo"] """ - administratorLoginPassword: str - """The administrator login password.""" - vCores: int - """Number of vCores.""" - parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" - """Defines connection to a parameter group.""" - authConfig: "HorizonDbClusterAuthConfig" - """Authentication configuration for the HorizonDB cluster.""" - computeModel: "HorizonDbComputeModel" - """The compute model for the cluster.""" - mirroring: "HorizonDbClusterMirroring" - """Mirroring configuration for the HorizonDB cluster.""" - - -class HorizonDbComputeModel(TypedDict, total=False): - """The compute model for a HorizonDB cluster. - - :ivar type: The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values - are: "Provisioned" and "Serverless". - :vartype type: Union[str, "HorizonDbComputeModelType"] - :ivar vCores: The fixed vCore count for Provisioned compute. - :vartype vCores: int - :ivar minvCores: The minimum vCores for Serverless compute. Defines the lower autoscaling - bound. - :vartype minvCores: float - :ivar maxvCores: The maximum vCores for Serverless compute. Defines the upper autoscaling - bound. - :vartype maxvCores: float + code: str + """The error code.""" + message: str + """The error message.""" + target: str + """The error target.""" + details: list["ErrorDetail"] + """The error details.""" + additionalInfo: list["ErrorAdditionalInfo"] + """The error additional info.""" + + +class FabricDestinationDetails(TypedDict, total=False): + """Settings for a Microsoft Fabric destination. + + :ivar destinationType: Specifies a Microsoft Fabric destination. Required. A Microsoft Fabric + destination. + :vartype destinationType: Literal[ChangeDataCaptureDestinationType.FABRIC] + :ivar protocol: Specifies the Microsoft Fabric native destination protocol. Required. The + destination's native protocol. + :vartype protocol: Literal[ChangeDataCaptureProtocol.NATIVE] + :ivar workspaceId: The opaque identifier of the Microsoft Fabric workspace that owns the + destination artifact. Required. + :vartype workspaceId: str """ - type: Union[str, "HorizonDbComputeModelType"] - """The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values are: - \"Provisioned\" and \"Serverless\".""" - vCores: int - """The fixed vCore count for Provisioned compute.""" - minvCores: float - """The minimum vCores for Serverless compute. Defines the lower autoscaling bound.""" - maxvCores: float - """The maximum vCores for Serverless compute. Defines the upper autoscaling bound.""" + destinationType: Required[Literal[ChangeDataCaptureDestinationType.FABRIC]] + """Specifies a Microsoft Fabric destination. Required. A Microsoft Fabric destination.""" + protocol: Required[Literal[ChangeDataCaptureProtocol.NATIVE]] + """Specifies the Microsoft Fabric native destination protocol. Required. The destination's native + protocol.""" + workspaceId: Required[str] + """The opaque identifier of the Microsoft Fabric workspace that owns the destination artifact. + Required.""" -class HorizonDbFirewallRule(ProxyResource): - """Represents the HorizonDB firewall rule. +class FirewallRule(ProxyResource): + """Represents a customer-managed firewall rule for a HorizonDB pool. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -414,21 +995,24 @@ class HorizonDbFirewallRule(ProxyResource): information. :vartype systemData: "SystemData" :ivar properties: The resource-specific properties for this resource. - :vartype properties: "HorizonDbFirewallRuleProperties" + :vartype properties: "FirewallRuleProperties" """ - properties: "HorizonDbFirewallRuleProperties" + properties: "FirewallRuleProperties" """The resource-specific properties for this resource.""" -class HorizonDbFirewallRuleProperties(TypedDict, total=False): +class FirewallRuleProperties(TypedDict, total=False): """Properties of a HorizonDB firewall rule. - :ivar startIpAddress: The start IP address of the firewall rule (IPv4). Required. + :ivar startIpAddress: The start IPv4 address of the firewall rule in dotted-decimal notation. + Required. :vartype startIpAddress: str - :ivar endIpAddress: The end IP address of the firewall rule (IPv4). Required. + :ivar endIpAddress: The end IPv4 address of the firewall rule in dotted-decimal notation. This + address must be numerically greater than or equal to startIpAddress. Required. :vartype endIpAddress: str - :ivar description: The description of the HorizonDB firewall rule. + :ivar description: The description of the HorizonDB firewall rule. The maximum length is 1024 + characters. :vartype description: str :ivar provisioningState: The provisioning state of the firewall rule. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". @@ -436,18 +1020,170 @@ class HorizonDbFirewallRuleProperties(TypedDict, total=False): """ startIpAddress: Required[str] - """The start IP address of the firewall rule (IPv4). Required.""" + """The start IPv4 address of the firewall rule in dotted-decimal notation. Required.""" endIpAddress: Required[str] - """The end IP address of the firewall rule (IPv4). Required.""" + """The end IPv4 address of the firewall rule in dotted-decimal notation. This address must be + numerically greater than or equal to startIpAddress. Required.""" description: str - """The description of the HorizonDB firewall rule.""" + """The description of the HorizonDB firewall rule. The maximum length is 1024 characters.""" provisioningState: Union[str, "ProvisioningState"] """The provisioning state of the firewall rule. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" -class HorizonDbParameterGroup(TrackedResource): - """Represents the HorizonDB parameter group. +class HorizonDbClusterDataEncryption(TypedDict, total=False): + """The Cluster-level data encryption configuration. The encryption type is selected at cluster + creation; switching between SystemManaged and AzureKeyVault after creation is not supported. + For AzureKeyVault encryption, primaryKeyUri and primaryUserAssignedIdentityId are required, and + backup.geoRedundancy must be Disabled. Both primaryKeyUri and primaryUserAssignedIdentityId can + be provided during initial cluster creation. For updates to an existing cluster through PUT or + PATCH, only one of these properties can change per request, and that update must complete + before submitting a separate update to change the other property. Customer-managed key + identities must also be assigned to the Cluster through its top-level identity property. Only + versionless Azure Key Vault key URIs are supported; key version paths are rejected. For + SystemManaged encryption, key and identity properties must be omitted. + + :ivar type: The type of data encryption used by the cluster. When the data encryption + configuration is supplied during initial cluster creation, this property is required. For PUT + updates of an existing cluster, this property may be omitted; if provided, it must match the + existing encryption type. This value is selected at cluster creation and cannot later be + changed from SystemManaged to AzureKeyVault or from AzureKeyVault to SystemManaged. Known + values are: "SystemManaged" and "AzureKeyVault". + :vartype type: Union[str, "HorizonDbClusterDataEncryptionType"] + :ivar primaryKeyUri: The versionless Azure Key Vault key URI used to encrypt the cluster's + primary storage. Key version paths are not supported. During initial cluster creation, this + property can be provided together with primaryUserAssignedIdentityId. For updates to an + existing cluster through PUT or PATCH, this property and primaryUserAssignedIdentityId cannot + both change in the same request; the first update must complete before submitting a separate + update for the other property. + :vartype primaryKeyUri: str + :ivar primaryUserAssignedIdentityId: The Azure resource ID of the user-assigned managed + identity used to access the primary encryption key. The identity must also be assigned to the + Cluster through its top-level identity property. During initial cluster creation, this property + can be provided together with primaryKeyUri. For updates to an existing cluster through PUT or + PATCH, this property and primaryKeyUri cannot both change in the same request; the first update + must complete before submitting a separate update for the other property. + :vartype primaryUserAssignedIdentityId: str + :ivar primaryEncryptionKeyStatus: The validation status of the primary encryption key. This + property is returned for AzureKeyVault encryption and is absent for SystemManaged encryption. + Known values are: "Valid" and "Invalid". + :vartype primaryEncryptionKeyStatus: Union[str, "HorizonDbClusterEncryptionKeyStatus"] + :ivar primaryEncryptionKeyCurrentVersion: The current version of the primary encryption key + used by the cluster. This property is returned for AzureKeyVault encryption and is absent for + SystemManaged encryption. + :vartype primaryEncryptionKeyCurrentVersion: str + """ + + type: Union[str, "HorizonDbClusterDataEncryptionType"] + """The type of data encryption used by the cluster. When the data encryption configuration is + supplied during initial cluster creation, this property is required. For PUT updates of an + existing cluster, this property may be omitted; if provided, it must match the existing + encryption type. This value is selected at cluster creation and cannot later be changed from + SystemManaged to AzureKeyVault or from AzureKeyVault to SystemManaged. Known values are: + \"SystemManaged\" and \"AzureKeyVault\".""" + primaryKeyUri: str + """The versionless Azure Key Vault key URI used to encrypt the cluster's primary storage. Key + version paths are not supported. During initial cluster creation, this property can be provided + together with primaryUserAssignedIdentityId. For updates to an existing cluster through PUT or + PATCH, this property and primaryUserAssignedIdentityId cannot both change in the same request; + the first update must complete before submitting a separate update for the other property.""" + primaryUserAssignedIdentityId: str + """The Azure resource ID of the user-assigned managed identity used to access the primary + encryption key. The identity must also be assigned to the Cluster through its top-level + identity property. During initial cluster creation, this property can be provided together with + primaryKeyUri. For updates to an existing cluster through PUT or PATCH, this property and + primaryKeyUri cannot both change in the same request; the first update must complete before + submitting a separate update for the other property.""" + primaryEncryptionKeyStatus: Union[str, "HorizonDbClusterEncryptionKeyStatus"] + """The validation status of the primary encryption key. This property is returned for + AzureKeyVault encryption and is absent for SystemManaged encryption. Known values are: + \"Valid\" and \"Invalid\".""" + primaryEncryptionKeyCurrentVersion: str + """The current version of the primary encryption key used by the cluster. This property is + returned for AzureKeyVault encryption and is absent for SystemManaged encryption.""" + + +class HorizonDbClusterDataEncryptionForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for sparsely updating Cluster-level data encryption. Omitted properties preserve + their current values. Updates can modify settings within the existing encryption type, such as + the primary Azure Key Vault key URI, but switching between SystemManaged and AzureKeyVault + after cluster creation is not supported. AzureKeyVault encryption is not supported when + backup.geoRedundancy is Enabled. An update can change only one of primaryKeyUri or + primaryUserAssignedIdentityId; that update must complete before submitting a separate update to + change the other property. + + :ivar type: The existing data encryption type used by the cluster. PATCH is a sparse update, so + this property may be omitted. If provided, it must match the existing encryption type. This + value cannot be changed from SystemManaged to AzureKeyVault or from AzureKeyVault to + SystemManaged after cluster creation. Known values are: "SystemManaged" and "AzureKeyVault". + :vartype type: Union[str, "HorizonDbClusterDataEncryptionType"] + :ivar primaryKeyUri: The versionless Azure Key Vault key URI used to encrypt the cluster's + primary storage. Key version paths are not supported. This property and + primaryUserAssignedIdentityId cannot both change in the same update; the first update must + complete before submitting a separate update for the other property. + :vartype primaryKeyUri: str + :ivar primaryUserAssignedIdentityId: The Azure resource ID of the user-assigned managed + identity used to access the primary encryption key. The identity must also be assigned to the + Cluster through its top-level identity property. This property and primaryKeyUri cannot both + change in the same update; the first update must complete before submitting a separate update + for the other property. + :vartype primaryUserAssignedIdentityId: str + """ + + type: Union[str, "HorizonDbClusterDataEncryptionType"] + """The existing data encryption type used by the cluster. PATCH is a sparse update, so this + property may be omitted. If provided, it must match the existing encryption type. This value + cannot be changed from SystemManaged to AzureKeyVault or from AzureKeyVault to SystemManaged + after cluster creation. Known values are: \"SystemManaged\" and \"AzureKeyVault\".""" + primaryKeyUri: str + """The versionless Azure Key Vault key URI used to encrypt the cluster's primary storage. Key + version paths are not supported. This property and primaryUserAssignedIdentityId cannot both + change in the same update; the first update must complete before submitting a separate update + for the other property.""" + primaryUserAssignedIdentityId: str + """The Azure resource ID of the user-assigned managed identity used to access the primary + encryption key. The identity must also be assigned to the Cluster through its top-level + identity property. This property and primaryKeyUri cannot both change in the same update; the + first update must complete before submitting a separate update for the other property.""" + + +class HorizonDbClusterManagedServiceIdentity(TypedDict, total=False): + """The user-assigned managed identities assigned to a HorizonDB cluster. Omitting the entire + top-level identity property from PUT or PATCH preserves all current assignments. When + userAssignedIdentities is supplied, PUT replaces the complete set and PATCH merges the supplied + entries with the existing set; a null PATCH entry removes that individual identity. Setting + type to None clears all assignments. Removing an identity referenced by a change data capture + identity assignment is rejected until the referencing assignment is deleted. + + :ivar type: The managed identity type assigned to the cluster. Setting this property to None + clears all managed identity assignments. Required. Known values are: "None" and "UserAssigned". + :vartype type: Union[str, "HorizonDbClusterIdentityType"] + :ivar userAssignedIdentities: The user-assigned managed identities associated with the cluster. + When supplied on PUT, this dictionary replaces the complete set of assignments. When supplied + on PATCH, entries are merged with the existing set and a null value removes the corresponding + identity. Each dictionary key must be the full Azure resource ID of a + Microsoft.ManagedIdentity/userAssignedIdentities resource. Non-null request values can be empty + objects; response values contain the service-populated clientId and principalId. Assigning an + identity does not grant it access to destination resources; required role assignments must be + configured separately. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + type: Required[Union[str, "HorizonDbClusterIdentityType"]] + """The managed identity type assigned to the cluster. Setting this property to None clears all + managed identity assignments. Required. Known values are: \"None\" and \"UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The user-assigned managed identities associated with the cluster. When supplied on PUT, this + dictionary replaces the complete set of assignments. When supplied on PATCH, entries are merged + with the existing set and a null value removes the corresponding identity. Each dictionary key + must be the full Azure resource ID of a Microsoft.ManagedIdentity/userAssignedIdentities + resource. Non-null request values can be empty objects; response values contain the + service-populated clientId and principalId. Assigning an identity does not grant it access to + destination resources; required role assignments must be configured separately.""" + + +class IdentityAssignment(ProxyResource): + """A user-assigned managed identity authorized for a HorizonDB change data capture destination. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -460,87 +1196,133 @@ class HorizonDbParameterGroup(TrackedResource): :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: "HorizonDbParameterGroupProperties" + :vartype properties: "ChangeDataCaptureIdentityAssignmentProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str """ - properties: "HorizonDbParameterGroupProperties" + properties: "ChangeDataCaptureIdentityAssignmentProperties" """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class IdentityValidationStatus(TypedDict, total=False): + """The current validation result for a change data capture identity assignment. + + :ivar state: The current validation state. Required. Known values are: "NotStarted", "Running", + "Succeeded", and "Failed". + :vartype state: Union[str, "ChangeDataCaptureIdentityValidationState"] + :ivar validatedAtUtc: The date and time, in UTC, when validation most recently completed. + :vartype validatedAtUtc: str + :ivar error: The customer-safe validation error when validation failed. + :vartype error: "ErrorDetail" + """ + state: Required[Union[str, "ChangeDataCaptureIdentityValidationState"]] + """The current validation state. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", and \"Failed\".""" + validatedAtUtc: str + """The date and time, in UTC, when validation most recently completed.""" + error: "ErrorDetail" + """The customer-safe validation error when validation failed.""" -class HorizonDbParameterGroupForPatchUpdate(TypedDict, total=False): - """HorizonDB parameter group for update operations. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The properties that can be updated for a HorizonDB parameter group. - :vartype properties: "HorizonDbParameterGroupPropertiesForPatchUpdate" +class LogCaptureConfigurationForPatchUpdate(TypedDict, total=False): + """A sparse update request for a log capture configuration. + + :ivar properties: The log capture properties to update. + :vartype properties: "LogCaptureConfigurationPropertiesForPatchUpdate" """ - tags: dict[str, str] - """Resource tags.""" - properties: "HorizonDbParameterGroupPropertiesForPatchUpdate" - """The properties that can be updated for a HorizonDB parameter group.""" + properties: "LogCaptureConfigurationPropertiesForPatchUpdate" + """The log capture properties to update.""" -class HorizonDbParameterGroupProperties(TypedDict, total=False): - """Properties of a HorizonDB parameter group. +class LogCaptureConfigurationPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for updating the log capture configuration. Omitted properties preserve their + current values. - :ivar parameters: Parameters in the parameter group. - :vartype parameters: list["ParameterProperties"] - :ivar description: Description of the parameter group. - :vartype description: str - :ivar pgVersion: PostgreSQL version for the parameter group. - :vartype pgVersion: int - :ivar version: Current version of the parameter group. - :vartype version: int - :ivar applyImmediately: Indicates whether the parameters should be applied immediately. - :vartype applyImmediately: bool - :ivar provisioningState: The provisioning state of the parameter group. Known values are: - "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". - :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar state: Specifies whether HorizonDB captures this type of log. Disabling capture stops the + production of new log files; existing files remain available until their retention period + expires. Known values are: "Enabled" and "Disabled". + :vartype state: Union[str, "LogCaptureState"] + :ivar retentionDays: The number of days captured log files are retained. + :vartype retentionDays: int """ - parameters: list["ParameterProperties"] - """Parameters in the parameter group.""" - description: str - """Description of the parameter group.""" - pgVersion: int - """PostgreSQL version for the parameter group.""" - version: int - """Current version of the parameter group.""" - applyImmediately: bool - """Indicates whether the parameters should be applied immediately.""" - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the parameter group. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" + state: Union[str, "LogCaptureState"] + """Specifies whether HorizonDB captures this type of log. Disabling capture stops the production + of new log files; existing files remain available until their retention period expires. Known + values are: \"Enabled\" and \"Disabled\".""" + retentionDays: int + """The number of days captured log files are retained.""" -class HorizonDbParameterGroupPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long - """Properties of a HorizonDB parameter group for update operations. +class MaintenanceEventRescheduleRequest(TypedDict, total=False): + """Parameters for rescheduling a maintenance event. - :ivar parameters: Parameters in the parameter group. - :vartype parameters: list["ParameterProperties"] - :ivar description: Description of the parameter group. - :vartype description: str - :ivar applyImmediately: Indicates whether the parameters should be applied immediately. - :vartype applyImmediately: bool + :ivar postponeToDateTimeUtc: The new start time in RFC 3339 format. Required. + :vartype postponeToDateTimeUtc: str """ - parameters: list["ParameterProperties"] - """Parameters in the parameter group.""" - description: str - """Description of the parameter group.""" - applyImmediately: bool - """Indicates whether the parameters should be applied immediately.""" + postponeToDateTimeUtc: Required[str] + """The new start time in RFC 3339 format. Required.""" + + +class MicrosoftEntraAdministratorAdd(TypedDict, total=False): + """The request body for creating or updating a PostgreSQL role that is a member of azure_pg_admin + and mapped to a Microsoft Entra principal. + + :ivar properties: The PostgreSQL role and Microsoft Entra principal mapping properties. + Required. + :vartype properties: "MicrosoftEntraAdministratorPropertiesForAdd" + """ + + properties: Required["MicrosoftEntraAdministratorPropertiesForAdd"] + """The PostgreSQL role and Microsoft Entra principal mapping properties. Required.""" -class HorizonDbReplica(ProxyResource): - """Represents the HorizonDB replica. +class MicrosoftEntraAdministratorPropertiesForAdd(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for creating or updating a PostgreSQL role that is a member of azure_pg_admin and + mapped to a Microsoft Entra principal. + + :ivar principalName: The display name or user principal name of the Microsoft Entra principal + to map to the PostgreSQL role. For users, this is typically the user principal name, such as + `admin@contoso.com `_. For groups, this is the group display name. + For service principals, this is the application display name. Required. + :vartype principalName: str + :ivar principalType: The type of Microsoft Entra principal to map to the PostgreSQL role. + Required. Known values are: "Unknown", "User", "Group", and "ServicePrincipal". + :vartype principalType: Union[str, "PrincipalTypes"] + :ivar tenantId: The identifier of the Microsoft Entra tenant containing the principal to map, + represented as an RFC 4122 GUID. If omitted, this value defaults to the tenant of the + subscription. + :vartype tenantId: str + """ + + principalName: Required[str] + """The display name or user principal name of the Microsoft Entra principal to map to the + PostgreSQL role. For users, this is typically the user principal name, such as + `admin@contoso.com `_. For groups, this is the group display name. + For service principals, this is the application display name. Required.""" + principalType: Required[Union[str, "PrincipalTypes"]] + """The type of Microsoft Entra principal to map to the PostgreSQL role. Required. Known values + are: \"Unknown\", \"User\", \"Group\", and \"ServicePrincipal\".""" + tenantId: str + """The identifier of the Microsoft Entra tenant containing the principal to map, represented as an + RFC 4122 GUID. If omitted, this value defaults to the tenant of the subscription.""" + + +class MicrosoftEntraAuthentication(ProxyResource): + """The service-created Microsoft Entra authentication method for a HorizonDB cluster. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -554,111 +1336,177 @@ class HorizonDbReplica(ProxyResource): information. :vartype systemData: "SystemData" :ivar properties: The resource-specific properties for this resource. - :vartype properties: "HorizonDbReplicaProperties" + :vartype properties: "MicrosoftEntraAuthenticationProperties" """ - properties: "HorizonDbReplicaProperties" + properties: "MicrosoftEntraAuthenticationProperties" """The resource-specific properties for this resource.""" -class HorizonDbReplicaForPatchUpdate(TypedDict, total=False): - """HorizonDB replica for update operations. +class MicrosoftEntraAuthenticationForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """A sparse update request for Microsoft Entra authentication. - :ivar properties: Properties of a HorizonDB replica for update operations. - :vartype properties: "HorizonDbReplicaPropertiesForPatchUpdate" + :ivar properties: The Microsoft Entra authentication properties to update. + :vartype properties: "MicrosoftEntraAuthenticationPropertiesForPatchUpdate" """ - properties: "HorizonDbReplicaPropertiesForPatchUpdate" - """Properties of a HorizonDB replica for update operations.""" + properties: "MicrosoftEntraAuthenticationPropertiesForPatchUpdate" + """The Microsoft Entra authentication properties to update.""" -class HorizonDbReplicaProperties(TypedDict, total=False): - """Properties of a HorizonDB replica. +class MicrosoftEntraAuthenticationProperties(TypedDict, total=False): + """Properties of the service-created Microsoft Entra authentication method. - :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". - :vartype role: Union[str, "ReplicaRole"] - :ivar status: Current status of the replica. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". - :vartype status: Union[str, "State"] - :ivar fullyQualifiedDomainName: The fully qualified domain name of the replica. - :vartype fullyQualifiedDomainName: str - :ivar availabilityZone: The availability zone of the replica. - :vartype availabilityZone: str - :ivar provisioningState: The provisioning state of the replica. Known values are: "Succeeded", - "Failed", "Canceled", "InProgress", and "Provisioning". + :ivar state: The state of Microsoft Entra authentication. Required. Known values are: "Enabled" + and "Disabled". + :vartype state: Union[str, "AuthenticationState"] + :ivar provisioningState: The provisioning state of the Microsoft Entra authentication method. + Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". :vartype provisioningState: Union[str, "ProvisioningState"] """ - role: Union[str, "ReplicaRole"] - """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" - status: Union[str, "State"] - """Current status of the replica. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and - \"Upgrading\".""" - fullyQualifiedDomainName: str - """The fully qualified domain name of the replica.""" - availabilityZone: str - """The availability zone of the replica.""" + state: Required[Union[str, "AuthenticationState"]] + """The state of Microsoft Entra authentication. Required. Known values are: \"Enabled\" and + \"Disabled\".""" provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the replica. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"InProgress\", and \"Provisioning\".""" + """The provisioning state of the Microsoft Entra authentication method. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" -class HorizonDbReplicaPropertiesForPatchUpdate(TypedDict, total=False): - """Properties of a HorizonDB replica for update operations. +class MicrosoftEntraAuthenticationPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for updating Microsoft Entra authentication. State Enabled enables the feature and + State Disabled disables it. Disabling Microsoft Entra authentication does not remove or modify + database roles or users previously created through the MicrosoftEntraAdministrators + control-plane API or directly through pgaadauth extension functions. - :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". - :vartype role: Union[str, "ReplicaRole"] + :ivar state: The target Microsoft Entra authentication state. Omission preserves the current + state. Known values are: "Enabled" and "Disabled". + :vartype state: Union[str, "AuthenticationState"] """ - role: Union[str, "ReplicaRole"] - """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" + state: Union[str, "AuthenticationState"] + """The target Microsoft Entra authentication state. Omission preserves the current state. Known + values are: \"Enabled\" and \"Disabled\".""" -class ManagedServiceIdentity(TypedDict, total=False): - """Managed service identity (system assigned and/or user assigned identities). +class Network(TypedDict, total=False): + """Network properties. - :ivar principalId: The service principal ID of the system assigned identity. This property will - only be provided for a system assigned identity. - :vartype principalId: str - :ivar tenantId: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenantId: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: Union[str, "ManagedServiceIdentityType"] - :ivar userAssignedIdentities: The identities assigned to this resource by the user. - :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + :ivar publicAccess: Specifies whether public access is enabled for the cluster. The service + defaults to Disabled when this property is omitted. Known values are: "Enabled" and "Disabled". + :vartype publicAccess: Union[str, "PublicNetworkAccessState"] """ - principalId: str - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenantId: str - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Required[Union[str, "ManagedServiceIdentityType"]] - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - userAssignedIdentities: dict[str, "UserAssignedIdentity"] - """The identities assigned to this resource by the user.""" + publicAccess: Union[str, "PublicNetworkAccessState"] + """Specifies whether public access is enabled for the cluster. The service defaults to Disabled + when this property is omitted. Known values are: \"Enabled\" and \"Disabled\".""" -class Network(TypedDict, total=False): - """Network properties. +class NetworkForPatchUpdate(TypedDict, total=False): + """Network properties for updating a HorizonDB cluster. - :ivar publicNetworkAccess: The flag indicating whether public ip is requested. Known values - are: "Enabled" and "Disabled". - :vartype publicNetworkAccess: Union[str, "PublicNetworkAccessState"] + :ivar publicAccess: Specifies whether public access is enabled for the cluster. Omission + preserves the current value. Known values are: "Enabled" and "Disabled". + :vartype publicAccess: Union[str, "PublicNetworkAccessState"] """ - publicNetworkAccess: Union[str, "PublicNetworkAccessState"] - """The flag indicating whether public ip is requested. Known values are: \"Enabled\" and - \"Disabled\".""" + publicAccess: Union[str, "PublicNetworkAccessState"] + """Specifies whether public access is enabled for the cluster. Omission preserves the current + value. Known values are: \"Enabled\" and \"Disabled\".""" + + +class ParameterGroup(TrackedResource): + """Represents the HorizonDB parameter group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "ParameterGroupProperties" + """ + + properties: "ParameterGroupProperties" + """The resource-specific properties for this resource.""" + + +class ParameterGroupForPatchUpdate(TypedDict, total=False): + """HorizonDB parameter group for update operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The properties that can be updated for a HorizonDB parameter group. + :vartype properties: "ParameterGroupPropertiesForPatchUpdate" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "ParameterGroupPropertiesForPatchUpdate" + """The properties that can be updated for a HorizonDB parameter group.""" + + +class ParameterGroupProperties(TypedDict, total=False): + """Properties of a HorizonDB parameter group. + + :ivar parameters: Parameters in the parameter group. + :vartype parameters: list["ParameterProperties"] + :ivar description: Description of the parameter group. The maximum length is 1024 characters. + :vartype description: str + :ivar postgreSqlVersion: The PostgreSQL major version for the parameter group. This property is + required during creation and is immutable thereafter. The service selects the unique + location-scoped default parameter group for this version in the resource location. The + DefaultParameterGroups APIs return at most one default parameter group for each PostgreSQL + version in a location, so this selection is unambiguous. Required. Known values are: "17" and + "18". + :vartype postgreSqlVersion: Union[str, "PostgreSqlVersion"] + :ivar provisioningState: The provisioning state of the parameter group. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + parameters: list["ParameterProperties"] + """Parameters in the parameter group.""" + description: str + """Description of the parameter group. The maximum length is 1024 characters.""" + postgreSqlVersion: Required[Union[str, "PostgreSqlVersion"]] + """The PostgreSQL major version for the parameter group. This property is required during creation + and is immutable thereafter. The service selects the unique location-scoped default parameter + group for this version in the resource location. The DefaultParameterGroups APIs return at most + one default parameter group for each PostgreSQL version in a location, so this selection is + unambiguous. Required. Known values are: \"17\" and \"18\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the parameter group. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + +class ParameterGroupPropertiesForPatchUpdate(TypedDict, total=False): + """Properties of a HorizonDB parameter group for update operations. + + :ivar parameters: Parameters in the parameter group. + :vartype parameters: list["ParameterProperties"] + :ivar description: Description of the parameter group. The maximum length is 1024 characters. + :vartype description: str + """ + + parameters: list["ParameterProperties"] + """Parameters in the parameter group.""" + description: str + """Description of the parameter group. The maximum length is 1024 characters.""" class ParameterProperties(TypedDict, total=False): - """Properties of a HorizonDB parameters. + """Properties of a HorizonDB parameter. :ivar name: The name of the parameter. :vartype name: str @@ -666,13 +1514,21 @@ class ParameterProperties(TypedDict, total=False): :vartype description: str :ivar value: The value of the configuration. :vartype value: str + :ivar defaultValue: The system-defined default value of the parameter, independent of the + effective value. + :vartype defaultValue: str + :ivar valueSource: The source of the effective parameter value. UserOverride means that the + value was explicitly supplied by the user, even when it equals defaultValue. Known values are: + "SystemDefault" and "UserOverride". + :vartype valueSource: Union[str, "ParameterValueSource"] :ivar dataType: The data type of the parameter. :vartype dataType: str :ivar allowedValues: The allowed values for the parameter. :vartype allowedValues: str :ivar isDynamic: Whether the parameter can be changed dynamically. :vartype isDynamic: bool - :ivar isReadOnly: Whether the parameter is a read-only parameter. + :ivar isReadOnly: Whether the parameter is read-only. Read-only parameters cannot be + overridden. :vartype isReadOnly: bool :ivar documentationLink: Link to parameter documentation. :vartype documentationLink: str @@ -686,6 +1542,12 @@ class ParameterProperties(TypedDict, total=False): """The description of the parameter.""" value: str """The value of the configuration.""" + defaultValue: str + """The system-defined default value of the parameter, independent of the effective value.""" + valueSource: Union[str, "ParameterValueSource"] + """The source of the effective parameter value. UserOverride means that the value was explicitly + supplied by the user, even when it equals defaultValue. Known values are: \"SystemDefault\" and + \"UserOverride\".""" dataType: str """The data type of the parameter.""" allowedValues: str @@ -693,13 +1555,420 @@ class ParameterProperties(TypedDict, total=False): isDynamic: bool """Whether the parameter can be changed dynamically.""" isReadOnly: bool - """Whether the parameter is a read-only parameter.""" + """Whether the parameter is read-only. Read-only parameters cannot be overridden.""" documentationLink: str """Link to parameter documentation.""" unit: str """The unit of measurement for the parameter.""" +class PasswordAuthentication(ProxyResource): + """The service-created PostgreSQL username-and-password authentication method for a HorizonDB + cluster. This resource configures the authentication mechanism, including its enabled state and + administrator login credentials; it is not a password-only resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "PasswordAuthenticationProperties" + """ + + properties: "PasswordAuthenticationProperties" + """The resource-specific properties for this resource.""" + + +class PasswordAuthenticationForPatchUpdate(TypedDict, total=False): + """A sparse update request for PostgreSQL username-and-password authentication. + + :ivar properties: The PostgreSQL username-and-password authentication properties to update. + :vartype properties: "PasswordAuthenticationPropertiesForPatchUpdate" + """ + + properties: "PasswordAuthenticationPropertiesForPatchUpdate" + """The PostgreSQL username-and-password authentication properties to update.""" + + +class PasswordAuthenticationProperties(TypedDict, total=False): + """Properties of the service-created PostgreSQL username-and-password authentication method. + + :ivar state: The state of PostgreSQL username-and-password authentication. Required. Known + values are: "Enabled" and "Disabled". + :vartype state: Union[str, "AuthenticationState"] + :ivar administratorLogin: The PostgreSQL administrator login name. This value is not returned + in responses. After it is set, renaming is not supported. Setting the login requires password + authentication state to be Enabled in the same request. + :vartype administratorLogin: str + :ivar administratorLoginPassword: The PostgreSQL administrator password. Setting the password + requires password authentication state to be Enabled in the same request. + :vartype administratorLoginPassword: str + :ivar provisioningState: The provisioning state of the PostgreSQL username-and-password + authentication method. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and + "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + state: Required[Union[str, "AuthenticationState"]] + """The state of PostgreSQL username-and-password authentication. Required. Known values are: + \"Enabled\" and \"Disabled\".""" + administratorLogin: str + """The PostgreSQL administrator login name. This value is not returned in responses. After it is + set, renaming is not supported. Setting the login requires password authentication state to be + Enabled in the same request.""" + administratorLoginPassword: str + """The PostgreSQL administrator password. Setting the password requires password authentication + state to be Enabled in the same request.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the PostgreSQL username-and-password authentication method. Known + values are: \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + +class PasswordAuthenticationPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for updating PostgreSQL username-and-password authentication. Omitted properties + preserve their current values. This API version supports enabling or disabling the + authentication method, and resetting its password. Supported changes can be combined. + + :ivar state: The target password-authentication state. Enabled can be combined with + administratorLoginPassword to re-enable password authentication and reset the password for a + cluster that already has an administrator. Disabling password authentication does not remove or + modify existing database users or roles. Disabled cannot be combined with + administratorLoginPassword. Known values are: "Enabled" and "Disabled". + :vartype state: Union[str, "AuthenticationState"] + :ivar administratorLoginPassword: The PostgreSQL administrator password. Supplying this + property resets the configured administrator's password. When password authentication is + currently disabled for a cluster that already has an administrator, this property can be + combined with state Enabled to re-enable password authentication and reset the password. + :vartype administratorLoginPassword: str + """ + + state: Union[str, "AuthenticationState"] + """The target password-authentication state. Enabled can be combined with + administratorLoginPassword to re-enable password authentication and reset the password for a + cluster that already has an administrator. Disabling password authentication does not remove or + modify existing database users or roles. Disabled cannot be combined with + administratorLoginPassword. Known values are: \"Enabled\" and \"Disabled\".""" + administratorLoginPassword: str + """The PostgreSQL administrator password. Supplying this property resets the configured + administrator's password. When password authentication is currently disabled for a cluster that + already has an administrator, this property can be combined with state Enabled to re-enable + password authentication and reset the password.""" + + +class Pool(ProxyResource): + """Represents the HorizonDB pool. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "PoolProperties" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: "PoolProperties" + """The resource-specific properties for this resource.""" + tags: dict[str, str] + """Resource tags.""" + + +class PoolComputeModel(TypedDict, total=False): + """The compute model for a HorizonDB pool. + + :ivar type: The type of compute model. Required. "Provisioned" + :vartype type: Union[str, "PoolComputeModelType"] + :ivar computeProcessor: The processor type for the compute model. Required. Known values are: + "Intel" and "AMD". + :vartype computeProcessor: Union[str, "ComputeProcessorType"] + :ivar computeGeneration: The compute generation for the compute model. Required. + :vartype computeGeneration: int + :ivar vCores: The number of vCores. Allowed values are 1 through 192. Required. + :vartype vCores: int + """ + + type: Required[Union[str, "PoolComputeModelType"]] + """The type of compute model. Required. \"Provisioned\"""" + computeProcessor: Required[Union[str, "ComputeProcessorType"]] + """The processor type for the compute model. Required. Known values are: \"Intel\" and \"AMD\".""" + computeGeneration: Required[int] + """The compute generation for the compute model. Required.""" + vCores: Required[int] + """The number of vCores. Allowed values are 1 through 192. Required.""" + + +class PoolComputeModelForPatchUpdate(TypedDict, total=False): + """The compute model properties of a HorizonDB pool that can be updated. The object is recursively + mergeable: omitted properties preserve their current values. Properties that do not apply to + the current or target compute model type are rejected. When type changes, the request must + include the complete target compute model. Subtype-specific constraints are validated against + the effective merged configuration; invalid requests are rejected without changing the + resource. + + :ivar type: The compute model type. Omit this property to retain the current type. Resubmitting + the current type succeeds as an idempotent no-op. To change the type, supply all common + properties and all properties required by the target type. "Provisioned" + :vartype type: Union[str, "PoolComputeModelType"] + :ivar computeProcessor: The processor type for the compute model. Omission preserves the + current processor type. Known values are: "Intel" and "AMD". + :vartype computeProcessor: Union[str, "ComputeProcessorType"] + :ivar computeGeneration: The compute generation for the compute model. Omission preserves the + current compute generation. + :vartype computeGeneration: int + :ivar vCores: The number of provisioned vCores. Allowed values are 1 through 192. This property + applies only to a Provisioned compute model. Omission preserves the current value. + :vartype vCores: int + """ + + type: Union[str, "PoolComputeModelType"] + """The compute model type. Omit this property to retain the current type. Resubmitting the current + type succeeds as an idempotent no-op. To change the type, supply all common properties and all + properties required by the target type. \"Provisioned\"""" + computeProcessor: Union[str, "ComputeProcessorType"] + """The processor type for the compute model. Omission preserves the current processor type. Known + values are: \"Intel\" and \"AMD\".""" + computeGeneration: int + """The compute generation for the compute model. Omission preserves the current compute + generation.""" + vCores: int + """The number of provisioned vCores. Allowed values are 1 through 192. This property applies only + to a Provisioned compute model. Omission preserves the current value.""" + + +class PoolForPatchUpdate(TypedDict, total=False): + """HorizonDB pool for update operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The properties that can be updated for a HorizonDB pool. + :vartype properties: "PoolPropertiesForPatchUpdate" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "PoolPropertiesForPatchUpdate" + """The properties that can be updated for a HorizonDB pool.""" + + +class PoolHighAvailability(TypedDict, total=False): + """The high-availability configuration for a HorizonDB pool. + + :ivar mode: The high-availability mode. Disabled is required when nodeCount is 1. AnyZone or + ZoneRedundant is required when nodeCount is 2 through 16. Required. Known values are: + "Disabled", "AnyZone", and "ZoneRedundant". + :vartype mode: Union[str, "PoolHighAvailabilityMode"] + """ + + mode: Required[Union[str, "PoolHighAvailabilityMode"]] + """The high-availability mode. Disabled is required when nodeCount is 1. AnyZone or ZoneRedundant + is required when nodeCount is 2 through 16. Required. Known values are: \"Disabled\", + \"AnyZone\", and \"ZoneRedundant\".""" + + +class PoolHighAvailabilityPatch(TypedDict, total=False): + """The high-availability configuration for a HorizonDB pool update. + + :ivar mode: The high-availability mode. Omission preserves the current mode before the service + validates it with the effective nodeCount. Known values are: "Disabled", "AnyZone", and + "ZoneRedundant". + :vartype mode: Union[str, "PoolHighAvailabilityMode"] + """ + + mode: Union[str, "PoolHighAvailabilityMode"] + """The high-availability mode. Omission preserves the current mode before the service validates it + with the effective nodeCount. Known values are: \"Disabled\", \"AnyZone\", and + \"ZoneRedundant\".""" + + +class PoolParameterGroupReference(TypedDict, total=False): + """A reference to the parameter group associated with a HorizonDB pool. The schema represents both + default and customer-created parameter groups for create and update compatibility. In this API + version, initial pool creation accepts only the corresponding default parameter group; PUT + updates to an existing pool can associate either group type. + + :ivar parameterGroupResourceId: The Azure resource ID of the associated parameter group. + Initial pool creation in this API version requires the corresponding + Microsoft.HorizonDb/locations/parameterGroups resource. For an existing pool, PUT can specify + either the corresponding default group or a customer-created + Microsoft.HorizonDb/parameterGroups resource. Required. + :vartype parameterGroupResourceId: str + :ivar applyMethod: Determines when dynamic parameter changes from the associated parameter + group become effective. Static parameter changes always require a customer-initiated pool + Restart, regardless of this value. Stop followed by Start and scheduled maintenance do not + apply pending parameter changes. Required. Known values are: "Immediate" and "PendingReboot". + :vartype applyMethod: Union[str, "ParameterApplyMethod"] + :ivar syncStatus: The synchronization status between the pool and its parameter group. + PendingReboot changes remain pending across Stop, Start, and scheduled maintenance and become + effective only after a customer-initiated Restart. Known values are: "Applying", "InSync", + "FailedToApply", and "PendingReboot". + :vartype syncStatus: Union[str, "ParameterGroupSyncStatus"] + """ + + parameterGroupResourceId: Required[str] + """The Azure resource ID of the associated parameter group. Initial pool creation in this API + version requires the corresponding Microsoft.HorizonDb/locations/parameterGroups resource. For + an existing pool, PUT can specify either the corresponding default group or a customer-created + Microsoft.HorizonDb/parameterGroups resource. Required.""" + applyMethod: Required[Union[str, "ParameterApplyMethod"]] + """Determines when dynamic parameter changes from the associated parameter group become effective. + Static parameter changes always require a customer-initiated pool Restart, regardless of this + value. Stop followed by Start and scheduled maintenance do not apply pending parameter changes. + Required. Known values are: \"Immediate\" and \"PendingReboot\".""" + syncStatus: Union[str, "ParameterGroupSyncStatus"] + """The synchronization status between the pool and its parameter group. PendingReboot changes + remain pending across Stop, Start, and scheduled maintenance and become effective only after a + customer-initiated Restart. Known values are: \"Applying\", \"InSync\", \"FailedToApply\", and + \"PendingReboot\".""" + + +class PoolParameterGroupReferenceForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """A parameter group reference for updating an existing HorizonDB pool. The pool can switch in + either direction between its corresponding default parameter group and a customer-created + parameter group. + + :ivar parameterGroupResourceId: The Azure resource ID of the corresponding default or + customer-created parameter group to associate with the existing pool. + :vartype parameterGroupResourceId: str + :ivar applyMethod: Determines when dynamic parameter changes from the associated parameter + group become effective. Static parameter changes always require a customer-initiated pool + Restart, regardless of this value. Stop followed by Start and scheduled maintenance do not + apply pending parameter changes. Known values are: "Immediate" and "PendingReboot". + :vartype applyMethod: Union[str, "ParameterApplyMethod"] + """ + + parameterGroupResourceId: str + """The Azure resource ID of the corresponding default or customer-created parameter group to + associate with the existing pool.""" + applyMethod: Union[str, "ParameterApplyMethod"] + """Determines when dynamic parameter changes from the associated parameter group become effective. + Static parameter changes always require a customer-initiated pool Restart, regardless of this + value. Stop followed by Start and scheduled maintenance do not apply pending parameter changes. + Known values are: \"Immediate\" and \"PendingReboot\".""" + + +class PoolProperties(TypedDict, total=False): + """Properties of a HorizonDB pool. + + :ivar state: Current state of the pool. Known values are: "Ready", "Provisioning", "Deleting", + "Inaccessible", "Updating", "Starting", "Restarting", "Stopping", and "Stopped". + :vartype state: Union[str, "PoolState"] + :ivar computeModel: The required compute model for the HorizonDB pool. Required. + :vartype computeModel: "PoolComputeModel" + :ivar nodeCount: The required number of nodes to allocate and assign to the pool. Allowed + values are 1 through 16. To deallocate runtime compute without changing the configured node + count, stop the pool. Required. + :vartype nodeCount: int + :ivar highAvailability: The required high-availability configuration for the pool. mode must be + Disabled when nodeCount is 1, and must be AnyZone or ZoneRedundant when nodeCount is 2 through + 16. Required. + :vartype highAvailability: "PoolHighAvailability" + :ivar parameterGroup: The required parameter group associated with the pool. When creating a + new pool in this API version, the caller must supply the corresponding default parameter group; + customer-created parameter groups are not accepted during creation. For an existing pool, PUT + or PATCH can associate either the corresponding default parameter group or a customer-created + parameter group. The create-visible shape intentionally supports both resource ID forms so a + future API version can allow customer-created parameter groups during creation without a + breaking schema change. Required. + :vartype parameterGroup: "PoolParameterGroupReference" + :ivar scheduledMaintenance: The scheduled maintenance configuration for the pool. The + properties available depend on the selected maintenance management type. + :vartype scheduledMaintenance: "ScheduledMaintenanceProperties" + :ivar provisioningState: The provisioning state of the pool. Known values are: "Succeeded", + "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + state: Union[str, "PoolState"] + """Current state of the pool. Known values are: \"Ready\", \"Provisioning\", \"Deleting\", + \"Inaccessible\", \"Updating\", \"Starting\", \"Restarting\", \"Stopping\", and \"Stopped\".""" + computeModel: Required["PoolComputeModel"] + """The required compute model for the HorizonDB pool. Required.""" + nodeCount: Required[int] + """The required number of nodes to allocate and assign to the pool. Allowed values are 1 through + 16. To deallocate runtime compute without changing the configured node count, stop the pool. + Required.""" + highAvailability: Required["PoolHighAvailability"] + """The required high-availability configuration for the pool. mode must be Disabled when nodeCount + is 1, and must be AnyZone or ZoneRedundant when nodeCount is 2 through 16. Required.""" + parameterGroup: Required["PoolParameterGroupReference"] + """The required parameter group associated with the pool. When creating a new pool in this API + version, the caller must supply the corresponding default parameter group; customer-created + parameter groups are not accepted during creation. For an existing pool, PUT or PATCH can + associate either the corresponding default parameter group or a customer-created parameter + group. The create-visible shape intentionally supports both resource ID forms so a future API + version can allow customer-created parameter groups during creation without a breaking schema + change. Required.""" + scheduledMaintenance: "ScheduledMaintenanceProperties" + """The scheduled maintenance configuration for the pool. The properties available depend on the + selected maintenance management type.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the pool. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"InProgress\", and \"Provisioning\".""" + + +class PoolPropertiesForPatchUpdate(TypedDict, total=False): + """Properties of a HorizonDB pool for update operations. + + :ivar computeModel: The compute model properties to update. Omitted properties preserve their + current values. To change the compute model type, supply the complete target compute model, + including type, computeProcessor, computeGeneration, and all properties required by the target + type. + :vartype computeModel: "PoolComputeModelForPatchUpdate" + :ivar nodeCount: The number of nodes to allocate and assign to the pool. Allowed values are 1 + through 16. Omission preserves the current configured value. To deallocate runtime compute + without changing the configured node count, stop the pool. + :vartype nodeCount: int + :ivar highAvailability: The high-availability configuration to update. Omission preserves the + current mode. The service recursively merges omitted PATCH properties with the existing + resource before validating the effective nodeCount and mode together. + :vartype highAvailability: "PoolHighAvailabilityPatch" + :ivar parameterGroup: The corresponding default or a customer-created parameter group to + associate with the existing pool. Customers can switch in either direction between these group + types. Omission preserves the current association. + :vartype parameterGroup: "PoolParameterGroupReferenceForPatchUpdate" + :ivar scheduledMaintenance: The scheduled maintenance configuration to update for the pool. + When supplied, the complete configuration for the selected maintenance management type is + required. Omission preserves the current configuration. + :vartype scheduledMaintenance: "ScheduledMaintenancePropertiesForPatchUpdate" + """ + + computeModel: "PoolComputeModelForPatchUpdate" + """The compute model properties to update. Omitted properties preserve their current values. To + change the compute model type, supply the complete target compute model, including type, + computeProcessor, computeGeneration, and all properties required by the target type.""" + nodeCount: int + """The number of nodes to allocate and assign to the pool. Allowed values are 1 through 16. + Omission preserves the current configured value. To deallocate runtime compute without changing + the configured node count, stop the pool.""" + highAvailability: "PoolHighAvailabilityPatch" + """The high-availability configuration to update. Omission preserves the current mode. The service + recursively merges omitted PATCH properties with the existing resource before validating the + effective nodeCount and mode together.""" + parameterGroup: "PoolParameterGroupReferenceForPatchUpdate" + """The corresponding default or a customer-created parameter group to associate with the existing + pool. Customers can switch in either direction between these group types. Omission preserves + the current association.""" + scheduledMaintenance: "ScheduledMaintenancePropertiesForPatchUpdate" + """The scheduled maintenance configuration to update for the pool. When supplied, the complete + configuration for the selected maintenance management type is required. Omission preserves the + current configuration.""" + + class PrivateEndpoint(TypedDict, total=False): """The private endpoint resource. @@ -783,6 +2052,43 @@ class PrivateLinkServiceConnectionState(TypedDict, total=False): """A message indicating if changes on the service provider require any updates on the consumer.""" +class ReadWritePoolProperties(TypedDict, total=False): + """The pool currently designated to host a HorizonDB cluster's read-write node. When a pool is + created while the cluster currently has no pools, the service automatically designates the new + pool as the read-write pool. This behavior also applies after all pools that existed earlier in + the cluster's lifetime have been deleted. + + :ivar designatedPoolResourceId: The Azure resource ID of the pool designated to host the + cluster's read-write node. The pool is a child resource of this cluster. When a pool is created + while the cluster currently has no pools, the service automatically sets this property to the + new pool's resource ID, including when all pools that existed earlier in the cluster's lifetime + were deleted. This property is absent when no pool is designated, such as after + clearReadWritePool succeeds. + :vartype designatedPoolResourceId: str + """ + + designatedPoolResourceId: str + """The Azure resource ID of the pool designated to host the cluster's read-write node. The pool is + a child resource of this cluster. When a pool is created while the cluster currently has no + pools, the service automatically sets this property to the new pool's resource ID, including + when all pools that existed earlier in the cluster's lifetime were deleted. This property is + absent when no pool is designated, such as after clearReadWritePool succeeds.""" + + +class ScheduledMaintenancePropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """The scheduled maintenance configuration for a pool update operation. + + :ivar maintenanceManagementType: Specifies whether scheduled maintenance is managed by the + system or by the user. When scheduledMaintenance is supplied, this property is required by the + service. "System" + :vartype maintenanceManagementType: Union[str, "ScheduledMaintenanceManagementType"] + """ + + maintenanceManagementType: Union[str, "ScheduledMaintenanceManagementType"] + """Specifies whether scheduled maintenance is managed by the system or by the user. When + scheduledMaintenance is supplied, this property is required by the service. \"System\"""" + + class SystemData(TypedDict, total=False): """Metadata pertaining to creation and last modification of the resource. @@ -818,6 +2124,20 @@ class SystemData(TypedDict, total=False): """The timestamp of resource last modification (UTC).""" +class SystemScheduledMaintenanceProperties(TypedDict, total=False): + """The system-managed scheduled maintenance configuration for a HorizonDB pool. User-managed + schedule properties must be absent. + + :ivar maintenanceManagementType: Specifies that scheduled maintenance is managed by the system. + Required. Scheduled maintenance is managed by the system. + :vartype maintenanceManagementType: Literal[ScheduledMaintenanceManagementType.SYSTEM] + """ + + maintenanceManagementType: Required[Literal[ScheduledMaintenanceManagementType.SYSTEM]] + """Specifies that scheduled maintenance is managed by the system. Required. Scheduled maintenance + is managed by the system.""" + + class UserAssignedIdentity(TypedDict, total=False): """User assigned identity properties. @@ -831,3 +2151,7 @@ class UserAssignedIdentity(TypedDict, total=False): """The principal ID of the assigned identity.""" clientId: str """The client ID of the assigned identity.""" + + +ChangeDataCaptureDestinationDetails = Union[FabricDestinationDetails] +ScheduledMaintenanceProperties = Union[SystemScheduledMaintenanceProperties] diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/authentications_list.py similarity index 83% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_list.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/authentications_list.py index 9ffbcb09dccb..026a2a70c32f 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/authentications_list.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python administrators_list.py + python authentications_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_administrators.list( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.authentications.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/Administrators_List.json +# x-ms-original-file: 2026-10-01-preview/Authentications_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_get.py new file mode 100644 index 000000000000..cb5b7ea9bcd5 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python capabilities_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.capabilities.get( + location="eastus2", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Capabilities_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_list.py new file mode 100644 index 000000000000..057889888274 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/capabilities_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python capabilities_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.capabilities.list( + location="eastus2", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/Capabilities_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_create_or_replace.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_create_or_replace.py new file mode 100644 index 000000000000..ede53f0c23c6 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_create_or_replace.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_capabilities_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_capabilities.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + resource={"properties": {"autoUpgradeExtension": True, "desiredState": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureCapabilities_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_delete.py similarity index 80% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_delete.py index a1d306429237..0d8f96fb9b88 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_delete.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python replicas_delete.py + python change_data_capture_capabilities_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_replicas.begin_delete( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - replica_name="examplereplica", + client.change_data_capture_capabilities.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ).result() -# x-ms-original-file: 2026-05-01-preview/Replicas_Delete.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureCapabilities_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_get.py similarity index 80% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_get.py index b82378afe31c..8df1a0aa558d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_get.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python replicas_get.py + python change_data_capture_capabilities_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_replicas.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - replica_name="examplereplica", + response = client.change_data_capture_capabilities.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) print(response) -# x-ms-original-file: 2026-05-01-preview/Replicas_Get.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureCapabilities_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_list.py similarity index 81% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_list.py index c26cfe913781..ca093a95db98 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_list.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python parameter_groups_list_versions.py + python change_data_capture_capabilities_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.list_versions( - resource_group_name="exampleresourcegroup", - parameter_group_name="exampleparametergroup", + response = client.change_data_capture_capabilities.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListVersions.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureCapabilities_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_update.py similarity index 77% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_update.py index a3686156a0e6..09ed8fe3f28e 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_capabilities_update.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python replicas_update.py + python change_data_capture_capabilities_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,16 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_replicas.begin_update( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - replica_name="examplereplica", - properties={"properties": {"role": "ReadWrite"}}, + response = client.change_data_capture_capabilities.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={"properties": {"autoUpgradeExtension": False}}, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/Replicas_Update.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureCapabilities_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_create_or_replace.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_create_or_replace.py new file mode 100644 index 000000000000..72345bfb12e2 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_create_or_replace.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_configurations_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_configurations.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + configuration_name="sales-database", + resource={ + "properties": { + "databaseName": "sales", + "desiredState": "Enabled", + "destinationResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/example-cluster/changeDataCaptureDestinations/fabric-mirroring", + "usageProfile": "Mirroring", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureConfigurations_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_delete.py new file mode 100644 index 000000000000..46a69cab84fd --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_configurations_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.change_data_capture_configurations.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + configuration_name="sales-database", + ).result() + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureConfigurations_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_get.py new file mode 100644 index 000000000000..f165b0c951b7 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_configurations_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_configurations.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + configuration_name="sales-database", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureConfigurations_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_list.py new file mode 100644 index 000000000000..13deebc9f0ae --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_configurations_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_configurations.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureConfigurations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_update.py new file mode 100644 index 000000000000..a3b1fd0d4150 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_configurations_update.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_configurations_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_configurations.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + configuration_name="sales-database", + properties={"properties": {"desiredState": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureConfigurations_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_activate_identity.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_activate_identity.py new file mode 100644 index 000000000000..e7a8eb3dcee5 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_activate_identity.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_destinations_activate_identity.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_destinations.begin_activate_identity( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + body={ + "drainExistingSessions": True, + "identityAssignmentResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/example-cluster/changeDataCaptureDestinations/fabric-mirroring/identityAssignments/fabric-writer", + }, + etag="*", + match_condition=~azure.core.MatchConditions, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureDestinations_ActivateIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_create_or_replace.py similarity index 66% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_create_or_replace.py index 0fb68dd1fad2..e160ec6a1abf 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_create_or_replace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python clusters_create_or_update.py + python change_data_capture_destinations_create_or_replace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,26 +30,24 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_clusters.begin_create_or_update( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.change_data_capture_destinations.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", resource={ - "location": "westus2", "properties": { - "administratorLogin": "exampleadministratorlogin", - "administratorLoginPassword": "examplepassword", - "createMode": "Create", - "replicaCount": 2, - "vCores": 4, - "version": "17", - "zonePlacementPolicy": "BestEffort", - }, - "tags": {"env": "dev"}, + "desiredState": "Enabled", + "destination": { + "destinationType": "Fabric", + "protocol": "Native", + "workspaceId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + }, + } }, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/Clusters_CreateOrUpdate.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureDestinations_CreateOrReplace.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_delete.py similarity index 78% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_delete.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_delete.py index 38d830acd81b..2caa37da61b3 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_delete.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python administrators_delete.py + python change_data_capture_destinations_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_administrators.begin_delete( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - object_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + client.change_data_capture_destinations.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", ).result() -# x-ms-original-file: 2026-05-01-preview/Administrators_Delete.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureDestinations_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_get.py new file mode 100644 index 000000000000..408bac8cea9e --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_destinations_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_destinations.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureDestinations_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_list.py new file mode 100644 index 000000000000..06e716ab8626 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python change_data_capture_destinations_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.change_data_capture_destinations.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureDestinations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_update.py similarity index 75% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_update.py index 11f08272495b..9e4f9e0f6d1b 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/change_data_capture_destinations_update.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python replicas_create_or_update.py + python change_data_capture_destinations_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,16 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_replicas.begin_create_or_update( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - replica_name="examplereplica", - resource={"properties": {"availabilityZone": "1", "role": "Read"}}, + response = client.change_data_capture_destinations.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + properties={"properties": {"desiredState": "Disabled"}}, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/Replicas_CreateOrUpdate.json +# x-ms-original-file: 2026-10-01-preview/ChangeDataCaptureDestinations_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace.py new file mode 100644 index 000000000000..493c62b31f13 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace.py @@ -0,0 +1,58 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + resource={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer": {} + }, + }, + "location": "eastus2", + "properties": { + "backup": {"geoRedundancy": "Enabled", "retentionDays": 14}, + "network": {"publicAccess": "Enabled"}, + "postgreSqlVersion": "17", + }, + "tags": {"environment": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_cross_region_point_in_time_restore.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_cross_region_point_in_time_restore.py new file mode 100644 index 000000000000..3e5238215713 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_cross_region_point_in_time_restore.py @@ -0,0 +1,54 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_create_or_replace_cross_region_point_in_time_restore.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="cross-region-restored-cluster", + resource={ + "location": "westus2", + "properties": { + "backup": {"geoRedundancy": "Enabled", "retentionDays": 14}, + "creationMode": "PointInTimeRestore", + "creationSourceClusterLocation": "eastus2", + "creationSourceClusterResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster", + "network": {"publicAccess": "Disabled"}, + "pointInTimeUtc": "2026-07-27T12:00:00Z", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_CreateOrReplaceCrossRegionPointInTimeRestore.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_minimum_defaults.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_minimum_defaults.py new file mode 100644 index 000000000000..650232c5dbde --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_minimum_defaults.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_create_or_replace_minimum_defaults.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="minimum-defaults", + resource={ + "location": "eastus2", + "properties": {"backup": {"geoRedundancy": "Disabled"}, "postgreSqlVersion": "18"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_CreateOrReplaceMinimumDefaults.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_point_in_time_restore.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_point_in_time_restore.py new file mode 100644 index 000000000000..5b4f8f4246fd --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_point_in_time_restore.py @@ -0,0 +1,53 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_create_or_replace_point_in_time_restore.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="restored-cluster", + resource={ + "location": "eastus2", + "properties": { + "backup": {"geoRedundancy": "Enabled", "retentionDays": 14}, + "creationMode": "PointInTimeRestore", + "creationSourceClusterResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster", + "network": {"publicAccess": "Disabled"}, + "pointInTimeUtc": "2026-07-27T12:00:00Z", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_CreateOrReplacePointInTimeRestore.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_with_data_encryption.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_with_data_encryption.py new file mode 100644 index 000000000000..4b9d903c81f1 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_replace_with_data_encryption.py @@ -0,0 +1,61 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_create_or_replace_with_data_encryption.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + resource={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity": {} + }, + }, + "location": "eastus2", + "properties": { + "backup": {"geoRedundancy": "Disabled", "retentionDays": 14}, + "dataEncryption": { + "primaryKeyUri": "https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key", + "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity", + "type": "AzureKeyVault", + }, + "postgreSqlVersion": "17", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_CreateOrReplaceWithDataEncryption.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py index a0e24ef52c71..2e8479a6c583 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py @@ -30,12 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_clusters.begin_delete( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + client.clusters.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ).result() -# x-ms-original-file: 2026-05-01-preview/Clusters_Delete.json +# x-ms-original-file: 2026-10-01-preview/Clusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_failover.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_failover.py new file mode 100644 index 000000000000..871e29e07970 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_failover.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_failover.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_failover( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_Failover.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py index 8aa0d44252fe..03627291c693 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_clusters.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.clusters.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) print(response) -# x-ms-original-file: 2026-05-01-preview/Clusters_Get.json +# x-ms-original-file: 2026-10-01-preview/Clusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_after_pool_creation_on_empty_cluster.py similarity index 80% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_get.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_after_pool_creation_on_empty_cluster.py index b9430274b0a2..b0223dad7746 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_after_pool_creation_on_empty_cluster.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python administrators_get.py + python clusters_get_after_pool_creation_on_empty_cluster.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_administrators.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - object_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + response = client.clusters.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) print(response) -# x-ms-original-file: 2026-05-01-preview/Administrators_Get.json +# x-ms-original-file: 2026-10-01-preview/Clusters_GetAfterPoolCreationOnEmptyCluster.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_minimum_defaults.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_minimum_defaults.py new file mode 100644 index 000000000000..a47e34a40441 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get_minimum_defaults.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_get_minimum_defaults.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.get( + resource_group_name="example-resource-group", + cluster_name="minimum-defaults", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_GetMinimumDefaults.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py index fec6ecf13d00..497ccff44755 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_clusters.list_by_resource_group( - resource_group_name="exampleresourcegroup", + response = client.clusters.list_by_resource_group( + resource_group_name="example-resource-group", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/Clusters_ListByResourceGroup.json +# x-ms-original-file: 2026-10-01-preview/Clusters_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py index b8b88554fc66..efd881ce892d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py @@ -30,11 +30,11 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_clusters.list_by_subscription() + response = client.clusters.list_by_subscription() for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/Clusters_ListBySubscription.json +# x-ms-original-file: 2026-10-01-preview/Clusters_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py index a1e35348eef1..23ff4d883e1d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py @@ -30,17 +30,17 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_clusters.begin_update( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.clusters.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", properties={ - "properties": {"administratorLoginPassword": "examplenewpassword", "vCores": 8}, - "tags": {"team": "updated-data-platform"}, + "properties": {"backup": {"retentionDays": 21}, "network": {"publicAccess": "Disabled"}}, + "tags": {"environment": "production", "team": "data-platform"}, }, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/Clusters_Update.json +# x-ms-original-file: 2026-10-01-preview/Clusters_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update_data_encryption.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update_data_encryption.py new file mode 100644 index 000000000000..d290d36c727d --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update_data_encryption.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_update_data_encryption.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={ + "properties": { + "dataEncryption": { + "primaryKeyUri": "https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key" + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Clusters_UpdateDataEncryption.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_get.py new file mode 100644 index 000000000000..bd677ae095a1 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python default_parameter_groups_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.default_parameter_groups.get( + location="eastus2", + name="default-postgresql-17-provisioned", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/DefaultParameterGroups_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_list.py similarity index 82% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_list.py index 68258f051f96..3322eb55fd84 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/default_parameter_groups_list.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python replicas_list.py + python default_parameter_groups_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_replicas.list( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", + response = client.default_parameter_groups.list_by_subscription_and_region( + location="eastus2", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/Replicas_List.json +# x-ms-original-file: 2026-10-01-preview/DefaultParameterGroups_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get.py new file mode 100644 index 000000000000..677157518b88 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python endpoints_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + endpoint_name="example-cluster", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Endpoints_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get_read_only.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get_read_only.py new file mode 100644 index 000000000000..1464c233ec15 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_get_read_only.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python endpoints_get_read_only.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + endpoint_name="example-pool-01", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Endpoints_GetReadOnly.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_list.py new file mode 100644 index 000000000000..cb802c9093d8 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/endpoints_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python endpoints_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/Endpoints_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_replace.py similarity index 73% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_replace.py index dfac37be9145..983e04b4d75d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_replace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python firewall_rules_create_or_update.py + python firewall_rules_create_or_replace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_firewall_rules.begin_create_or_update( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - firewall_rule_name="examplefirewallrule", + response = client.firewall_rules.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + firewall_rule_name="example-firewall-rule-01", resource={ "properties": { - "description": "Allow access from corporate network", - "endIpAddress": "10.0.0.10", + "description": "Allow access from the corporate network", + "endIpAddress": "10.0.0.254", "startIpAddress": "10.0.0.1", } }, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/FirewallRules_CreateOrUpdate.json +# x-ms-original-file: 2026-10-01-preview/FirewallRules_CreateOrReplace.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py index 71d440fb3819..7f6d33f8c550 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_firewall_rules.begin_delete( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - firewall_rule_name="examplefirewallrule", + client.firewall_rules.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + firewall_rule_name="example-firewall-rule-01", ).result() -# x-ms-original-file: 2026-05-01-preview/FirewallRules_Delete.json +# x-ms-original-file: 2026-10-01-preview/FirewallRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py index e701ee7c830f..f95291db086c 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py @@ -30,15 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_firewall_rules.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", - firewall_rule_name="examplefirewallrule", + response = client.firewall_rules.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + firewall_rule_name="example-firewall-rule-01", ) print(response) -# x-ms-original-file: 2026-05-01-preview/FirewallRules_Get.json +# x-ms-original-file: 2026-10-01-preview/FirewallRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py index 5d73afa432c3..a6143603297e 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py @@ -30,15 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_firewall_rules.list( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", + response = client.firewall_rules.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/FirewallRules_List.json +# x-ms-original-file: 2026-10-01-preview/FirewallRules_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_create_or_replace.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_create_or_replace.py new file mode 100644 index 000000000000..cf149a5e0433 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_create_or_replace.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python identity_assignments_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.identity_assignments.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + assignment_name="fabric-writer", + resource={ + "properties": { + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer" + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/IdentityAssignments_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_delete.py new file mode 100644 index 000000000000..45b19c599adc --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_delete.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python identity_assignments_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.identity_assignments.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + assignment_name="fabric-writer", + ).result() + + +# x-ms-original-file: 2026-10-01-preview/IdentityAssignments_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_get.py new file mode 100644 index 000000000000..c850f9f6fb04 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python identity_assignments_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.identity_assignments.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + assignment_name="fabric-writer", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/IdentityAssignments_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_list.py new file mode 100644 index 000000000000..ce8c9c058df3 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/identity_assignments_list.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python identity_assignments_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.identity_assignments.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + destination_name="fabric-mirroring", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/IdentityAssignments_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_get.py new file mode 100644 index 000000000000..ee83d7b39b3f --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python log_capture_configurations_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.log_capture_configurations.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + log_capture_configuration_name="PostgreSqlServer", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/LogCaptureConfigurations_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_list.py new file mode 100644 index 000000000000..e1473bdfe026 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python log_capture_configurations_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.log_capture_configurations.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/LogCaptureConfigurations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_update.py new file mode 100644 index 000000000000..2c03c614f8e9 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_capture_configurations_update.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python log_capture_configurations_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.log_capture_configurations.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + log_capture_configuration_name="PostgreSqlServer", + properties={"properties": {"state": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/LogCaptureConfigurations_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_get.py new file mode 100644 index 000000000000..c3ee9d9d99cd --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python log_files_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.log_files.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + log_file_name="11111111-1111-1111-1111-111111111111", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/LogFiles_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list.py new file mode 100644 index 000000000000..f1851a477d25 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python log_files_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.log_files.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/LogFiles_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list_download_urls.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list_download_urls.py new file mode 100644 index 000000000000..e746dd96d821 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/log_files_list_download_urls.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python log_files_list_download_urls.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.log_files.list_download_urls( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + log_file_name="22222222-2222-2222-2222-222222222222", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/LogFiles_ListDownloadUrls.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_apply_now.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_apply_now.py new file mode 100644 index 000000000000..9e7f83dc5b0e --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_apply_now.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python maintenance_events_apply_now.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.begin_apply_now( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + maintenance_event_id="ABCD-123", + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MaintenanceEvents_ApplyNow.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_get.py new file mode 100644 index 000000000000..3492447f622a --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python maintenance_events_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + maintenance_event_id="ABCD-123", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MaintenanceEvents_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list.py new file mode 100644 index 000000000000..a0eb6c77295f --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python maintenance_events_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/MaintenanceEvents_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list_with_filter.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list_with_filter.py new file mode 100644 index 000000000000..59ca2244531f --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_list_with_filter.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python maintenance_events_list_with_filter.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/MaintenanceEvents_ListWithFilter.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_reschedule.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_reschedule.py new file mode 100644 index 000000000000..7aac805f0a56 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/maintenance_events_reschedule.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python maintenance_events_reschedule.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.begin_reschedule( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + maintenance_event_id="ABCD-123", + body={"postponeToDateTimeUtc": "2026-08-20T10:00:00Z"}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MaintenanceEvents_Reschedule.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_create_or_replace.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_create_or_replace.py new file mode 100644 index 000000000000..8fc2d9bc9b19 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_create_or_replace.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_administrators_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_administrators.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + object_id="11111111-1111-1111-1111-111111111111", + resource={ + "properties": { + "principalName": "database.administrators@contoso.com", + "principalType": "Group", + "tenantId": "22222222-2222-2222-2222-222222222222", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAdministrators_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_delete.py new file mode 100644 index 000000000000..dd3f66513fed --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_administrators_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.microsoft_entra_administrators.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + object_id="11111111-1111-1111-1111-111111111111", + ).result() + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAdministrators_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_get.py new file mode 100644 index 000000000000..f1ba2e4adccd --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_administrators_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_administrators.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + object_id="11111111-1111-1111-1111-111111111111", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAdministrators_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_list.py new file mode 100644 index 000000000000..0c52118f4406 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_administrators_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_administrators_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_administrators.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAdministrators_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_disabled.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_disabled.py new file mode 100644 index 000000000000..e7cf1a50d4d0 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_disabled.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_authentications_create_or_replace_disabled.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_authentications.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + resource={"properties": {"state": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAuthentications_CreateOrReplaceDisabled.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_enabled.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_enabled.py new file mode 100644 index 000000000000..dc69e19069e3 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_create_or_replace_enabled.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_authentications_create_or_replace_enabled.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_authentications.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + resource={"properties": {"state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAuthentications_CreateOrReplaceEnabled.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_disable.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_disable.py new file mode 100644 index 000000000000..8b85a515e787 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_disable.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_authentications_disable.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_authentications.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={"properties": {"state": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAuthentications_Disable.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_enable.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_enable.py new file mode 100644 index 000000000000..4903e3b4ec12 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_enable.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_authentications_enable.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_authentications.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={"properties": {"state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAuthentications_Enable.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_get.py new file mode 100644 index 000000000000..76590c84b534 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/microsoft_entra_authentications_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python microsoft_entra_authentications_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.microsoft_entra_authentications.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/MicrosoftEntraAuthentications_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_get.py new file mode 100644 index 000000000000..699348fa10d7 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python nodes_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.nodes.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + node_name="node-01", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Nodes_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_list.py new file mode 100644 index 000000000000..58ac0464704f --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/nodes_list.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python nodes_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.nodes.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-10-01-preview/Nodes_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py index 6a328524cf08..37358af23505 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Operations_List.json +# x-ms-original-file: 2026-10-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_replace.py similarity index 61% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_replace.py index 24268cdd4f0b..a34466105a77 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_replace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python parameter_groups_create_or_update.py + python parameter_groups_create_or_replace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,27 +30,28 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.begin_create_or_update( - resource_group_name="exampleresourcegroup", - parameter_group_name="exampleparametergroup", + response = client.parameter_groups.begin_create_or_replace( + resource_group_name="example-resource-group", + parameter_group_name="production-parameters", resource={ - "location": "westus2", + "location": "eastus2", "properties": { - "applyImmediately": True, - "description": "Parameter group for high-throughput workloads", + "description": "Parameters for production transactional workloads", "parameters": [ - {"name": "max_connections", "value": "200"}, - {"name": "log_min_error_statement", "value": "error"}, - {"name": "shared_buffers", "value": "2000"}, + {"name": "application_name", "value": "horizondb-production"}, + {"name": "autovacuum", "value": "off"}, + {"name": "wal_receiver_timeout", "value": "45000"}, + {"name": "work_mem", "value": "8192"}, + {"name": "xmlbinary", "value": "base64"}, ], - "pgVersion": 17, + "postgreSqlVersion": "17", }, - "tags": {"env": "dev", "team": "data-platform"}, + "tags": {"environment": "production"}, }, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_CreateOrUpdate.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_CreateOrReplace.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py index 9601df4a8742..a0a76bdb0bc4 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py @@ -30,12 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_parameter_groups.begin_delete( - resource_group_name="exampleresourcegroup", - parameter_group_name="exampleparametergroup", + client.parameter_groups.begin_delete( + resource_group_name="example-resource-group", + parameter_group_name="production-parameters", ).result() -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_Delete.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py index 01b2cb44862c..8f6848443c5a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.get( - resource_group_name="exampleresourcegroup", - parameter_group_name="exampleparametergroup", + response = client.parameter_groups.get( + resource_group_name="example-resource-group", + parameter_group_name="production-parameters", ) print(response) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_Get.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py index fe206fb5caa3..859856dfb91a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.list_by_resource_group( - resource_group_name="exampleresourcegroup", + response = client.parameter_groups.list_by_resource_group( + resource_group_name="example-resource-group", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListByResourceGroup.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py index 2835974b2913..7182ee279063 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py @@ -30,11 +30,11 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.list_by_subscription() + response = client.parameter_groups.list_by_subscription() for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListBySubscription.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py index 11e47d870a6c..d52f1165352e 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.list_connections( - resource_group_name="exampleresourcegroup", - parameter_group_name="exampleparametergroup", + response = client.parameter_groups.list_connections( + resource_group_name="example-resource-group", + parameter_group_name="production-parameters", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListConnections.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_ListConnections.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py index be3476e20ac7..e4d9e6e8d2d7 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py @@ -30,24 +30,26 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_parameter_groups.begin_update( - resource_group_name="exampleresourcegroup", - parameter_group_name="exampleparametergroup", + response = client.parameter_groups.begin_update( + resource_group_name="example-resource-group", + parameter_group_name="production-parameters", properties={ "properties": { - "applyImmediately": True, - "description": "Updated parameter group for high-throughput workloads", + "description": "Updated parameters for production transactional workloads", "parameters": [ - {"name": "max_connections", "value": "300"}, - {"name": "log_min_error_statement", "value": "warning"}, + {"name": "application_name", "value": "horizondb-production"}, + {"name": "autovacuum", "value": "off"}, + {"name": "wal_receiver_timeout", "value": "45000"}, + {"name": "work_mem", "value": "8192"}, + {"name": "xmlbinary", "value": "base64"}, ], }, - "tags": {"team": "updated-data-platform"}, + "tags": {"environment": "production", "team": "data-platform"}, }, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/ParameterGroups_Update.json +# x-ms-original-file: 2026-10-01-preview/ParameterGroups_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_create_or_replace.py similarity index 72% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_create_or_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_create_or_replace.py index 971bbd5b4cfc..231816d4e716 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_create_or_replace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python administrators_create_or_update.py + python password_authentications_create_or_replace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,21 +30,20 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_administrators.begin_create_or_update( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - object_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + response = client.password_authentications.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", resource={ "properties": { - "principalName": "admin@contoso.com", - "principalType": "User", - "tenantId": "11111111-2222-3333-4444-555555555555", + "administratorLogin": "adminlogin1", + "administratorLoginPassword": "********", + "state": "Enabled", } }, ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/Administrators_CreateOrUpdate.json +# x-ms-original-file: 2026-10-01-preview/PasswordAuthentications_CreateOrReplace.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_disable.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_disable.py new file mode 100644 index 000000000000..7a943951a373 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_disable.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python password_authentications_disable.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.password_authentications.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={"properties": {"state": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/PasswordAuthentications_Disable.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_enable.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_enable.py new file mode 100644 index 000000000000..b1757867e5fc --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_enable.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python password_authentications_enable.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.password_authentications.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={"properties": {"administratorLoginPassword": "********", "state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/PasswordAuthentications_Enable.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_get.py new file mode 100644 index 000000000000..ba6b6425527f --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python password_authentications_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.password_authentications.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/PasswordAuthentications_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_reset_password.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_reset_password.py new file mode 100644 index 000000000000..a0e0633a899d --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/password_authentications_reset_password.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python password_authentications_reset_password.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.password_authentications.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + properties={"properties": {"administratorLoginPassword": "********"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/PasswordAuthentications_ResetPassword.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_create_or_replace.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_create_or_replace.py new file mode 100644 index 000000000000..60d3da2c69b1 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_create_or_replace.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pools.begin_create_or_replace( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + resource={ + "properties": { + "computeModel": {"computeGeneration": 3, "computeProcessor": "AMD", "type": "Provisioned", "vCores": 2}, + "highAvailability": {"mode": "Disabled"}, + "nodeCount": 1, + "parameterGroup": { + "applyMethod": "Immediate", + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned", + }, + "scheduledMaintenance": {"maintenanceManagementType": "System"}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Pools_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_delete.py new file mode 100644 index 000000000000..8b155780aab4 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.pools.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + ).result() + + +# x-ms-original-file: 2026-10-01-preview/Pools_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py index 0fdafd072871..e6db06f372cd 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_pools.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - pool_name="examplepool", + response = client.pools.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", ) print(response) -# x-ms-original-file: 2026-05-01-preview/Pools_Get.json +# x-ms-original-file: 2026-10-01-preview/Pools_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py index 6440cf0d2e9a..49e81e629dbd 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_pools.list( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.pools.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/Pools_List.json +# x-ms-original-file: 2026-10-01-preview/Pools_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_start.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_restart.py similarity index 87% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_start.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_restart.py index 09c00699a763..2f02f824b740 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_start.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_restart.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python clusters_start.py + python pools_restart.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,12 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_clusters.begin_start( + response = client.pools.begin_restart( resource_group_name="exampleresourcegroup", cluster_name="examplecluster", + pool_name="example-pool-01", ).result() + print(response) -# x-ms-original-file: 2026-05-01-preview/Clusters_Start.json +# x-ms-original-file: 2026-10-01-preview/Pools_Restart.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_stop.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_start.py similarity index 87% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_stop.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_start.py index 6bb813d39f32..5cc7dc833f88 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_stop.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_start.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python clusters_stop.py + python pools_start.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,12 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_clusters.begin_stop( + response = client.pools.begin_start( resource_group_name="exampleresourcegroup", cluster_name="examplecluster", + pool_name="example-pool-01", ).result() + print(response) -# x-ms-original-file: 2026-05-01-preview/Clusters_Stop.json +# x-ms-original-file: 2026-10-01-preview/Pools_Start.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_restart.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_stop.py similarity index 88% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_restart.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_stop.py index b69615adf97e..15e34f4791d9 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_restart.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_stop.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python clusters_restart.py + python pools_stop.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,12 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_clusters.begin_restart( + response = client.pools.begin_stop( resource_group_name="exampleresourcegroup", cluster_name="examplecluster", + pool_name="example-pool-01", ).result() + print(response) -# x-ms-original-file: 2026-05-01-preview/Clusters_Restart.json +# x-ms-original-file: 2026-10-01-preview/Pools_Stop.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update.py new file mode 100644 index 000000000000..b88d6ee06987 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pools.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + properties={ + "properties": { + "computeModel": {"vCores": 16}, + "scheduledMaintenance": {"maintenanceManagementType": "System"}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Pools_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_high_availability_mode.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_high_availability_mode.py new file mode 100644 index 000000000000..db078f040ad2 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_high_availability_mode.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_update_high_availability_mode.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pools.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + properties={"properties": {"highAvailability": {"mode": "ZoneRedundant"}}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Pools_UpdateHighAvailabilityMode.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_default.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_default.py new file mode 100644 index 000000000000..3a8adb950acc --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_default.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_update_parameter_group_default.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pools.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + properties={ + "properties": { + "parameterGroup": { + "applyMethod": "Immediate", + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Pools_UpdateParameterGroupDefault.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_immediate.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_immediate.py new file mode 100644 index 000000000000..38b909562ec7 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_immediate.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_update_parameter_group_immediate.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pools.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + properties={ + "properties": { + "parameterGroup": { + "applyMethod": "Immediate", + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/production-parameters", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Pools_UpdateParameterGroupImmediate.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_pending_reboot.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_pending_reboot.py new file mode 100644 index 000000000000..06a4de53b850 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_update_parameter_group_pending_reboot.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python pools_update_parameter_group_pending_reboot.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pools.begin_update( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + pool_name="example-pool-01", + properties={ + "properties": { + "parameterGroup": { + "applyMethod": "PendingReboot", + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/maintenance-window-parameters", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-10-01-preview/Pools_UpdateParameterGroupPendingReboot.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update_status.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_approve_or_reject.py similarity index 72% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update_status.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_approve_or_reject.py index 5833fe078f02..d1fc0dd6b9fa 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update_status.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_approve_or_reject.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python private_endpoint_connections_update_status.py + python private_endpoint_connections_approve_or_reject.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,22 +30,22 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_private_endpoint_connections.update_status( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - private_endpoint_connection_name="exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + response = client.private_endpoint_connections.begin_approve_or_reject( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + private_endpoint_connection_name="example-private-endpoint-connection", resource={ "properties": { "privateLinkServiceConnectionState": { - "description": "Approved by `johndoe@contoso.com `_", + "description": "Approved for the production database network", "status": "Approved", } } }, - ) + ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_UpdateStatus.json +# x-ms-original-file: 2026-10-01-preview/PrivateEndpointConnections_ApproveOrReject.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py index 33ffe03f7ac4..25ac5dac726e 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.horizon_db_private_endpoint_connections.begin_delete( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - private_endpoint_connection_name="exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + client.private_endpoint_connections.begin_delete( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + private_endpoint_connection_name="example-private-endpoint-connection", ).result() -# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_Delete.json +# x-ms-original-file: 2026-10-01-preview/PrivateEndpointConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py index 1cd057096062..87d9874a6ebd 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_private_endpoint_connections.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - private_endpoint_connection_name="exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + response = client.private_endpoint_connections.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + private_endpoint_connection_name="example-private-endpoint-connection", ) print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_Get.json +# x-ms-original-file: 2026-10-01-preview/PrivateEndpointConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get_disconnected_after_last_pool_deletion.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get_disconnected_after_last_pool_deletion.py new file mode 100644 index 000000000000..19fe5a036eaf --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get_disconnected_after_last_pool_deletion.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python private_endpoint_connections_get_disconnected_after_last_pool_deletion.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.private_endpoint_connections.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + private_endpoint_connection_name="example-private-endpoint-connection", + ) + print(response) + + +# x-ms-original-file: 2026-10-01-preview/PrivateEndpointConnections_GetDisconnectedAfterLastPoolDeletion.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py index 181e75bef40e..d6101d81fd7d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_private_endpoint_connections.list( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.private_endpoint_connections.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_List.json +# x-ms-original-file: 2026-10-01-preview/PrivateEndpointConnections_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py index fac5fab62a7f..33e96c74ecce 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_private_link_resources.get( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", - group_name="default", + response = client.private_link_resources.get( + resource_group_name="example-resource-group", + cluster_name="example-cluster", + group_name="example-cluster", ) print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateLinkResources_Get.json +# x-ms-original-file: 2026-10-01-preview/PrivateLinkResources_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py index 92e49b4efa92..b104985037f8 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_private_link_resources.list( - resource_group_name="exampleresourcegroup", - cluster_name="examplecluster", + response = client.private_link_resources.list( + resource_group_name="example-resource-group", + cluster_name="example-cluster", ) for item in response: print(item) -# x-ms-original-file: 2026-05-01-preview/PrivateLinkResources_List.json +# x-ms-original-file: 2026-10-01-preview/PrivateLinkResources_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations.py new file mode 100644 index 000000000000..ac24e05aa46e --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtAuthenticationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_authentications_list(self, resource_group): + response = self.client.authentications.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations_async.py new file mode 100644 index 000000000000..bd29174e96c3 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_authentications_operations_async.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_authentications_list(self, resource_group): + response = self.client.authentications.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations.py new file mode 100644 index 000000000000..8b6fc54c0835 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtCapabilitiesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_capabilities_get(self, resource_group): + response = self.client.capabilities.get( + location="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_capabilities_list(self, resource_group): + response = self.client.capabilities.list( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations_async.py new file mode 100644 index 000000000000..d5a3261f2d70 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_capabilities_operations_async.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtCapabilitiesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_capabilities_get(self, resource_group): + response = await self.client.capabilities.get( + location="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_capabilities_list(self, resource_group): + response = self.client.capabilities.list( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_replicas_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_capabilities_operations.py similarity index 65% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_replicas_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_capabilities_operations.py index 4a087e3454bf..60bdac158b72 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_replicas_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_capabilities_operations.py @@ -14,18 +14,16 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbReplicasOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtChangeDataCaptureCapabilitiesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_replicas_get(self, resource_group): - response = self.client.horizon_db_replicas.get( + def test_change_data_capture_capabilities_get(self, resource_group): + response = self.client.change_data_capture_capabilities.get( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", ) # please add some check logic here by yourself @@ -33,33 +31,25 @@ def test_horizon_db_replicas_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_replicas_list(self, resource_group): - response = self.client.horizon_db_replicas.list( + def test_change_data_capture_capabilities_begin_create_or_replace(self, resource_group): + response = self.client.change_data_capture_capabilities.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_horizon_db_replicas_begin_create_or_update(self, resource_group): - response = self.client.horizon_db_replicas.begin_create_or_update( - resource_group_name=resource_group.name, - cluster_name="str", - pool_name="str", - replica_name="str", resource={ + "eTag": "str", "id": "str", "name": "str", "properties": { - "availabilityZone": "str", - "fullyQualifiedDomainName": "str", + "configurationCount": 0, + "desiredState": "str", + "destinationCount": 0, + "effectiveState": "str", + "extension": {"name": "str", "state": "str", "version": "str"}, + "prerequisites": {"engineConfigurationState": "str", "readWriteEndpointState": "str"}, + "replicationArchitecture": "str", + "status": {"code": "str", "message": "str"}, + "autoUpgradeExtension": bool, "provisioningState": "str", - "role": "str", - "status": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -78,13 +68,11 @@ def test_horizon_db_replicas_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_replicas_begin_update(self, resource_group): - response = self.client.horizon_db_replicas.begin_update( + def test_change_data_capture_capabilities_begin_update(self, resource_group): + response = self.client.change_data_capture_capabilities.begin_update( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", - properties={"properties": {"role": "str"}}, + properties={"properties": {"autoUpgradeExtension": bool, "desiredState": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,13 +80,22 @@ def test_horizon_db_replicas_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_replicas_begin_delete(self, resource_group): - response = self.client.horizon_db_replicas.begin_delete( + def test_change_data_capture_capabilities_begin_delete(self, resource_group): + response = self.client.change_data_capture_capabilities.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_capabilities_list(self, resource_group): + response = self.client.change_data_capture_capabilities.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_replicas_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_capabilities_operations_async.py similarity index 66% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_replicas_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_capabilities_operations_async.py index d97481e7866d..58e4d6a5e563 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_replicas_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_capabilities_operations_async.py @@ -15,18 +15,16 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbReplicasOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtChangeDataCaptureCapabilitiesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_replicas_get(self, resource_group): - response = await self.client.horizon_db_replicas.get( + async def test_change_data_capture_capabilities_get(self, resource_group): + response = await self.client.change_data_capture_capabilities.get( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", ) # please add some check logic here by yourself @@ -34,34 +32,26 @@ async def test_horizon_db_replicas_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_replicas_list(self, resource_group): - response = self.client.horizon_db_replicas.list( - resource_group_name=resource_group.name, - cluster_name="str", - pool_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_horizon_db_replicas_begin_create_or_update(self, resource_group): + async def test_change_data_capture_capabilities_begin_create_or_replace(self, resource_group): response = await ( - await self.client.horizon_db_replicas.begin_create_or_update( + await self.client.change_data_capture_capabilities.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", resource={ + "eTag": "str", "id": "str", "name": "str", "properties": { - "availabilityZone": "str", - "fullyQualifiedDomainName": "str", + "configurationCount": 0, + "desiredState": "str", + "destinationCount": 0, + "effectiveState": "str", + "extension": {"name": "str", "state": "str", "version": "str"}, + "prerequisites": {"engineConfigurationState": "str", "readWriteEndpointState": "str"}, + "replicationArchitecture": "str", + "status": {"code": "str", "message": "str"}, + "autoUpgradeExtension": bool, "provisioningState": "str", - "role": "str", - "status": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -81,14 +71,12 @@ async def test_horizon_db_replicas_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_replicas_begin_update(self, resource_group): + async def test_change_data_capture_capabilities_begin_update(self, resource_group): response = await ( - await self.client.horizon_db_replicas.begin_update( + await self.client.change_data_capture_capabilities.begin_update( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", - properties={"properties": {"role": "str"}}, + properties={"properties": {"autoUpgradeExtension": bool, "desiredState": "str"}}, ) ).result() # call '.result()' to poll until service return final result @@ -97,15 +85,24 @@ async def test_horizon_db_replicas_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_replicas_begin_delete(self, resource_group): + async def test_change_data_capture_capabilities_begin_delete(self, resource_group): response = await ( - await self.client.horizon_db_replicas.begin_delete( + await self.client.change_data_capture_capabilities.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - pool_name="str", - replica_name="str", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_capabilities_list(self, resource_group): + response = self.client.change_data_capture_capabilities.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations.py new file mode 100644 index 000000000000..9515d6f6bf82 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtChangeDataCaptureConfigurationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_configurations_get(self, resource_group): + response = self.client.change_data_capture_configurations.get( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_configurations_begin_create_or_replace(self, resource_group): + response = self.client.change_data_capture_configurations.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": { + "databaseName": "str", + "desiredState": "str", + "destinationResourceId": "str", + "effectiveState": "str", + "extension": {"name": "str", "state": "str", "version": "str"}, + "logicalStreamId": "str", + "replication": { + "state": "str", + "externalArtifactId": "str", + "lastConnectedAtUtc": "2020-02-20 00:00:00", + }, + "status": {"code": "str", "message": "str"}, + "topology": { + "activeClusterResourceId": "str", + "generation": 0, + "state": "str", + "replacementConfigurationResourceId": "str", + }, + "usageProfile": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_configurations_begin_update(self, resource_group): + response = self.client.change_data_capture_configurations.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + properties={"properties": {"desiredState": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_configurations_begin_delete(self, resource_group): + response = self.client.change_data_capture_configurations.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_configurations_list(self, resource_group): + response = self.client.change_data_capture_configurations.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations_async.py new file mode 100644 index 000000000000..4cf3385aa2a6 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_configurations_operations_async.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtChangeDataCaptureConfigurationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_configurations_get(self, resource_group): + response = await self.client.change_data_capture_configurations.get( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_configurations_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.change_data_capture_configurations.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": { + "databaseName": "str", + "desiredState": "str", + "destinationResourceId": "str", + "effectiveState": "str", + "extension": {"name": "str", "state": "str", "version": "str"}, + "logicalStreamId": "str", + "replication": { + "state": "str", + "externalArtifactId": "str", + "lastConnectedAtUtc": "2020-02-20 00:00:00", + }, + "status": {"code": "str", "message": "str"}, + "topology": { + "activeClusterResourceId": "str", + "generation": 0, + "state": "str", + "replacementConfigurationResourceId": "str", + }, + "usageProfile": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_configurations_begin_update(self, resource_group): + response = await ( + await self.client.change_data_capture_configurations.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + properties={"properties": {"desiredState": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_configurations_begin_delete(self, resource_group): + response = await ( + await self.client.change_data_capture_configurations.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + configuration_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_configurations_list(self, resource_group): + response = self.client.change_data_capture_configurations.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations.py new file mode 100644 index 000000000000..52bc14591d99 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtChangeDataCaptureDestinationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_destinations_get(self, resource_group): + response = self.client.change_data_capture_destinations.get( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_destinations_begin_create_or_replace(self, resource_group): + response = self.client.change_data_capture_destinations.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": { + "configurationCount": 0, + "desiredState": "str", + "destination": "change_data_capture_destination_details", + "effectiveState": "str", + "status": {"code": "str", "message": "str"}, + "activeIdentityAssignmentResourceId": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_destinations_begin_update(self, resource_group): + response = self.client.change_data_capture_destinations.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + properties={"properties": {"desiredState": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_destinations_begin_delete(self, resource_group): + response = self.client.change_data_capture_destinations.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_destinations_list(self, resource_group): + response = self.client.change_data_capture_destinations.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_change_data_capture_destinations_begin_activate_identity(self, resource_group): + response = self.client.change_data_capture_destinations.begin_activate_identity( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + body={"identityAssignmentResourceId": "str", "drainExistingSessions": bool}, + etag="str", + match_condition=~azure.core.MatchConditions, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations_async.py new file mode 100644 index 000000000000..85da5da67be0 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_change_data_capture_destinations_operations_async.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtChangeDataCaptureDestinationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_destinations_get(self, resource_group): + response = await self.client.change_data_capture_destinations.get( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_destinations_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.change_data_capture_destinations.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": { + "configurationCount": 0, + "desiredState": "str", + "destination": "change_data_capture_destination_details", + "effectiveState": "str", + "status": {"code": "str", "message": "str"}, + "activeIdentityAssignmentResourceId": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_destinations_begin_update(self, resource_group): + response = await ( + await self.client.change_data_capture_destinations.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + properties={"properties": {"desiredState": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_destinations_begin_delete(self, resource_group): + response = await ( + await self.client.change_data_capture_destinations.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_destinations_list(self, resource_group): + response = self.client.change_data_capture_destinations.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_change_data_capture_destinations_begin_activate_identity(self, resource_group): + response = await ( + await self.client.change_data_capture_destinations.begin_activate_identity( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + body={"identityAssignmentResourceId": "str", "drainExistingSessions": bool}, + etag="str", + match_condition=~azure.core.MatchConditions, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations.py new file mode 100644 index 000000000000..1b93f3142017 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_get(self, resource_group): + response = self.client.clusters.get( + resource_group_name=resource_group.name, + cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_create_or_replace(self, resource_group): + response = self.client.clusters.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + resource={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "provisioningState": "str", + "readWritePool": {"designatedPoolResourceId": "str"}, + "state": "str", + "aiModelManagement": "str", + "backup": { + "geoRedundancy": "str", + "earliestRestorePointUtc": "2020-02-20 00:00:00", + "retentionDays": 0, + }, + "creationMode": "str", + "creationSourceClusterLocation": "str", + "creationSourceClusterResourceId": "str", + "dataEncryption": { + "primaryEncryptionKeyCurrentVersion": "str", + "primaryEncryptionKeyStatus": "str", + "primaryKeyUri": "str", + "primaryUserAssignedIdentityId": "str", + "type": "str", + }, + "network": {"publicAccess": "str"}, + "pointInTimeUtc": "2020-02-20 00:00:00", + "postgreSqlVersion": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_update(self, resource_group): + response = self.client.clusters.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + properties={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "aiModelManagement": "str", + "backup": {"retentionDays": 0}, + "dataEncryption": {"primaryKeyUri": "str", "primaryUserAssignedIdentityId": "str", "type": "str"}, + "network": {"publicAccess": "str"}, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_delete(self, resource_group): + response = self.client.clusters.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_list_by_resource_group(self, resource_group): + response = self.client.clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_list_by_subscription(self, resource_group): + response = self.client.clusters.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_failover(self, resource_group): + response = self.client.clusters.begin_failover( + resource_group_name=resource_group.name, + cluster_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations_async.py new file mode 100644 index 000000000000..64a0c3094acf --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_clusters_operations_async.py @@ -0,0 +1,161 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_get(self, resource_group): + response = await self.client.clusters.get( + resource_group_name=resource_group.name, + cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.clusters.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + resource={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "provisioningState": "str", + "readWritePool": {"designatedPoolResourceId": "str"}, + "state": "str", + "aiModelManagement": "str", + "backup": { + "geoRedundancy": "str", + "earliestRestorePointUtc": "2020-02-20 00:00:00", + "retentionDays": 0, + }, + "creationMode": "str", + "creationSourceClusterLocation": "str", + "creationSourceClusterResourceId": "str", + "dataEncryption": { + "primaryEncryptionKeyCurrentVersion": "str", + "primaryEncryptionKeyStatus": "str", + "primaryKeyUri": "str", + "primaryUserAssignedIdentityId": "str", + "type": "str", + }, + "network": {"publicAccess": "str"}, + "pointInTimeUtc": "2020-02-20 00:00:00", + "postgreSqlVersion": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_update(self, resource_group): + response = await ( + await self.client.clusters.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + properties={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "aiModelManagement": "str", + "backup": {"retentionDays": 0}, + "dataEncryption": { + "primaryKeyUri": "str", + "primaryUserAssignedIdentityId": "str", + "type": "str", + }, + "network": {"publicAccess": "str"}, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_delete(self, resource_group): + response = await ( + await self.client.clusters.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_list_by_resource_group(self, resource_group): + response = self.client.clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_list_by_subscription(self, resource_group): + response = self.client.clusters.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_failover(self, resource_group): + response = await ( + await self.client.clusters.begin_failover( + resource_group_name=resource_group.name, + cluster_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations.py new file mode 100644 index 000000000000..f89263901841 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtDefaultParameterGroupsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_default_parameter_groups_list_by_subscription_and_region(self, resource_group): + response = self.client.default_parameter_groups.list_by_subscription_and_region( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_default_parameter_groups_get(self, resource_group): + response = self.client.default_parameter_groups.get( + location="str", + name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations_async.py new file mode 100644 index 000000000000..cba788116575 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_default_parameter_groups_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtDefaultParameterGroupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_default_parameter_groups_list_by_subscription_and_region(self, resource_group): + response = self.client.default_parameter_groups.list_by_subscription_and_region( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_default_parameter_groups_get(self, resource_group): + response = await self.client.default_parameter_groups.get( + location="str", + name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations.py new file mode 100644 index 000000000000..294afffc257a --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtEndpointsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_endpoints_get(self, resource_group): + response = self.client.endpoints.get( + resource_group_name=resource_group.name, + cluster_name="str", + endpoint_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_endpoints_list(self, resource_group): + response = self.client.endpoints.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations_async.py new file mode 100644 index 000000000000..4270d9a265b5 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_endpoints_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtEndpointsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_endpoints_get(self, resource_group): + response = await self.client.endpoints.get( + resource_group_name=resource_group.name, + cluster_name="str", + endpoint_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_endpoints_list(self, resource_group): + response = self.client.endpoints.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_firewall_rules_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_firewall_rules_operations.py similarity index 82% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_firewall_rules_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_firewall_rules_operations.py index 128942183b5a..523e967af03d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_firewall_rules_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_firewall_rules_operations.py @@ -14,14 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbFirewallRulesOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtFirewallRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_firewall_rules_get(self, resource_group): - response = self.client.horizon_db_firewall_rules.get( + def test_firewall_rules_get(self, resource_group): + response = self.client.firewall_rules.get( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", @@ -33,8 +33,8 @@ def test_horizon_db_firewall_rules_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_firewall_rules_list(self, resource_group): - response = self.client.horizon_db_firewall_rules.list( + def test_firewall_rules_list(self, resource_group): + response = self.client.firewall_rules.list( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", @@ -45,8 +45,8 @@ def test_horizon_db_firewall_rules_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_firewall_rules_begin_create_or_update(self, resource_group): - response = self.client.horizon_db_firewall_rules.begin_create_or_update( + def test_firewall_rules_begin_create_or_replace(self, resource_group): + response = self.client.firewall_rules.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", @@ -77,8 +77,8 @@ def test_horizon_db_firewall_rules_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_firewall_rules_begin_delete(self, resource_group): - response = self.client.horizon_db_firewall_rules.begin_delete( + def test_firewall_rules_begin_delete(self, resource_group): + response = self.client.firewall_rules.begin_delete( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_firewall_rules_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_firewall_rules_operations_async.py similarity index 83% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_firewall_rules_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_firewall_rules_operations_async.py index 8d83df26e2de..22d099545c28 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_firewall_rules_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_firewall_rules_operations_async.py @@ -15,14 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbFirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtFirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_firewall_rules_get(self, resource_group): - response = await self.client.horizon_db_firewall_rules.get( + async def test_firewall_rules_get(self, resource_group): + response = await self.client.firewall_rules.get( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", @@ -34,8 +34,8 @@ async def test_horizon_db_firewall_rules_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_firewall_rules_list(self, resource_group): - response = self.client.horizon_db_firewall_rules.list( + async def test_firewall_rules_list(self, resource_group): + response = self.client.firewall_rules.list( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", @@ -46,9 +46,9 @@ async def test_horizon_db_firewall_rules_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_firewall_rules_begin_create_or_update(self, resource_group): + async def test_firewall_rules_begin_create_or_replace(self, resource_group): response = await ( - await self.client.horizon_db_firewall_rules.begin_create_or_update( + await self.client.firewall_rules.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", @@ -80,9 +80,9 @@ async def test_horizon_db_firewall_rules_begin_create_or_update(self, resource_g @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_firewall_rules_begin_delete(self, resource_group): + async def test_firewall_rules_begin_delete(self, resource_group): response = await ( - await self.client.horizon_db_firewall_rules.begin_delete( + await self.client.firewall_rules.begin_delete( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations.py new file mode 100644 index 000000000000..8bb7472d55fb --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtIdentityAssignmentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_identity_assignments_get(self, resource_group): + response = self.client.identity_assignments.get( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + assignment_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_identity_assignments_begin_create_or_replace(self, resource_group): + response = self.client.identity_assignments.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + assignment_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": { + "activationState": "str", + "effectiveState": "str", + "identityResourceId": "str", + "principalId": "str", + "status": {"code": "str", "message": "str"}, + "tenantId": "str", + "validation": { + "state": "str", + "error": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "validatedAtUtc": "2020-02-20 00:00:00", + }, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_identity_assignments_begin_delete(self, resource_group): + response = self.client.identity_assignments.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + assignment_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_identity_assignments_list(self, resource_group): + response = self.client.identity_assignments.list( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations_async.py new file mode 100644 index 000000000000..69b4f4299efb --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_identity_assignments_operations_async.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtIdentityAssignmentsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_identity_assignments_get(self, resource_group): + response = await self.client.identity_assignments.get( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + assignment_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_identity_assignments_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.identity_assignments.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + assignment_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": { + "activationState": "str", + "effectiveState": "str", + "identityResourceId": "str", + "principalId": "str", + "status": {"code": "str", "message": "str"}, + "tenantId": "str", + "validation": { + "state": "str", + "error": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "validatedAtUtc": "2020-02-20 00:00:00", + }, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_identity_assignments_begin_delete(self, resource_group): + response = await ( + await self.client.identity_assignments.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + assignment_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_identity_assignments_list(self, resource_group): + response = self.client.identity_assignments.list( + resource_group_name=resource_group.name, + cluster_name="str", + destination_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations.py new file mode 100644 index 000000000000..2260421e24f7 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtLogCaptureConfigurationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_log_capture_configurations_get(self, resource_group): + response = self.client.log_capture_configurations.get( + resource_group_name=resource_group.name, + cluster_name="str", + log_capture_configuration_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_log_capture_configurations_begin_update(self, resource_group): + response = self.client.log_capture_configurations.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + log_capture_configuration_name="str", + properties={"properties": {"retentionDays": 0, "state": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_log_capture_configurations_list(self, resource_group): + response = self.client.log_capture_configurations.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations_async.py new file mode 100644 index 000000000000..910b2c92d7e0 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_capture_configurations_operations_async.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtLogCaptureConfigurationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_log_capture_configurations_get(self, resource_group): + response = await self.client.log_capture_configurations.get( + resource_group_name=resource_group.name, + cluster_name="str", + log_capture_configuration_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_log_capture_configurations_begin_update(self, resource_group): + response = await ( + await self.client.log_capture_configurations.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + log_capture_configuration_name="str", + properties={"properties": {"retentionDays": 0, "state": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_log_capture_configurations_list(self, resource_group): + response = self.client.log_capture_configurations.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations.py new file mode 100644 index 000000000000..9fb6f236560e --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtLogFilesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_log_files_get(self, resource_group): + response = self.client.log_files.get( + resource_group_name=resource_group.name, + cluster_name="str", + log_file_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_log_files_list(self, resource_group): + response = self.client.log_files.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_log_files_list_download_urls(self, resource_group): + response = self.client.log_files.list_download_urls( + resource_group_name=resource_group.name, + cluster_name="str", + log_file_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations_async.py new file mode 100644 index 000000000000..07204563e5bf --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_log_files_operations_async.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtLogFilesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_log_files_get(self, resource_group): + response = await self.client.log_files.get( + resource_group_name=resource_group.name, + cluster_name="str", + log_file_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_log_files_list(self, resource_group): + response = self.client.log_files.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_log_files_list_download_urls(self, resource_group): + response = await self.client.log_files.list_download_urls( + resource_group_name=resource_group.name, + cluster_name="str", + log_file_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations.py new file mode 100644 index 000000000000..f6b136988af4 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtMaintenanceEventsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_get(self, resource_group): + response = self.client.maintenance_events.get( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + maintenance_event_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_list(self, resource_group): + response = self.client.maintenance_events.list( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_begin_reschedule(self, resource_group): + response = self.client.maintenance_events.begin_reschedule( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + maintenance_event_id="str", + body={"postponeToDateTimeUtc": "2020-02-20 00:00:00"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_begin_apply_now(self, resource_group): + response = self.client.maintenance_events.begin_apply_now( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + maintenance_event_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations_async.py new file mode 100644 index 000000000000..7972feb4d88b --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_maintenance_events_operations_async.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtMaintenanceEventsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_get(self, resource_group): + response = await self.client.maintenance_events.get( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + maintenance_event_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_list(self, resource_group): + response = self.client.maintenance_events.list( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_begin_reschedule(self, resource_group): + response = await ( + await self.client.maintenance_events.begin_reschedule( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + maintenance_event_id="str", + body={"postponeToDateTimeUtc": "2020-02-20 00:00:00"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_begin_apply_now(self, resource_group): + response = await ( + await self.client.maintenance_events.begin_apply_now( + resource_group_name=resource_group.name, + cluster_name="str", + pool_name="str", + maintenance_event_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_administrators_operations.py similarity index 76% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_administrators_operations.py index d715fb907bd5..78054707eaf4 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_administrators_operations.py @@ -14,14 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbAdministratorsOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtMicrosoftEntraAdministratorsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_administrators_get(self, resource_group): - response = self.client.horizon_db_administrators.get( + def test_microsoft_entra_administrators_get(self, resource_group): + response = self.client.microsoft_entra_administrators.get( resource_group_name=resource_group.name, cluster_name="str", object_id="str", @@ -32,8 +32,8 @@ def test_horizon_db_administrators_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_administrators_begin_create_or_update(self, resource_group): - response = self.client.horizon_db_administrators.begin_create_or_update( + def test_microsoft_entra_administrators_begin_create_or_replace(self, resource_group): + response = self.client.microsoft_entra_administrators.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", object_id="str", @@ -45,8 +45,8 @@ def test_horizon_db_administrators_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_administrators_begin_delete(self, resource_group): - response = self.client.horizon_db_administrators.begin_delete( + def test_microsoft_entra_administrators_begin_delete(self, resource_group): + response = self.client.microsoft_entra_administrators.begin_delete( resource_group_name=resource_group.name, cluster_name="str", object_id="str", @@ -57,8 +57,8 @@ def test_horizon_db_administrators_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_administrators_list(self, resource_group): - response = self.client.horizon_db_administrators.list( + def test_microsoft_entra_administrators_list(self, resource_group): + response = self.client.microsoft_entra_administrators.list( resource_group_name=resource_group.name, cluster_name="str", ) diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_administrators_operations_async.py similarity index 76% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_administrators_operations_async.py index ef79dd286594..bfe3f775e186 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_administrators_operations_async.py @@ -15,14 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtMicrosoftEntraAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_administrators_get(self, resource_group): - response = await self.client.horizon_db_administrators.get( + async def test_microsoft_entra_administrators_get(self, resource_group): + response = await self.client.microsoft_entra_administrators.get( resource_group_name=resource_group.name, cluster_name="str", object_id="str", @@ -33,9 +33,9 @@ async def test_horizon_db_administrators_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_administrators_begin_create_or_update(self, resource_group): + async def test_microsoft_entra_administrators_begin_create_or_replace(self, resource_group): response = await ( - await self.client.horizon_db_administrators.begin_create_or_update( + await self.client.microsoft_entra_administrators.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", object_id="str", @@ -48,9 +48,9 @@ async def test_horizon_db_administrators_begin_create_or_update(self, resource_g @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_administrators_begin_delete(self, resource_group): + async def test_microsoft_entra_administrators_begin_delete(self, resource_group): response = await ( - await self.client.horizon_db_administrators.begin_delete( + await self.client.microsoft_entra_administrators.begin_delete( resource_group_name=resource_group.name, cluster_name="str", object_id="str", @@ -62,8 +62,8 @@ async def test_horizon_db_administrators_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_administrators_list(self, resource_group): - response = self.client.horizon_db_administrators.list( + async def test_microsoft_entra_administrators_list(self, resource_group): + response = self.client.microsoft_entra_administrators.list( resource_group_name=resource_group.name, cluster_name="str", ) diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations.py new file mode 100644 index 000000000000..777836c3d9b0 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtMicrosoftEntraAuthenticationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_microsoft_entra_authentications_get(self, resource_group): + response = self.client.microsoft_entra_authentications.get( + resource_group_name=resource_group.name, + cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_microsoft_entra_authentications_begin_create_or_replace(self, resource_group): + response = self.client.microsoft_entra_authentications.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + resource={ + "id": "str", + "name": "str", + "properties": {"state": "str", "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_microsoft_entra_authentications_begin_update(self, resource_group): + response = self.client.microsoft_entra_authentications.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + properties={"properties": {"state": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations_async.py new file mode 100644 index 000000000000..6e2c5026e083 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_microsoft_entra_authentications_operations_async.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtMicrosoftEntraAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_microsoft_entra_authentications_get(self, resource_group): + response = await self.client.microsoft_entra_authentications.get( + resource_group_name=resource_group.name, + cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_microsoft_entra_authentications_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.microsoft_entra_authentications.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + resource={ + "id": "str", + "name": "str", + "properties": {"state": "str", "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_microsoft_entra_authentications_begin_update(self, resource_group): + response = await ( + await self.client.microsoft_entra_authentications.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + properties={"properties": {"state": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_pools_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_nodes_operations.py similarity index 82% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_pools_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_nodes_operations.py index 93e1e009e725..28523cf060a6 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_pools_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_nodes_operations.py @@ -14,17 +14,18 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbPoolsOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtNodesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_pools_get(self, resource_group): - response = self.client.horizon_db_pools.get( + def test_nodes_get(self, resource_group): + response = self.client.nodes.get( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", + node_name="str", ) # please add some check logic here by yourself @@ -32,10 +33,11 @@ def test_horizon_db_pools_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_pools_list(self, resource_group): - response = self.client.horizon_db_pools.list( + def test_nodes_list(self, resource_group): + response = self.client.nodes.list( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_pools_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_nodes_operations_async.py similarity index 82% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_pools_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_nodes_operations_async.py index c4923d1ad72f..ac5be11a84c3 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_pools_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_nodes_operations_async.py @@ -15,17 +15,18 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbPoolsOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtNodesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_pools_get(self, resource_group): - response = await self.client.horizon_db_pools.get( + async def test_nodes_get(self, resource_group): + response = await self.client.nodes.get( resource_group_name=resource_group.name, cluster_name="str", pool_name="str", + node_name="str", ) # please add some check logic here by yourself @@ -33,10 +34,11 @@ async def test_horizon_db_pools_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_pools_list(self, resource_group): - response = self.client.horizon_db_pools.list( + async def test_nodes_list(self, resource_group): + response = self.client.nodes.list( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_parameter_groups_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_parameter_groups_operations.py similarity index 73% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_parameter_groups_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_parameter_groups_operations.py index 9137d7a56840..fd7462a80cb0 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_parameter_groups_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_parameter_groups_operations.py @@ -14,14 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbParameterGroupsOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtParameterGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_get(self, resource_group): - response = self.client.horizon_db_parameter_groups.get( + def test_parameter_groups_get(self, resource_group): + response = self.client.parameter_groups.get( resource_group_name=resource_group.name, parameter_group_name="str", ) @@ -31,8 +31,8 @@ def test_horizon_db_parameter_groups_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_begin_create_or_update(self, resource_group): - response = self.client.horizon_db_parameter_groups.begin_create_or_update( + def test_parameter_groups_begin_create_or_replace(self, resource_group): + response = self.client.parameter_groups.begin_create_or_replace( resource_group_name=resource_group.name, parameter_group_name="str", resource={ @@ -40,12 +40,13 @@ def test_horizon_db_parameter_groups_begin_create_or_update(self, resource_group "id": "str", "name": "str", "properties": { - "applyImmediately": bool, + "postgreSqlVersion": "str", "description": "str", "parameters": [ { "allowedValues": "str", "dataType": "str", + "defaultValue": "str", "description": "str", "documentationLink": "str", "isDynamic": bool, @@ -53,11 +54,10 @@ def test_horizon_db_parameter_groups_begin_create_or_update(self, resource_group "name": "str", "unit": "str", "value": "str", + "valueSource": "str", } ], - "pgVersion": 0, "provisioningState": "str", - "version": 0, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -77,18 +77,18 @@ def test_horizon_db_parameter_groups_begin_create_or_update(self, resource_group @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_begin_update(self, resource_group): - response = self.client.horizon_db_parameter_groups.begin_update( + def test_parameter_groups_begin_update(self, resource_group): + response = self.client.parameter_groups.begin_update( resource_group_name=resource_group.name, parameter_group_name="str", properties={ "properties": { - "applyImmediately": bool, "description": "str", "parameters": [ { "allowedValues": "str", "dataType": "str", + "defaultValue": "str", "description": "str", "documentationLink": "str", "isDynamic": bool, @@ -96,6 +96,7 @@ def test_horizon_db_parameter_groups_begin_update(self, resource_group): "name": "str", "unit": "str", "value": "str", + "valueSource": "str", } ], }, @@ -108,8 +109,8 @@ def test_horizon_db_parameter_groups_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_begin_delete(self, resource_group): - response = self.client.horizon_db_parameter_groups.begin_delete( + def test_parameter_groups_begin_delete(self, resource_group): + response = self.client.parameter_groups.begin_delete( resource_group_name=resource_group.name, parameter_group_name="str", ).result() # call '.result()' to poll until service return final result @@ -119,8 +120,8 @@ def test_horizon_db_parameter_groups_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_list_by_resource_group(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_by_resource_group( + def test_parameter_groups_list_by_resource_group(self, resource_group): + response = self.client.parameter_groups.list_by_resource_group( resource_group_name=resource_group.name, ) result = [r for r in response] @@ -129,27 +130,16 @@ def test_horizon_db_parameter_groups_list_by_resource_group(self, resource_group @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_list_by_subscription(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_by_subscription() + def test_parameter_groups_list_by_subscription(self, resource_group): + response = self.client.parameter_groups.list_by_subscription() result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_parameter_groups_list_connections(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_connections( - resource_group_name=resource_group.name, - parameter_group_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_horizon_db_parameter_groups_list_versions(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_versions( + def test_parameter_groups_list_connections(self, resource_group): + response = self.client.parameter_groups.list_connections( resource_group_name=resource_group.name, parameter_group_name="str", ) diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_parameter_groups_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_parameter_groups_operations_async.py similarity index 74% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_parameter_groups_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_parameter_groups_operations_async.py index 606c843b7da4..82b978161365 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_parameter_groups_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_parameter_groups_operations_async.py @@ -15,14 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbParameterGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtParameterGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_get(self, resource_group): - response = await self.client.horizon_db_parameter_groups.get( + async def test_parameter_groups_get(self, resource_group): + response = await self.client.parameter_groups.get( resource_group_name=resource_group.name, parameter_group_name="str", ) @@ -32,9 +32,9 @@ async def test_horizon_db_parameter_groups_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_begin_create_or_update(self, resource_group): + async def test_parameter_groups_begin_create_or_replace(self, resource_group): response = await ( - await self.client.horizon_db_parameter_groups.begin_create_or_update( + await self.client.parameter_groups.begin_create_or_replace( resource_group_name=resource_group.name, parameter_group_name="str", resource={ @@ -42,12 +42,13 @@ async def test_horizon_db_parameter_groups_begin_create_or_update(self, resource "id": "str", "name": "str", "properties": { - "applyImmediately": bool, + "postgreSqlVersion": "str", "description": "str", "parameters": [ { "allowedValues": "str", "dataType": "str", + "defaultValue": "str", "description": "str", "documentationLink": "str", "isDynamic": bool, @@ -55,11 +56,10 @@ async def test_horizon_db_parameter_groups_begin_create_or_update(self, resource "name": "str", "unit": "str", "value": "str", + "valueSource": "str", } ], - "pgVersion": 0, "provisioningState": "str", - "version": 0, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -80,19 +80,19 @@ async def test_horizon_db_parameter_groups_begin_create_or_update(self, resource @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_begin_update(self, resource_group): + async def test_parameter_groups_begin_update(self, resource_group): response = await ( - await self.client.horizon_db_parameter_groups.begin_update( + await self.client.parameter_groups.begin_update( resource_group_name=resource_group.name, parameter_group_name="str", properties={ "properties": { - "applyImmediately": bool, "description": "str", "parameters": [ { "allowedValues": "str", "dataType": "str", + "defaultValue": "str", "description": "str", "documentationLink": "str", "isDynamic": bool, @@ -100,6 +100,7 @@ async def test_horizon_db_parameter_groups_begin_update(self, resource_group): "name": "str", "unit": "str", "value": "str", + "valueSource": "str", } ], }, @@ -113,9 +114,9 @@ async def test_horizon_db_parameter_groups_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_begin_delete(self, resource_group): + async def test_parameter_groups_begin_delete(self, resource_group): response = await ( - await self.client.horizon_db_parameter_groups.begin_delete( + await self.client.parameter_groups.begin_delete( resource_group_name=resource_group.name, parameter_group_name="str", ) @@ -126,8 +127,8 @@ async def test_horizon_db_parameter_groups_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_list_by_resource_group(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_by_resource_group( + async def test_parameter_groups_list_by_resource_group(self, resource_group): + response = self.client.parameter_groups.list_by_resource_group( resource_group_name=resource_group.name, ) result = [r async for r in response] @@ -136,27 +137,16 @@ async def test_horizon_db_parameter_groups_list_by_resource_group(self, resource @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_list_by_subscription(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_by_subscription() + async def test_parameter_groups_list_by_subscription(self, resource_group): + response = self.client.parameter_groups.list_by_subscription() result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_list_connections(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_connections( - resource_group_name=resource_group.name, - parameter_group_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_horizon_db_parameter_groups_list_versions(self, resource_group): - response = self.client.horizon_db_parameter_groups.list_versions( + async def test_parameter_groups_list_connections(self, resource_group): + response = self.client.parameter_groups.list_connections( resource_group_name=resource_group.name, parameter_group_name="str", ) diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations.py new file mode 100644 index 000000000000..a74254e32c7c --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtPasswordAuthenticationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_password_authentications_get(self, resource_group): + response = self.client.password_authentications.get( + resource_group_name=resource_group.name, + cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_password_authentications_begin_create_or_replace(self, resource_group): + response = self.client.password_authentications.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "state": "str", + "administratorLogin": "str", + "administratorLoginPassword": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_password_authentications_begin_update(self, resource_group): + response = self.client.password_authentications.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + properties={"properties": {"administratorLoginPassword": "str", "state": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations_async.py new file mode 100644 index 000000000000..407a9af0974e --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_password_authentications_operations_async.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtPasswordAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_password_authentications_get(self, resource_group): + response = await self.client.password_authentications.get( + resource_group_name=resource_group.name, + cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_password_authentications_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.password_authentications.begin_create_or_replace( + resource_group_name=resource_group.name, + cluster_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "state": "str", + "administratorLogin": "str", + "administratorLoginPassword": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_password_authentications_begin_update(self, resource_group): + response = await ( + await self.client.password_authentications.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + properties={"properties": {"administratorLoginPassword": "str", "state": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_pools_operations.py similarity index 52% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_pools_operations.py index 27d08a587f33..0251457bfe56 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_pools_operations.py @@ -14,16 +14,17 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbClustersOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtPoolsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_get(self, resource_group): - response = self.client.horizon_db_clusters.get( + def test_pools_get(self, resource_group): + response = self.client.pools.get( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) # please add some check logic here by yourself @@ -31,41 +32,22 @@ def test_horizon_db_clusters_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_begin_create_or_update(self, resource_group): - response = self.client.horizon_db_clusters.begin_create_or_update( + def test_pools_begin_create_or_replace(self, resource_group): + response = self.client.pools.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", resource={ - "location": "str", "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "name": "str", "properties": { - "administratorLogin": "str", - "administratorLoginPassword": "str", - "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, - "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, - "createMode": "str", - "fullyQualifiedDomainName": "str", - "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, - "network": {"publicNetworkAccess": "str"}, - "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, - "pointInTimeUTC": "2020-02-20 00:00:00", - "poolName": "str", - "processorType": "str", + "computeModel": {"computeGeneration": 0, "computeProcessor": "str", "type": "str", "vCores": 0}, + "highAvailability": {"mode": "str"}, + "nodeCount": 0, + "parameterGroup": {"applyMethod": "str", "parameterGroupResourceId": "str", "syncStatus": "str"}, "provisioningState": "str", - "readonlyEndpoint": "str", - "replicaCount": 0, - "sourceClusterResourceId": "str", + "scheduledMaintenance": "scheduled_maintenance_properties", "state": "str", - "vCores": 0, - "version": "str", - "zonePlacementPolicy": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -85,24 +67,18 @@ def test_horizon_db_clusters_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_begin_update(self, resource_group): - response = self.client.horizon_db_clusters.begin_update( + def test_pools_begin_update(self, resource_group): + response = self.client.pools.begin_update( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", properties={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "properties": { - "administratorLoginPassword": "str", - "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, - "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, - "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, - "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, - "vCores": 0, + "computeModel": {"computeGeneration": 0, "computeProcessor": "str", "type": "str", "vCores": 0}, + "highAvailability": {"mode": "str"}, + "nodeCount": 0, + "parameterGroup": {"applyMethod": "str", "parameterGroupResourceId": "str"}, + "scheduledMaintenance": {"maintenanceManagementType": "str"}, }, "tags": {"str": "str"}, }, @@ -113,10 +89,11 @@ def test_horizon_db_clusters_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_begin_delete(self, resource_group): - response = self.client.horizon_db_clusters.begin_delete( + def test_pools_begin_delete(self, resource_group): + response = self.client.pools.begin_delete( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,9 +101,10 @@ def test_horizon_db_clusters_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_list_by_resource_group(self, resource_group): - response = self.client.horizon_db_clusters.list_by_resource_group( + def test_pools_list(self, resource_group): + response = self.client.pools.list( resource_group_name=resource_group.name, + cluster_name="str", ) result = [r for r in response] # please add some check logic here by yourself @@ -134,18 +112,11 @@ def test_horizon_db_clusters_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_list_by_subscription(self, resource_group): - response = self.client.horizon_db_clusters.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_horizon_db_clusters_begin_start(self, resource_group): - response = self.client.horizon_db_clusters.begin_start( + def test_pools_begin_start(self, resource_group): + response = self.client.pools.begin_start( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -153,10 +124,11 @@ def test_horizon_db_clusters_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_begin_stop(self, resource_group): - response = self.client.horizon_db_clusters.begin_stop( + def test_pools_begin_stop(self, resource_group): + response = self.client.pools.begin_stop( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -164,10 +136,11 @@ def test_horizon_db_clusters_begin_stop(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_clusters_begin_restart(self, resource_group): - response = self.client.horizon_db_clusters.begin_restart( + def test_pools_begin_restart(self, resource_group): + response = self.client.pools.begin_restart( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_pools_operations_async.py similarity index 54% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_pools_operations_async.py index d12cd2a60160..6aa11bf7bd87 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_pools_operations_async.py @@ -15,16 +15,17 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbClustersOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtPoolsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_get(self, resource_group): - response = await self.client.horizon_db_clusters.get( + async def test_pools_get(self, resource_group): + response = await self.client.pools.get( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) # please add some check logic here by yourself @@ -32,42 +33,27 @@ async def test_horizon_db_clusters_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_begin_create_or_update(self, resource_group): + async def test_pools_begin_create_or_replace(self, resource_group): response = await ( - await self.client.horizon_db_clusters.begin_create_or_update( + await self.client.pools.begin_create_or_replace( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", resource={ - "location": "str", "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "name": "str", "properties": { - "administratorLogin": "str", - "administratorLoginPassword": "str", - "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, - "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, - "createMode": "str", - "fullyQualifiedDomainName": "str", - "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, - "network": {"publicNetworkAccess": "str"}, - "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, - "pointInTimeUTC": "2020-02-20 00:00:00", - "poolName": "str", - "processorType": "str", + "computeModel": {"computeGeneration": 0, "computeProcessor": "str", "type": "str", "vCores": 0}, + "highAvailability": {"mode": "str"}, + "nodeCount": 0, + "parameterGroup": { + "applyMethod": "str", + "parameterGroupResourceId": "str", + "syncStatus": "str", + }, "provisioningState": "str", - "readonlyEndpoint": "str", - "replicaCount": 0, - "sourceClusterResourceId": "str", + "scheduledMaintenance": "scheduled_maintenance_properties", "state": "str", - "vCores": 0, - "version": "str", - "zonePlacementPolicy": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -88,25 +74,19 @@ async def test_horizon_db_clusters_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_begin_update(self, resource_group): + async def test_pools_begin_update(self, resource_group): response = await ( - await self.client.horizon_db_clusters.begin_update( + await self.client.pools.begin_update( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", properties={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "properties": { - "administratorLoginPassword": "str", - "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, - "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, - "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, - "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, - "vCores": 0, + "computeModel": {"computeGeneration": 0, "computeProcessor": "str", "type": "str", "vCores": 0}, + "highAvailability": {"mode": "str"}, + "nodeCount": 0, + "parameterGroup": {"applyMethod": "str", "parameterGroupResourceId": "str"}, + "scheduledMaintenance": {"maintenanceManagementType": "str"}, }, "tags": {"str": "str"}, }, @@ -118,11 +98,12 @@ async def test_horizon_db_clusters_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_begin_delete(self, resource_group): + async def test_pools_begin_delete(self, resource_group): response = await ( - await self.client.horizon_db_clusters.begin_delete( + await self.client.pools.begin_delete( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -131,9 +112,10 @@ async def test_horizon_db_clusters_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_list_by_resource_group(self, resource_group): - response = self.client.horizon_db_clusters.list_by_resource_group( + async def test_pools_list(self, resource_group): + response = self.client.pools.list( resource_group_name=resource_group.name, + cluster_name="str", ) result = [r async for r in response] # please add some check logic here by yourself @@ -141,19 +123,12 @@ async def test_horizon_db_clusters_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_list_by_subscription(self, resource_group): - response = self.client.horizon_db_clusters.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_horizon_db_clusters_begin_start(self, resource_group): + async def test_pools_begin_start(self, resource_group): response = await ( - await self.client.horizon_db_clusters.begin_start( + await self.client.pools.begin_start( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -162,11 +137,12 @@ async def test_horizon_db_clusters_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_begin_stop(self, resource_group): + async def test_pools_begin_stop(self, resource_group): response = await ( - await self.client.horizon_db_clusters.begin_stop( + await self.client.pools.begin_stop( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -175,11 +151,12 @@ async def test_horizon_db_clusters_begin_stop(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_clusters_begin_restart(self, resource_group): + async def test_pools_begin_restart(self, resource_group): response = await ( - await self.client.horizon_db_clusters.begin_restart( + await self.client.pools.begin_restart( resource_group_name=resource_group.name, cluster_name="str", + pool_name="str", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_endpoint_connections_operations.py similarity index 79% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_endpoint_connections_operations.py index 1d94d6e90f14..c946f1b3115a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_endpoint_connections_operations.py @@ -14,14 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbPrivateEndpointConnectionsOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtPrivateEndpointConnectionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_endpoint_connections_get(self, resource_group): - response = self.client.horizon_db_private_endpoint_connections.get( + def test_private_endpoint_connections_get(self, resource_group): + response = self.client.private_endpoint_connections.get( resource_group_name=resource_group.name, cluster_name="str", private_endpoint_connection_name="str", @@ -32,8 +32,8 @@ def test_horizon_db_private_endpoint_connections_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_endpoint_connections_list(self, resource_group): - response = self.client.horizon_db_private_endpoint_connections.list( + def test_private_endpoint_connections_list(self, resource_group): + response = self.client.private_endpoint_connections.list( resource_group_name=resource_group.name, cluster_name="str", ) @@ -43,8 +43,8 @@ def test_horizon_db_private_endpoint_connections_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_endpoint_connections_update_status(self, resource_group): - response = self.client.horizon_db_private_endpoint_connections.update_status( + def test_private_endpoint_connections_begin_approve_or_reject(self, resource_group): + response = self.client.private_endpoint_connections.begin_approve_or_reject( resource_group_name=resource_group.name, cluster_name="str", private_endpoint_connection_name="str", @@ -71,15 +71,15 @@ def test_horizon_db_private_endpoint_connections_update_status(self, resource_gr }, "type": "str", }, - ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_endpoint_connections_begin_delete(self, resource_group): - response = self.client.horizon_db_private_endpoint_connections.begin_delete( + def test_private_endpoint_connections_begin_delete(self, resource_group): + response = self.client.private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, cluster_name="str", private_endpoint_connection_name="str", diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_endpoint_connections_operations_async.py similarity index 52% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_endpoint_connections_operations_async.py index 3147d90fd6cd..bdae43046180 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_endpoint_connections_operations_async.py @@ -15,14 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbPrivateEndpointConnectionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtPrivateEndpointConnectionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_endpoint_connections_get(self, resource_group): - response = await self.client.horizon_db_private_endpoint_connections.get( + async def test_private_endpoint_connections_get(self, resource_group): + response = await self.client.private_endpoint_connections.get( resource_group_name=resource_group.name, cluster_name="str", private_endpoint_connection_name="str", @@ -33,8 +33,8 @@ async def test_horizon_db_private_endpoint_connections_get(self, resource_group) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_endpoint_connections_list(self, resource_group): - response = self.client.horizon_db_private_endpoint_connections.list( + async def test_private_endpoint_connections_list(self, resource_group): + response = self.client.private_endpoint_connections.list( resource_group_name=resource_group.name, cluster_name="str", ) @@ -44,44 +44,46 @@ async def test_horizon_db_private_endpoint_connections_list(self, resource_group @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_endpoint_connections_update_status(self, resource_group): - response = await self.client.horizon_db_private_endpoint_connections.update_status( - resource_group_name=resource_group.name, - cluster_name="str", - private_endpoint_connection_name="str", - resource={ - "id": "str", - "name": "str", - "properties": { - "privateLinkServiceConnectionState": { - "actionsRequired": "str", - "description": "str", - "status": "str", + async def test_private_endpoint_connections_begin_approve_or_reject(self, resource_group): + response = await ( + await self.client.private_endpoint_connections.begin_approve_or_reject( + resource_group_name=resource_group.name, + cluster_name="str", + private_endpoint_connection_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "privateLinkServiceConnectionState": { + "actionsRequired": "str", + "description": "str", + "status": "str", + }, + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "provisioningState": "str", }, - "groupIds": ["str"], - "privateEndpoint": {"id": "str"}, - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", }, - "type": "str", - }, - ) + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_endpoint_connections_begin_delete(self, resource_group): + async def test_private_endpoint_connections_begin_delete(self, resource_group): response = await ( - await self.client.horizon_db_private_endpoint_connections.begin_delete( + await self.client.private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, cluster_name="str", private_endpoint_connection_name="str", diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_link_resources_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_link_resources_operations.py similarity index 78% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_link_resources_operations.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_link_resources_operations.py index b6a5a519b7f4..2a9f35df0311 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_link_resources_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_link_resources_operations.py @@ -14,14 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbPrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtPrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_link_resources_get(self, resource_group): - response = self.client.horizon_db_private_link_resources.get( + def test_private_link_resources_get(self, resource_group): + response = self.client.private_link_resources.get( resource_group_name=resource_group.name, cluster_name="str", group_name="str", @@ -32,8 +32,8 @@ def test_horizon_db_private_link_resources_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_link_resources_list(self, resource_group): - response = self.client.horizon_db_private_link_resources.list( + def test_private_link_resources_list(self, resource_group): + response = self.client.private_link_resources.list( resource_group_name=resource_group.name, cluster_name="str", ) diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_link_resources_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_link_resources_operations_async.py similarity index 78% rename from sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_link_resources_operations_async.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_link_resources_operations_async.py index 83df45d04633..2a9068341a7d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_link_resources_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_private_link_resources_operations_async.py @@ -15,14 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHorizonDBMgmtHorizonDbPrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): +class TestHorizonDBMgmtPrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_link_resources_get(self, resource_group): - response = await self.client.horizon_db_private_link_resources.get( + async def test_private_link_resources_get(self, resource_group): + response = await self.client.private_link_resources.get( resource_group_name=resource_group.name, cluster_name="str", group_name="str", @@ -33,8 +33,8 @@ async def test_horizon_db_private_link_resources_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_link_resources_list(self, resource_group): - response = self.client.horizon_db_private_link_resources.list( + async def test_private_link_resources_list(self, resource_group): + response = self.client.private_link_resources.list( resource_group_name=resource_group.name, cluster_name="str", ) diff --git a/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml b/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml index 99a86da7b095..e206c7aa4882 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml +++ b/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb -commit: f868cf045de6223d605ed9b7bf2a9ce2947c808f +commit: 90e63e5fe2c596e8bd807aad7dd9d62cee1746dd repo: Azure/azure-rest-api-specs additionalDirectories: From bc8454eaadb7c5d80e28c3f1ba8a8c8e70023826 Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 10:34:37 -0700 Subject: [PATCH 05/35] [AutoPR azure-mgmt-maintenance]-generated-from-SDK Generation - Python-6975266 (#49151) * Configurations: 'specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance/tspconfig.yaml', and CommitSHA: 'b306e248a9e097d2b22e80030318c3d0080933dd' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6872605 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md * Configurations: 'specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance/tspconfig.yaml', and CommitSHA: '5397de7dc9ec4150527dbdc14bf46c1f551305b8' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6971856 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md * Configurations: 'specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance/tspconfig.yaml', and CommitSHA: '5397de7dc9ec4150527dbdc14bf46c1f551305b8' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6975266 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md --------- Co-authored-by: azure-sdk Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- .../azure-mgmt-maintenance/CHANGELOG.md | 17 + .../azure-mgmt-maintenance/README.md | 2 +- .../azure-mgmt-maintenance/_metadata.json | 9 +- sdk/maintenance/azure-mgmt-maintenance/api.md | 2189 +++++++++++++++++ .../azure-mgmt-maintenance/api.metadata.yml | 4 + .../apiview-properties.json | 14 +- .../azure/mgmt/maintenance/_client.py | 15 +- .../azure/mgmt/maintenance/_configuration.py | 7 +- .../mgmt/maintenance/_utils/model_base.py | 446 +++- .../mgmt/maintenance/_utils/serialization.py | 138 +- .../azure/mgmt/maintenance/_validation.py | 66 + .../azure/mgmt/maintenance/_version.py | 2 +- .../azure/mgmt/maintenance/aio/_client.py | 15 +- .../mgmt/maintenance/aio/_configuration.py | 7 +- .../maintenance/aio/operations/__init__.py | 4 +- .../maintenance/aio/operations/_operations.py | 387 ++- .../azure/mgmt/maintenance/models/__init__.py | 12 +- .../azure/mgmt/maintenance/models/_models.py | 183 +- .../mgmt/maintenance/operations/__init__.py | 4 +- .../maintenance/operations/_operations.py | 490 +++- .../azure/mgmt/maintenance/types.py | 441 ++++ .../apply_updates_create_or_update.py | 2 +- ...tes_create_or_update_cancel_maintenance.py | 2 +- ...s_create_or_update_only_no_cancellation.py | 2 +- .../apply_updates_create_or_update_parent.py | 2 +- .../generated_samples/apply_updates_get.py | 2 +- .../apply_updates_get_parent.py | 2 +- .../generated_samples/apply_updates_list.py | 2 +- .../apply_updates_resource_group_list.py | 2 +- ...figuration_assignments_create_or_update.py | 2 +- ...ion_assignments_create_or_update_parent.py | 2 +- .../configuration_assignments_delete.py | 2 +- ...configuration_assignments_delete_parent.py | 2 +- ...nts_for_resource_group_create_or_update.py | 2 +- ...n_assignments_for_resource_group_delete.py | 2 +- ...tion_assignments_for_resource_group_get.py | 2 +- ..._for_resource_group_update_for_resource.py | 2 +- ...ents_for_subscriptions_create_or_update.py | 2 +- ...on_assignments_for_subscriptions_delete.py | 2 +- ...ation_assignments_for_subscriptions_get.py | 2 +- ...s_for_subscriptions_update_for_resource.py | 2 +- .../configuration_assignments_get.py | 2 +- .../configuration_assignments_get_parent.py | 2 +- .../configuration_assignments_list.py | 2 +- .../configuration_assignments_list_parent.py | 2 +- ...gnments_result_within_subscription_list.py | 2 +- ...gurations_create_or_update_for_resource.py | 2 +- ...ance_configurations_delete_for_resource.py | 2 +- ...tenance_configurations_get_for_resource.py | 2 +- ...s_get_for_resource_guest_os_patch_linux.py | 2 +- ...get_for_resource_guest_os_patch_windows.py | 2 +- .../maintenance_configurations_list.py | 2 +- ...ance_configurations_resource_group_list.py | 2 +- ...ance_configurations_update_for_resource.py | 2 +- .../generated_samples/operations_list.py | 2 +- ...tenance_configurations_get_for_resource.py | 2 +- .../public_maintenance_configurations_list.py | 2 +- .../scheduled_events_acknowledge.py | 12 +- .../scheduled_events_acknowledge_list.py | 46 + .../generated_samples/updates_list.py | 2 +- .../generated_samples/updates_list_parent.py | 2 +- ...management_scheduled_events_operations.py} | 19 +- ...ment_scheduled_events_operations_async.py} | 19 +- .../azure-mgmt-maintenance/pyproject.toml | 1 + .../azure-mgmt-maintenance/tsp-location.yaml | 2 +- 65 files changed, 4254 insertions(+), 373 deletions(-) create mode 100644 sdk/maintenance/azure-mgmt-maintenance/api.md create mode 100644 sdk/maintenance/azure-mgmt-maintenance/api.metadata.yml create mode 100644 sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_validation.py create mode 100644 sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/types.py create mode 100644 sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge_list.py rename sdk/maintenance/azure-mgmt-maintenance/generated_tests/{test_maintenance_management_scheduled_event_operations.py => test_maintenance_management_scheduled_events_operations.py} (63%) rename sdk/maintenance/azure-mgmt-maintenance/generated_tests/{test_maintenance_management_scheduled_event_operations_async.py => test_maintenance_management_scheduled_events_operations_async.py} (63%) diff --git a/sdk/maintenance/azure-mgmt-maintenance/CHANGELOG.md b/sdk/maintenance/azure-mgmt-maintenance/CHANGELOG.md index ccd63804ec82..ca18a87388b1 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/CHANGELOG.md +++ b/sdk/maintenance/azure-mgmt-maintenance/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 2.2.0b4 (2026-10-19) + +### Features Added + + - Client `MaintenanceManagementClient` added operation group `scheduled_events` + - Added model `ScheduledEventsAcknowledgeErrorDetails` + - Added model `ScheduledEventsApproveResponse` + - Added model `ScheduledEventsIdList` + - Added model `ScheduledEventsListAcknowledgeError` + - Added model `ScheduledEventsListAcknowledgeErrorDetails` + +### Breaking Changes + + - Renamed operation group `ScheduledEventOperations` to `ScheduledEventsOperations` + - Deleted or renamed model `ScheduledEventApproveResponse` + - Deleted or renamed model `ScheduledEventOperations` + ## 2.2.0b3 (2026-05-21) ### Features Added diff --git a/sdk/maintenance/azure-mgmt-maintenance/README.md b/sdk/maintenance/azure-mgmt-maintenance/README.md index c6b4e011e324..ea8b6465e949 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/README.md +++ b/sdk/maintenance/azure-mgmt-maintenance/README.md @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/maintenance/azure-mgmt-maintenance/_metadata.json b/sdk/maintenance/azure-mgmt-maintenance/_metadata.json index 4ce6a02242ca..16839b29b02e 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/_metadata.json +++ b/sdk/maintenance/azure-mgmt-maintenance/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2023-10-01-preview", + "apiVersion": "2025-10-01-preview", "apiVersions": { - "Microsoft.Maintenance": "2023-10-01-preview" + "Microsoft.Maintenance": "2025-10-01-preview" }, - "commit": "f34830624e2040e4777496c73aa7c6fe764f4bfc", + "commit": "5397de7dc9ec4150527dbdc14bf46c1f551305b8", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance", - "emitterVersion": "0.62.1" + "emitterVersion": "0.63.8", + "httpClientPythonVersion": "0.38.0" } \ No newline at end of file diff --git a/sdk/maintenance/azure-mgmt-maintenance/api.md b/sdk/maintenance/azure-mgmt-maintenance/api.md new file mode 100644 index 000000000000..6f3fdeb4da92 --- /dev/null +++ b/sdk/maintenance/azure-mgmt-maintenance/api.md @@ -0,0 +1,2189 @@ +```py +namespace azure.mgmt.maintenance + + class azure.mgmt.maintenance.MaintenanceManagementClient: implements ContextManager + apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations + apply_updates: ApplyUpdatesOperations + configuration_assignments: ConfigurationAssignmentsOperations + configuration_assignments_for_resource_group: ConfigurationAssignmentsForResourceGroupOperations + configuration_assignments_for_subscriptions: ConfigurationAssignmentsForSubscriptionsOperations + configuration_assignments_within_subscription: ConfigurationAssignmentsWithinSubscriptionOperations + maintenance_configurations: MaintenanceConfigurationsOperations + maintenance_configurations_for_resource_group: MaintenanceConfigurationsForResourceGroupOperations + operations: Operations + public_maintenance_configurations: PublicMaintenanceConfigurationsOperations + scheduled_events: ScheduledEventsOperations + updates: UpdatesOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.maintenance.aio + + class azure.mgmt.maintenance.aio.MaintenanceManagementClient: implements AsyncContextManager + apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations + apply_updates: ApplyUpdatesOperations + configuration_assignments: ConfigurationAssignmentsOperations + configuration_assignments_for_resource_group: ConfigurationAssignmentsForResourceGroupOperations + configuration_assignments_for_subscriptions: ConfigurationAssignmentsForSubscriptionsOperations + configuration_assignments_within_subscription: ConfigurationAssignmentsWithinSubscriptionOperations + maintenance_configurations: MaintenanceConfigurationsOperations + maintenance_configurations_for_resource_group: MaintenanceConfigurationsForResourceGroupOperations + operations: Operations + public_maintenance_configurations: PublicMaintenanceConfigurationsOperations + scheduled_events: ScheduledEventsOperations + updates: UpdatesOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.maintenance.aio.operations + + class azure.mgmt.maintenance.aio.operations.ApplyUpdateForResourceGroupOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ApplyUpdate]: ... + + + class azure.mgmt.maintenance.aio.operations.ApplyUpdatesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @overload + async def create_or_update_or_cancel( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + apply_update: ApplyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ApplyUpdate: ... + + @overload + async def create_or_update_or_cancel( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + apply_update: ApplyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ApplyUpdate: ... + + @overload + async def create_or_update_or_cancel( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + apply_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace_async + async def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace_async + async def get_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[ApplyUpdate]: ... + + + class azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsForResourceGroupOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + + class azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsForSubscriptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update( + self, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace_async + async def delete( + self, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace_async + async def get( + self, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def update( + self, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + + class azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + async def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace_async + async def delete_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace_async + async def get_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ConfigurationAssignment]: ... + + @distributed_trace + def list_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ConfigurationAssignment]: ... + + + class azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsWithinSubscriptionOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[ConfigurationAssignment]: ... + + + class azure.mgmt.maintenance.aio.operations.MaintenanceConfigurationsForResourceGroupOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[MaintenanceConfiguration]: ... + + + class azure.mgmt.maintenance.aio.operations.MaintenanceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Optional[MaintenanceConfiguration]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[MaintenanceConfiguration]: ... + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + + class azure.mgmt.maintenance.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.maintenance.aio.operations.PublicMaintenanceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_name: str, + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[MaintenanceConfiguration]: ... + + + class azure.mgmt.maintenance.aio.operations.ScheduledEventsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def acknowledge( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_event_id: str, + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + @overload + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + @overload + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + @overload + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + + class azure.mgmt.maintenance.aio.operations.UpdatesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Update]: ... + + @distributed_trace + def list_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Update]: ... + + +namespace azure.mgmt.maintenance.models + + class azure.mgmt.maintenance.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.maintenance.models.ApplyUpdate(ProxyResource): + id: str + name: str + properties: Optional[ApplyUpdateProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ApplyUpdateProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.maintenance.models.ApplyUpdateProperties(_Model): + last_update_time: Optional[datetime] + resource_id: Optional[str] + status: Optional[Union[str, UpdateStatus]] + + @overload + def __init__( + self, + *, + last_update_time: Optional[datetime] = ..., + resource_id: Optional[str] = ..., + status: Optional[Union[str, UpdateStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ConfigurationAssignment(ProxyResource): + id: str + location: Optional[str] + name: str + properties: Optional[ConfigurationAssignmentProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + location: Optional[str] = ..., + properties: Optional[ConfigurationAssignmentProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.maintenance.models.ConfigurationAssignmentFilterProperties(_Model): + locations: Optional[list[str]] + os_types: Optional[list[str]] + resource_groups: Optional[list[str]] + resource_types: Optional[list[str]] + tag_settings: Optional[TagSettingsProperties] + + @overload + def __init__( + self, + *, + locations: Optional[list[str]] = ..., + os_types: Optional[list[str]] = ..., + resource_groups: Optional[list[str]] = ..., + resource_types: Optional[list[str]] = ..., + tag_settings: Optional[TagSettingsProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ConfigurationAssignmentProperties(_Model): + filter: Optional[ConfigurationAssignmentFilterProperties] + maintenance_configuration_id: Optional[str] + resource_id: Optional[str] + + @overload + def __init__( + self, + *, + filter: Optional[ConfigurationAssignmentFilterProperties] = ..., + maintenance_configuration_id: Optional[str] = ..., + resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.maintenance.models.ErrorDetails(_Model): + code: Optional[str] + message: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ImpactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FREEZE = "Freeze" + NONE = "None" + REDEPLOY = "Redeploy" + RESTART = "Restart" + + + class azure.mgmt.maintenance.models.InputLinuxParameters(_Model): + classifications_to_include: Optional[list[str]] + package_name_masks_to_exclude: Optional[list[str]] + package_name_masks_to_include: Optional[list[str]] + + @overload + def __init__( + self, + *, + classifications_to_include: Optional[list[str]] = ..., + package_name_masks_to_exclude: Optional[list[str]] = ..., + package_name_masks_to_include: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.InputPatchConfiguration(_Model): + linux_parameters: Optional[InputLinuxParameters] + reboot_setting: Optional[Union[str, RebootOptions]] + windows_parameters: Optional[InputWindowsParameters] + + @overload + def __init__( + self, + *, + linux_parameters: Optional[InputLinuxParameters] = ..., + reboot_setting: Optional[Union[str, RebootOptions]] = ..., + windows_parameters: Optional[InputWindowsParameters] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.InputWindowsParameters(_Model): + classifications_to_include: Optional[list[str]] + exclude_kbs_requiring_reboot: Optional[bool] + kb_numbers_to_exclude: Optional[list[str]] + kb_numbers_to_include: Optional[list[str]] + + @overload + def __init__( + self, + *, + classifications_to_include: Optional[list[str]] = ..., + exclude_kbs_requiring_reboot: Optional[bool] = ..., + kb_numbers_to_exclude: Optional[list[str]] = ..., + kb_numbers_to_include: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.MaintenanceConfiguration(ProxyResource): + id: str + location: Optional[str] + name: str + properties: Optional[MaintenanceConfigurationProperties] + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: Optional[str] = ..., + properties: Optional[MaintenanceConfigurationProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.MaintenanceConfigurationProperties(_Model): + extension_properties: Optional[dict[str, str]] + install_patches: Optional[InputPatchConfiguration] + maintenance_scope: Optional[Union[str, MaintenanceScope]] + maintenance_window: Optional[MaintenanceWindow] + namespace: Optional[str] + visibility: Optional[Union[str, Visibility]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + extension_properties: Optional[dict[str, str]] = ..., + install_patches: Optional[InputPatchConfiguration] = ..., + maintenance_scope: Optional[Union[str, MaintenanceScope]] = ..., + maintenance_window: Optional[MaintenanceWindow] = ..., + namespace: Optional[str] = ..., + visibility: Optional[Union[str, Visibility]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.maintenance.models.MaintenanceError(_Model): + error: Optional[ErrorDetails] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.MaintenanceScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTENSION = "Extension" + HOST = "Host" + IN_GUEST_PATCH = "InGuestPatch" + OS_IMAGE = "OSImage" + RESOURCE = "Resource" + SQLDB = "SQLDB" + SQL_MANAGED_INSTANCE = "SQLManagedInstance" + + + class azure.mgmt.maintenance.models.MaintenanceWindow(_Model): + duration: Optional[str] + expiration_date_time: Optional[str] + recur_every: Optional[str] + start_date_time: Optional[str] + time_zone: Optional[str] + + @overload + def __init__( + self, + *, + duration: Optional[str] = ..., + expiration_date_time: Optional[str] = ..., + recur_every: Optional[str] = ..., + start_date_time: Optional[str] = ..., + time_zone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationInfo] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationInfo] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.OperationInfo(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.maintenance.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.maintenance.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.maintenance.models.RebootOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALWAYS = "Always" + IF_REQUIRED = "IfRequired" + NEVER = "Never" + + + class azure.mgmt.maintenance.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.maintenance.models.ScheduledEventsAcknowledgeErrorDetails(_Model): + code: Optional[str] + message: Optional[str] + target: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ..., + target: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ScheduledEventsApproveResponse(_Model): + value: Optional[str] + + @overload + def __init__( + self, + *, + value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ScheduledEventsIdList(_Model): + value: list[str] + + @overload + def __init__( + self, + *, + value: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ScheduledEventsListAcknowledgeError(_Model): + error: Optional[ScheduledEventsListAcknowledgeErrorDetails] + + @overload + def __init__( + self, + *, + error: Optional[ScheduledEventsListAcknowledgeErrorDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.ScheduledEventsListAcknowledgeErrorDetails(_Model): + code: Optional[str] + details: Optional[list[ScheduledEventsAcknowledgeErrorDetails]] + message: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + details: Optional[list[ScheduledEventsAcknowledgeErrorDetails]] = ..., + message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.TagOperators(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALL = "All" + ANY = "Any" + + + class azure.mgmt.maintenance.models.TagSettingsProperties(_Model): + filter_operator: Optional[Union[str, TagOperators]] + tags: Optional[dict[str, list[str]]] + + @overload + def __init__( + self, + *, + filter_operator: Optional[Union[str, TagOperators]] = ..., + tags: Optional[dict[str, list[str]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.Update(_Model): + impact_duration_in_sec: Optional[int] + impact_type: Optional[Union[str, ImpactType]] + maintenance_scope: Optional[Union[str, MaintenanceScope]] + not_before: Optional[datetime] + properties: Optional[UpdateProperties] + status: Optional[Union[str, UpdateStatus]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + impact_duration_in_sec: Optional[int] = ..., + impact_type: Optional[Union[str, ImpactType]] = ..., + maintenance_scope: Optional[Union[str, MaintenanceScope]] = ..., + not_before: Optional[datetime] = ..., + properties: Optional[UpdateProperties] = ..., + status: Optional[Union[str, UpdateStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.maintenance.models.UpdateProperties(_Model): + resource_id: Optional[str] + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.maintenance.models.UpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCEL = "Cancel" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + IN_PROGRESS = "InProgress" + NO_UPDATES_PENDING = "NoUpdatesPending" + PENDING = "Pending" + RETRY_LATER = "RetryLater" + RETRY_NOW = "RetryNow" + + + class azure.mgmt.maintenance.models.Visibility(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "Custom" + PUBLIC = "Public" + + +namespace azure.mgmt.maintenance.operations + + class azure.mgmt.maintenance.operations.ApplyUpdateForResourceGroupOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[ApplyUpdate]: ... + + + class azure.mgmt.maintenance.operations.ApplyUpdatesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @overload + def create_or_update_or_cancel( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + apply_update: ApplyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ApplyUpdate: ... + + @overload + def create_or_update_or_cancel( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + apply_update: ApplyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ApplyUpdate: ... + + @overload + def create_or_update_or_cancel( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + apply_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace + def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace + def get_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + apply_update_name: str, + **kwargs: Any + ) -> ApplyUpdate: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[ApplyUpdate]: ... + + + class azure.mgmt.maintenance.operations.ConfigurationAssignmentsForResourceGroupOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def update( + self, + resource_group_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + + class azure.mgmt.maintenance.operations.ConfigurationAssignmentsForSubscriptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update( + self, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace + def delete( + self, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace + def get( + self, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def update( + self, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def update( + self, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + + class azure.mgmt.maintenance.operations.ConfigurationAssignmentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: ConfigurationAssignment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @overload + def create_or_update_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + configuration_assignment: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace + def delete_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> Optional[ConfigurationAssignment]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace + def get_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + configuration_assignment_name: str, + **kwargs: Any + ) -> ConfigurationAssignment: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ItemPaged[ConfigurationAssignment]: ... + + @distributed_trace + def list_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ItemPaged[ConfigurationAssignment]: ... + + + class azure.mgmt.maintenance.operations.ConfigurationAssignmentsWithinSubscriptionOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[ConfigurationAssignment]: ... + + + class azure.mgmt.maintenance.operations.MaintenanceConfigurationsForResourceGroupOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[MaintenanceConfiguration]: ... + + + class azure.mgmt.maintenance.operations.MaintenanceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Optional[MaintenanceConfiguration]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[MaintenanceConfiguration]: ... + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + configuration: MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + + class azure.mgmt.maintenance.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.maintenance.operations.PublicMaintenanceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_name: str, + **kwargs: Any + ) -> MaintenanceConfiguration: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[MaintenanceConfiguration]: ... + + + class azure.mgmt.maintenance.operations.ScheduledEventsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def acknowledge( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_event_id: str, + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + @overload + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + @overload + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + @overload + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ScheduledEventsApproveResponse: ... + + + class azure.mgmt.maintenance.operations.UpdatesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + provider_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ItemPaged[Update]: ... + + @distributed_trace + def list_parent( + self, + resource_group_name: str, + provider_name: str, + resource_parent_type: str, + resource_parent_name: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> ItemPaged[Update]: ... + + +namespace azure.mgmt.maintenance.types + + class azure.mgmt.maintenance.types.ApplyUpdate(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('ApplyUpdateProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ApplyUpdateProperties + systemData: SystemData + type: str + + + class azure.mgmt.maintenance.types.ApplyUpdateProperties(TypedDict, total=False): + key "lastUpdateTime": str + key "resourceId": str + key "status": Union[str, UpdateStatus] + lastUpdateTime: str + resourceId: str + status: Union[str, UpdateStatus] + + + class azure.mgmt.maintenance.types.ConfigurationAssignment(ProxyResource): + key "id": str + key "location": str + key "name": str + key "properties": ForwardRef('ConfigurationAssignmentProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: ConfigurationAssignmentProperties + systemData: SystemData + type: str + + + class azure.mgmt.maintenance.types.ConfigurationAssignmentFilterProperties(TypedDict, total=False): + key "tagSettings": ForwardRef('TagSettingsProperties', module='types') + locations: list[str] + osTypes: list[str] + resourceGroups: list[str] + resourceTypes: list[str] + tagSettings: TagSettingsProperties + + + class azure.mgmt.maintenance.types.ConfigurationAssignmentProperties(TypedDict, total=False): + key "filter": ForwardRef('ConfigurationAssignmentFilterProperties', module='types') + key "maintenanceConfigurationId": str + key "resourceId": str + filter: ConfigurationAssignmentFilterProperties + maintenanceConfigurationId: str + resourceId: str + + + class azure.mgmt.maintenance.types.InputLinuxParameters(TypedDict, total=False): + classificationsToInclude: list[str] + packageNameMasksToExclude: list[str] + packageNameMasksToInclude: list[str] + + + class azure.mgmt.maintenance.types.InputPatchConfiguration(TypedDict, total=False): + key "linuxParameters": ForwardRef('InputLinuxParameters', module='types') + key "rebootSetting": Union[str, RebootOptions] + key "windowsParameters": ForwardRef('InputWindowsParameters', module='types') + linuxParameters: InputLinuxParameters + rebootSetting: Union[str, RebootOptions] + windowsParameters: InputWindowsParameters + + + class azure.mgmt.maintenance.types.InputWindowsParameters(TypedDict, total=False): + key "excludeKbsRequiringReboot": bool + classificationsToInclude: list[str] + excludeKbsRequiringReboot: bool + kbNumbersToExclude: list[str] + kbNumbersToInclude: list[str] + + + class azure.mgmt.maintenance.types.MaintenanceConfiguration(ProxyResource): + key "id": str + key "location": str + key "name": str + key "properties": ForwardRef('MaintenanceConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: MaintenanceConfigurationProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.maintenance.types.MaintenanceConfigurationProperties(TypedDict, total=False): + key "installPatches": ForwardRef('InputPatchConfiguration', module='types') + key "maintenanceScope": Union[str, MaintenanceScope] + key "maintenanceWindow": ForwardRef('MaintenanceWindow', module='types') + key "namespace": str + key "visibility": Union[str, Visibility] + extensionProperties: dict[str, str] + installPatches: InputPatchConfiguration + maintenanceScope: Union[str, MaintenanceScope] + maintenanceWindow: MaintenanceWindow + namespace: str + visibility: Union[str, Visibility] + + + class azure.mgmt.maintenance.types.MaintenanceWindow(TypedDict, total=False): + key "duration": str + key "expirationDateTime": str + key "recurEvery": str + key "startDateTime": str + key "timeZone": str + duration: str + expirationDateTime: str + recurEvery: str + startDateTime: str + timeZone: str + + + class azure.mgmt.maintenance.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.maintenance.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.maintenance.types.ScheduledEventsIdList(TypedDict, total=False): + key "value": Required[list[str]] + value: list[str] + + + class azure.mgmt.maintenance.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.maintenance.types.TagSettingsProperties(TypedDict, total=False): + key "filterOperator": Union[str, TagOperators] + filterOperator: Union[str, TagOperators] + tags: dict[str, list[str]] + + +``` \ No newline at end of file diff --git a/sdk/maintenance/azure-mgmt-maintenance/api.metadata.yml b/sdk/maintenance/azure-mgmt-maintenance/api.metadata.yml new file mode 100644 index 000000000000..d1456c7170c1 --- /dev/null +++ b/sdk/maintenance/azure-mgmt-maintenance/api.metadata.yml @@ -0,0 +1,4 @@ +apiMdSha256: 1cbb4b1d5e3b9b31d8805ded0c704f824dc96e1470826e3bfc3c609879f829e9 +packageVersion: 2.2.0b4 +parserVersion: 0.3.31 +pythonVersion: 3.13.16 diff --git a/sdk/maintenance/azure-mgmt-maintenance/apiview-properties.json b/sdk/maintenance/azure-mgmt-maintenance/apiview-properties.json index 318a4678eff9..c35f4cfba344 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/apiview-properties.json +++ b/sdk/maintenance/azure-mgmt-maintenance/apiview-properties.json @@ -18,7 +18,11 @@ "azure.mgmt.maintenance.models.MaintenanceWindow": "Microsoft.Maintenance.MaintenanceWindow", "azure.mgmt.maintenance.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.maintenance.models.OperationInfo": "Azure.ResourceManager.CommonTypes.OperationDisplay", - "azure.mgmt.maintenance.models.ScheduledEventApproveResponse": "Microsoft.Maintenance.ScheduledEventApproveResponse", + "azure.mgmt.maintenance.models.ScheduledEventsAcknowledgeErrorDetails": "Microsoft.Maintenance.ScheduledEventsAcknowledgeErrorDetails", + "azure.mgmt.maintenance.models.ScheduledEventsApproveResponse": "Microsoft.Maintenance.ScheduledEventsApproveResponse", + "azure.mgmt.maintenance.models.ScheduledEventsIdList": "Microsoft.Maintenance.ScheduledEventsIdList", + "azure.mgmt.maintenance.models.ScheduledEventsListAcknowledgeError": "Microsoft.Maintenance.ScheduledEventsListAcknowledgeError", + "azure.mgmt.maintenance.models.ScheduledEventsListAcknowledgeErrorDetails": "Microsoft.Maintenance.ScheduledEventsListAcknowledgeErrorDetails", "azure.mgmt.maintenance.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.maintenance.models.TagSettingsProperties": "Microsoft.Maintenance.TagSettingsProperties", "azure.mgmt.maintenance.models.Update": "Microsoft.Maintenance.Update", @@ -96,8 +100,10 @@ "azure.mgmt.maintenance.aio.operations.MaintenanceConfigurationsForResourceGroupOperations.list": "Microsoft.Maintenance.MaintenanceConfigurationOperationGroup.list", "azure.mgmt.maintenance.operations.ConfigurationAssignmentsWithinSubscriptionOperations.list": "Microsoft.Maintenance.ConfigurationAssignmentsForSubscriptions.list", "azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsWithinSubscriptionOperations.list": "Microsoft.Maintenance.ConfigurationAssignmentsForSubscriptions.list", - "azure.mgmt.maintenance.operations.ScheduledEventOperations.acknowledge": "Microsoft.Maintenance.ScheduledEventOperationGroup.acknowledge", - "azure.mgmt.maintenance.aio.operations.ScheduledEventOperations.acknowledge": "Microsoft.Maintenance.ScheduledEventOperationGroup.acknowledge", + "azure.mgmt.maintenance.operations.ScheduledEventsOperations.acknowledge": "Microsoft.Maintenance.ScheduledEventOperationGroup.acknowledge", + "azure.mgmt.maintenance.aio.operations.ScheduledEventsOperations.acknowledge": "Microsoft.Maintenance.ScheduledEventOperationGroup.acknowledge", + "azure.mgmt.maintenance.operations.ScheduledEventsOperations.acknowledge_list": "Microsoft.Maintenance.ScheduledEventOperationGroup.acknowledgeList", + "azure.mgmt.maintenance.aio.operations.ScheduledEventsOperations.acknowledge_list": "Microsoft.Maintenance.ScheduledEventOperationGroup.acknowledgeList", "azure.mgmt.maintenance.operations.ApplyUpdateForResourceGroupOperations.list": "Microsoft.Maintenance.ApplyUpdateForResourceGroupOperationGroup.list", "azure.mgmt.maintenance.aio.operations.ApplyUpdateForResourceGroupOperations.list": "Microsoft.Maintenance.ApplyUpdateForResourceGroupOperationGroup.list", "azure.mgmt.maintenance.operations.UpdatesOperations.list_parent": "Microsoft.Maintenance.UpdatesOperationGroup.listParent", @@ -105,5 +111,5 @@ "azure.mgmt.maintenance.operations.UpdatesOperations.list": "Microsoft.Maintenance.UpdatesOperationGroup.list", "azure.mgmt.maintenance.aio.operations.UpdatesOperations.list": "Microsoft.Maintenance.UpdatesOperationGroup.list" }, - "CrossLanguageVersion": "832e7455484c" + "CrossLanguageVersion": "efed42f38c81" } \ No newline at end of file diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_client.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_client.py index e56b734d2c91..ffba62c85919 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_client.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ MaintenanceConfigurationsOperations, Operations, PublicMaintenanceConfigurationsOperations, - ScheduledEventOperations, + ScheduledEventsOperations, UpdatesOperations, ) @@ -44,7 +45,7 @@ from azure.core.credentials import TokenCredential -class MaintenanceManagementClient: # pylint: disable=too-many-instance-attributes +class MaintenanceManagementClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Azure Maintenance Management Client. :ivar operations: Operations operations @@ -76,8 +77,8 @@ class MaintenanceManagementClient: # pylint: disable=too-many-instance-attribut ConfigurationAssignmentsWithinSubscriptionOperations operations :vartype configuration_assignments_within_subscription: azure.mgmt.maintenance.operations.ConfigurationAssignmentsWithinSubscriptionOperations - :ivar scheduled_event: ScheduledEventOperations operations - :vartype scheduled_event: azure.mgmt.maintenance.operations.ScheduledEventOperations + :ivar scheduled_events: ScheduledEventsOperations operations + :vartype scheduled_events: azure.mgmt.maintenance.operations.ScheduledEventsOperations :ivar apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations operations :vartype apply_update_for_resource_group: azure.mgmt.maintenance.operations.ApplyUpdateForResourceGroupOperations @@ -93,7 +94,7 @@ class MaintenanceManagementClient: # pylint: disable=too-many-instance-attribut None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2023-10-01-preview" and None. Default value is None. If not set, the operation's default API + "2025-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -169,7 +170,9 @@ def __init__( self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.scheduled_event = ScheduledEventOperations(self._client, self._config, self._serialize, self._deserialize) + self.scheduled_events = ScheduledEventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.apply_update_for_resource_group = ApplyUpdateForResourceGroupOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_configuration.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_configuration.py index 84e1f17e1d61..8fe37e70ab7f 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_configuration.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials import TokenCredential -class MaintenanceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes +class MaintenanceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for MaintenanceManagementClient. Note that all parameters used to create this instance are saved as instance @@ -34,7 +35,7 @@ class MaintenanceManagementClientConfiguration: # pylint: disable=too-many-inst None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2023-10-01-preview" and None. Default value is None. If not set, the operation's default API + "2025-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -48,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2023-10-01-preview") + api_version: str = kwargs.pop("api_version", "2025-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/model_base.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/model_base.py index 4102784f9a85..35d5fc024978 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/model_base.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/model_base.py @@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -135,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -301,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -313,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -330,12 +373,18 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: @@ -425,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -449,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -484,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -509,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -564,7 +614,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -590,6 +640,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -630,7 +913,9 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) - def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: """Deserialize an XML element into a dict mapping rest field names to values. :param ET.Element element: The XML element to deserialize from. @@ -638,53 +923,89 @@ def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: :rtype: dict """ result: dict[str, typing.Any] = {} - model_meta = getattr(self, "_xml", {}) existed_attr_keys: list[str] = [] - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) + result[rf._rest_name] = _deserialize(rf._type, item) # rest thing is additional properties for e in element: @@ -717,6 +1038,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -1091,6 +1415,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1103,6 +1428,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1138,7 +1464,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1184,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1193,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1426,6 +1758,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/serialization.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/serialization.py index 954bf7ebffa7..ae08f9d89f74 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/serialization.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_utils/serialization.py @@ -480,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -520,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1109,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1381,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1393,6 +1460,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1405,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1415,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1933,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_validation.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_version.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_version.py index 6c8cc6772fb6..0a201cf307ed 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_version.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.2.0b3" +VERSION = "2.2.0b4" diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_client.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_client.py index 777cde3345d4..5ec868918ee9 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_client.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ MaintenanceConfigurationsOperations, Operations, PublicMaintenanceConfigurationsOperations, - ScheduledEventOperations, + ScheduledEventsOperations, UpdatesOperations, ) @@ -44,7 +45,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class MaintenanceManagementClient: # pylint: disable=too-many-instance-attributes +class MaintenanceManagementClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Azure Maintenance Management Client. :ivar operations: Operations operations @@ -76,8 +77,8 @@ class MaintenanceManagementClient: # pylint: disable=too-many-instance-attribut ConfigurationAssignmentsWithinSubscriptionOperations operations :vartype configuration_assignments_within_subscription: azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsWithinSubscriptionOperations - :ivar scheduled_event: ScheduledEventOperations operations - :vartype scheduled_event: azure.mgmt.maintenance.aio.operations.ScheduledEventOperations + :ivar scheduled_events: ScheduledEventsOperations operations + :vartype scheduled_events: azure.mgmt.maintenance.aio.operations.ScheduledEventsOperations :ivar apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations operations :vartype apply_update_for_resource_group: azure.mgmt.maintenance.aio.operations.ApplyUpdateForResourceGroupOperations @@ -93,7 +94,7 @@ class MaintenanceManagementClient: # pylint: disable=too-many-instance-attribut None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2023-10-01-preview" and None. Default value is None. If not set, the operation's default API + "2025-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -171,7 +172,9 @@ def __init__( self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.scheduled_event = ScheduledEventOperations(self._client, self._config, self._serialize, self._deserialize) + self.scheduled_events = ScheduledEventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.apply_update_for_resource_group = ApplyUpdateForResourceGroupOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_configuration.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_configuration.py index 2c9fc5b4bf25..e21d8307869a 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_configuration.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class MaintenanceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes +class MaintenanceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for MaintenanceManagementClient. Note that all parameters used to create this instance are saved as instance @@ -34,7 +35,7 @@ class MaintenanceManagementClientConfiguration: # pylint: disable=too-many-inst None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2023-10-01-preview" and None. Default value is None. If not set, the operation's default API + "2025-10-01-preview" and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str @@ -48,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2023-10-01-preview") + api_version: str = kwargs.pop("api_version", "2025-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/__init__.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/__init__.py index 975098360977..34caffbde572 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/__init__.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/__init__.py @@ -21,7 +21,7 @@ from ._operations import PublicMaintenanceConfigurationsOperations # type: ignore from ._operations import MaintenanceConfigurationsForResourceGroupOperations # type: ignore from ._operations import ConfigurationAssignmentsWithinSubscriptionOperations # type: ignore -from ._operations import ScheduledEventOperations # type: ignore +from ._operations import ScheduledEventsOperations # type: ignore from ._operations import ApplyUpdateForResourceGroupOperations # type: ignore from ._operations import UpdatesOperations # type: ignore @@ -39,7 +39,7 @@ "PublicMaintenanceConfigurationsOperations", "MaintenanceConfigurationsForResourceGroupOperations", "ConfigurationAssignmentsWithinSubscriptionOperations", - "ScheduledEventOperations", + "ScheduledEventsOperations", "ApplyUpdateForResourceGroupOperations", "UpdatesOperations", ] diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/_operations.py index f8773dcb8a7a..081876154c74 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/aio/operations/_operations.py @@ -31,9 +31,10 @@ from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation from ...operations._operations import ( build_apply_update_for_resource_group_list_request, build_apply_updates_create_or_update_or_cancel_request, @@ -68,7 +69,8 @@ build_operations_list_request, build_public_maintenance_configurations_get_request, build_public_maintenance_configurations_list_request, - build_scheduled_event_acknowledge_request, + build_scheduled_events_acknowledge_list_request, + build_scheduled_events_acknowledge_request, build_updates_list_parent_request, build_updates_list_request, ) @@ -76,11 +78,10 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -194,7 +195,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class MaintenanceConfigurationsOperations: +class MaintenanceConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -319,7 +320,7 @@ async def create_or_update( self, resource_group_name: str, resource_name: str, - configuration: JSON, + configuration: _types.MaintenanceConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -332,7 +333,7 @@ async def create_or_update( :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str :param configuration: The configuration. Required. - :type configuration: JSON + :type configuration: ~azure.mgmt.maintenance.types.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -375,7 +376,7 @@ async def create_or_update( self, resource_group_name: str, resource_name: str, - configuration: Union[_models.MaintenanceConfiguration, JSON, IO[bytes]], + configuration: Union[_models.MaintenanceConfiguration, _types.MaintenanceConfiguration, IO[bytes]], **kwargs: Any ) -> _models.MaintenanceConfiguration: """Create or Update configuration record. @@ -385,10 +386,10 @@ async def create_or_update( :type resource_group_name: str :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str - :param configuration: The configuration. Is one of the following types: - MaintenanceConfiguration, JSON, IO[bytes] Required. - :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or JSON or - IO[bytes] + :param configuration: The configuration. Is either a MaintenanceConfiguration type or a + IO[bytes] type. Required. + :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or + ~azure.mgmt.maintenance.types.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.MaintenanceConfiguration @@ -494,7 +495,7 @@ async def update( self, resource_group_name: str, resource_name: str, - configuration: JSON, + configuration: _types.MaintenanceConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -507,7 +508,7 @@ async def update( :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str :param configuration: The configuration. Required. - :type configuration: JSON + :type configuration: ~azure.mgmt.maintenance.types.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -550,7 +551,7 @@ async def update( self, resource_group_name: str, resource_name: str, - configuration: Union[_models.MaintenanceConfiguration, JSON, IO[bytes]], + configuration: Union[_models.MaintenanceConfiguration, _types.MaintenanceConfiguration, IO[bytes]], **kwargs: Any ) -> _models.MaintenanceConfiguration: """Patch configuration record. @@ -560,10 +561,10 @@ async def update( :type resource_group_name: str :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str - :param configuration: The configuration. Is one of the following types: - MaintenanceConfiguration, JSON, IO[bytes] Required. - :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or JSON or - IO[bytes] + :param configuration: The configuration. Is either a MaintenanceConfiguration type or a + IO[bytes] type. Required. + :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or + ~azure.mgmt.maintenance.types.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.MaintenanceConfiguration @@ -806,7 +807,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ApplyUpdatesOperations: +class ApplyUpdatesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1051,7 +1052,7 @@ async def create_or_update_or_cancel( resource_type: str, resource_name: str, apply_update_name: str, - apply_update: JSON, + apply_update: _types.ApplyUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1070,7 +1071,7 @@ async def create_or_update_or_cancel( :param apply_update_name: The name of the ApplyUpdate. Required. :type apply_update_name: str :param apply_update: The ApplyUpdate. Required. - :type apply_update: JSON + :type apply_update: ~azure.mgmt.maintenance.types.ApplyUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1123,7 +1124,7 @@ async def create_or_update_or_cancel( resource_type: str, resource_name: str, apply_update_name: str, - apply_update: Union[_models.ApplyUpdate, JSON, IO[bytes]], + apply_update: Union[_models.ApplyUpdate, _types.ApplyUpdate, IO[bytes]], **kwargs: Any ) -> _models.ApplyUpdate: """Apply maintenance updates to resource. @@ -1139,9 +1140,10 @@ async def create_or_update_or_cancel( :type resource_name: str :param apply_update_name: The name of the ApplyUpdate. Required. :type apply_update_name: str - :param apply_update: The ApplyUpdate. Is one of the following types: ApplyUpdate, JSON, - IO[bytes] Required. - :type apply_update: ~azure.mgmt.maintenance.models.ApplyUpdate or JSON or IO[bytes] + :param apply_update: The ApplyUpdate. Is either a ApplyUpdate type or a IO[bytes] type. + Required. + :type apply_update: ~azure.mgmt.maintenance.models.ApplyUpdate or + ~azure.mgmt.maintenance.types.ApplyUpdate or IO[bytes] :return: ApplyUpdate. The ApplyUpdate is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ApplyUpdate :raises ~azure.core.exceptions.HttpResponseError: @@ -1491,7 +1493,7 @@ async def create_or_update( return deserialized # type: ignore -class ConfigurationAssignmentsOperations: +class ConfigurationAssignmentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1657,7 +1659,7 @@ async def create_or_update_parent( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -1680,7 +1682,7 @@ async def create_or_update_parent( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1741,7 +1743,7 @@ async def create_or_update_parent( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -1761,10 +1763,10 @@ async def create_or_update_parent( :type resource_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -2192,7 +2194,7 @@ async def create_or_update( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -2211,7 +2213,7 @@ async def create_or_update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2264,7 +2266,7 @@ async def create_or_update( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -2280,10 +2282,10 @@ async def create_or_update( :type resource_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -2560,7 +2562,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ConfigurationAssignmentsForSubscriptionsOperations: # pylint: disable=name-too-long +class ConfigurationAssignmentsForSubscriptionsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -2672,7 +2674,7 @@ async def create_or_update( async def create_or_update( self, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -2682,7 +2684,7 @@ async def create_or_update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2718,17 +2720,17 @@ async def create_or_update( async def create_or_update( self, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -2826,7 +2828,7 @@ async def update( async def update( self, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -2836,7 +2838,7 @@ async def update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2872,17 +2874,17 @@ async def update( async def update( self, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -3025,7 +3027,7 @@ async def delete( return deserialized # type: ignore -class ConfigurationAssignmentsForResourceGroupOperations: # pylint: disable=name-too-long +class ConfigurationAssignmentsForResourceGroupOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3148,7 +3150,7 @@ async def create_or_update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -3161,7 +3163,7 @@ async def create_or_update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3202,7 +3204,7 @@ async def create_or_update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -3212,10 +3214,10 @@ async def create_or_update( :type resource_group_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -3319,7 +3321,7 @@ async def update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -3332,7 +3334,7 @@ async def update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3373,7 +3375,7 @@ async def update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -3383,10 +3385,10 @@ async def update( :type resource_group_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -3534,7 +3536,7 @@ async def delete( return deserialized # type: ignore -class PublicMaintenanceConfigurationsOperations: # pylint: disable=name-too-long +class PublicMaintenanceConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3715,7 +3717,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class MaintenanceConfigurationsForResourceGroupOperations: # pylint: disable=name-too-long +class MaintenanceConfigurationsForResourceGroupOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3833,7 +3835,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ConfigurationAssignmentsWithinSubscriptionOperations: # pylint: disable=name-too-long +class ConfigurationAssignmentsWithinSubscriptionOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3948,14 +3950,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ScheduledEventOperations: +class ScheduledEventsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.maintenance.aio.MaintenanceManagementClient`'s - :attr:`scheduled_event` attribute. + :attr:`scheduled_events` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3970,10 +3972,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def acknowledge( self, resource_group_name: str, resource_type: str, resource_name: str, scheduled_event_id: str, **kwargs: Any - ) -> _models.ScheduledEventApproveResponse: - """Post Scheduled Event Acknowledgement. + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents Acknowledgement. - Post Scheduled Event Acknowledgement. + Post ScheduledEvents Acknowledgement. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3982,12 +3984,12 @@ async def acknowledge( :type resource_type: str :param resource_name: Resource Name. Required. :type resource_name: str - :param scheduled_event_id: Scheduled Event Id. This is a GUID-formatted string (e.g. + :param scheduled_event_id: ScheduledEvents Id. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required. :type scheduled_event_id: str - :return: ScheduledEventApproveResponse. The ScheduledEventApproveResponse is compatible with + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with MutableMapping - :rtype: ~azure.mgmt.maintenance.models.ScheduledEventApproveResponse + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4001,9 +4003,9 @@ async def acknowledge( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ScheduledEventApproveResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ScheduledEventsApproveResponse] = kwargs.pop("cls", None) - _request = build_scheduled_event_acknowledge_request( + _request = build_scheduled_events_acknowledge_request( resource_group_name=resource_group_name, resource_type=resource_type, resource_name=resource_name, @@ -4042,7 +4044,218 @@ async def acknowledge( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ScheduledEventApproveResponse, response.json()) + deserialized = _deserialize(_models.ScheduledEventsApproveResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: _models.ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Required. + :type scheduled_events_id_list: ~azure.mgmt.maintenance.models.ScheduledEventsIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: _types.ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Required. + :type scheduled_events_id_list: ~azure.mgmt.maintenance.types.ScheduledEventsIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Required. + :type scheduled_events_id_list: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-01-preview", + params_added_on={ + "2025-10-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_type", + "resource_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-01-preview"], + ) + async def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: Union[_models.ScheduledEventsIdList, _types.ScheduledEventsIdList, IO[bytes]], + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Is either a ScheduledEventsIdList + type or a IO[bytes] type. Required. + :type scheduled_events_id_list: ~azure.mgmt.maintenance.models.ScheduledEventsIdList or + ~azure.mgmt.maintenance.types.ScheduledEventsIdList or IO[bytes] + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScheduledEventsApproveResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(scheduled_events_id_list, (IOBase, bytes)): + _content = scheduled_events_id_list + else: + _content = json.dumps(scheduled_events_id_list, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_scheduled_events_acknowledge_list_request( + resource_group_name=resource_group_name, + resource_type=resource_type, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ScheduledEventsListAcknowledgeError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ScheduledEventsApproveResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4050,7 +4263,7 @@ async def acknowledge( return deserialized # type: ignore -class ApplyUpdateForResourceGroupOperations: +class ApplyUpdateForResourceGroupOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4169,7 +4382,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class UpdatesOperations: +class UpdatesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py index 248bc335de05..29a688b041ba 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py @@ -31,7 +31,11 @@ OperationInfo, ProxyResource, Resource, - ScheduledEventApproveResponse, + ScheduledEventsAcknowledgeErrorDetails, + ScheduledEventsApproveResponse, + ScheduledEventsIdList, + ScheduledEventsListAcknowledgeError, + ScheduledEventsListAcknowledgeErrorDetails, SystemData, TagSettingsProperties, Update, @@ -71,7 +75,11 @@ "OperationInfo", "ProxyResource", "Resource", - "ScheduledEventApproveResponse", + "ScheduledEventsAcknowledgeErrorDetails", + "ScheduledEventsApproveResponse", + "ScheduledEventsIdList", + "ScheduledEventsListAcknowledgeError", + "ScheduledEventsListAcknowledgeErrorDetails", "SystemData", "TagSettingsProperties", "Update", diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py index a013ec46191a..485cceb67bf5 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py @@ -62,7 +62,7 @@ class ProxyResource(Resource): """ -class ApplyUpdate(ProxyResource): +class ApplyUpdate(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Apply Update request. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -123,7 +123,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ApplyUpdateProperties(_Model): +class ApplyUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for apply update. :ivar status: The status. Known values are: "Pending", "InProgress", "Completed", "RetryNow", @@ -169,7 +169,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConfigurationAssignment(ProxyResource): +class ConfigurationAssignment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration Assignment. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -235,7 +235,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ConfigurationAssignmentFilterProperties(_Model): +class ConfigurationAssignmentFilterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure query for the update configuration. :ivar resource_types: List of allowed resources. @@ -291,7 +291,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConfigurationAssignmentProperties(_Model): +class ConfigurationAssignmentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for configuration assignment. :ivar maintenance_configuration_id: The maintenance configuration Id. @@ -335,7 +335,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorDetails(_Model): +class ErrorDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An error response details received from the Azure Maintenance service. :ivar code: Service-defined error code. This code serves as a sub-status for the HTTP error @@ -370,7 +370,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InputLinuxParameters(_Model): +class InputLinuxParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Input properties for patching a Linux machine. :ivar package_name_masks_to_exclude: Package names to be excluded for patching. @@ -416,7 +416,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InputPatchConfiguration(_Model): +class InputPatchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Input configuration for a patch run. :ivar reboot_setting: Possible reboot preference as defined by the user based on which it would @@ -468,7 +468,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InputWindowsParameters(_Model): +class InputWindowsParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Input properties for patching a Windows machine. :ivar kb_numbers_to_exclude: Windows KBID to be excluded for patching. @@ -522,7 +522,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MaintenanceConfiguration(ProxyResource): +class MaintenanceConfiguration(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Maintenance configuration record type. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -573,7 +573,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MaintenanceConfigurationProperties(_Model): +class MaintenanceConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for maintenance configuration. :ivar namespace: Gets or sets namespace of the resource. @@ -660,7 +660,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class MaintenanceError(_Model): +class MaintenanceError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An error response received from the Azure Maintenance service. :ivar error: Details of the error. @@ -688,7 +688,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MaintenanceWindow(_Model): +class MaintenanceWindow(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of a MaintenanceWindow. :ivar start_date_time: Effective start date of the maintenance window in YYYY-MM-DD hh:mm @@ -781,7 +781,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_Model): +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -867,8 +867,49 @@ class OperationInfo(_Model): views.""" -class ScheduledEventApproveResponse(_Model): - """Response of scheduled event acknowledge. +class ScheduledEventsAcknowledgeErrorDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An error response details received from the Azure Maintenance service for each ScheduledEvents. + + :ivar target: ScheduledEvents Id. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :vartype target: str + :ivar code: Status code for the ScheduledEvents acknowledge operation on the target + ScheduledEvents Id. + :vartype code: str + :ivar message: Human-readable representation of the error. + :vartype message: str + """ + + target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """ScheduledEvents Id. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000).""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Status code for the ScheduledEvents acknowledge operation on the target ScheduledEvents Id.""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable representation of the error.""" + + @overload + def __init__( + self, + *, + target: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduledEventsApproveResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response of ScheduledEvents acknowledge. :ivar value: Successfully Approved. :vartype value: str @@ -895,7 +936,109 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_Model): +class ScheduledEventsIdList(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ScheduledEvents Id List. + + :ivar value: The list of ScheduledEvents Id. Required. + :vartype value: list[str] + """ + + value: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of ScheduledEvents Id. Required.""" + + @overload + def __init__( + self, + *, + value: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduledEventsListAcknowledgeError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An error response received from the Azure Maintenance service. + + :ivar error: Error response. + :vartype error: ~azure.mgmt.maintenance.models.ScheduledEventsListAcknowledgeErrorDetails + """ + + error: Optional["_models.ScheduledEventsListAcknowledgeErrorDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Error response.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ScheduledEventsListAcknowledgeErrorDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduledEventsListAcknowledgeErrorDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """An error response details received from the Azure Maintenance service. + + :ivar code: Service-defined error code. This code serves as a sub-status for the HTTP error + code specified in the response. + :vartype code: str + :ivar message: Human-readable representation of the error. + :vartype message: str + :ivar details: Error details for each ScheduledEvents. + :vartype details: list[~azure.mgmt.maintenance.models.ScheduledEventsAcknowledgeErrorDetails] + """ + + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Service-defined error code. This code serves as a sub-status for the HTTP error code specified + in the response.""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable representation of the error.""" + details: Optional[list["_models.ScheduledEventsAcknowledgeErrorDetails"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Error details for each ScheduledEvents.""" + + @overload + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[list["_models.ScheduledEventsAcknowledgeErrorDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -962,7 +1105,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TagSettingsProperties(_Model): +class TagSettingsProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Tag filter information for the VM. :ivar tags: Dictionary of tags with its list of values. @@ -998,7 +1141,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Update(_Model): +class Update(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Maintenance update on a resource. :ivar maintenance_scope: The impact area. Known values are: "Host", "Resource", "OSImage", @@ -1089,7 +1232,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class UpdateProperties(_Model): +class UpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for update. :ivar resource_id: The resourceId. diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py index 975098360977..34caffbde572 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py @@ -21,7 +21,7 @@ from ._operations import PublicMaintenanceConfigurationsOperations # type: ignore from ._operations import MaintenanceConfigurationsForResourceGroupOperations # type: ignore from ._operations import ConfigurationAssignmentsWithinSubscriptionOperations # type: ignore -from ._operations import ScheduledEventOperations # type: ignore +from ._operations import ScheduledEventsOperations # type: ignore from ._operations import ApplyUpdateForResourceGroupOperations # type: ignore from ._operations import UpdatesOperations # type: ignore @@ -39,7 +39,7 @@ "PublicMaintenanceConfigurationsOperations", "MaintenanceConfigurationsForResourceGroupOperations", "ConfigurationAssignmentsWithinSubscriptionOperations", - "ScheduledEventOperations", + "ScheduledEventsOperations", "ApplyUpdateForResourceGroupOperations", "UpdatesOperations", ] diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py index e4dd9ba23b15..1e9d8a11a00d 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py @@ -30,14 +30,14 @@ from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import MaintenanceManagementClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -48,7 +48,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_maintenance_configurations_get_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_maintenance_configurations_create_or_update_request( # pylint: disabl _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_maintenance_configurations_update_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +159,7 @@ def build_maintenance_configurations_delete_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +187,7 @@ def build_maintenance_configurations_list_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +221,7 @@ def build_apply_updates_get_parent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +260,7 @@ def build_apply_updates_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -298,7 +298,7 @@ def build_apply_updates_create_or_update_or_cancel_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +329,7 @@ def build_apply_updates_list_request(subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +362,7 @@ def build_apply_updates_create_or_update_parent_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -399,7 +399,7 @@ def build_apply_updates_create_or_update_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -437,7 +437,7 @@ def build_configuration_assignments_get_parent_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -481,7 +481,7 @@ def build_configuration_assignments_create_or_update_parent_request( # pylint: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -526,7 +526,7 @@ def build_configuration_assignments_delete_parent_request( # pylint: disable=na _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -568,7 +568,7 @@ def build_configuration_assignments_list_parent_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -606,7 +606,7 @@ def build_configuration_assignments_get_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -646,7 +646,7 @@ def build_configuration_assignments_create_or_update_request( # pylint: disable _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -687,7 +687,7 @@ def build_configuration_assignments_delete_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -725,7 +725,7 @@ def build_configuration_assignments_list_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -755,7 +755,7 @@ def build_configuration_assignments_for_subscriptions_get_request( # pylint: di _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -785,7 +785,7 @@ def build_configuration_assignments_for_subscriptions_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -817,7 +817,7 @@ def build_configuration_assignments_for_subscriptions_update_request( # pylint: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -848,7 +848,7 @@ def build_configuration_assignments_for_subscriptions_delete_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -877,7 +877,7 @@ def build_configuration_assignments_for_resource_group_get_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -908,7 +908,7 @@ def build_configuration_assignments_for_resource_group_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -941,7 +941,7 @@ def build_configuration_assignments_for_resource_group_update_request( # pylint _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -973,7 +973,7 @@ def build_configuration_assignments_for_resource_group_delete_request( # pylint _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1003,7 +1003,7 @@ def build_public_maintenance_configurations_get_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1032,7 +1032,7 @@ def build_public_maintenance_configurations_list_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1058,7 +1058,7 @@ def build_maintenance_configurations_for_resource_group_list_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1085,7 +1085,7 @@ def build_configuration_assignments_within_subscription_list_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1105,7 +1105,7 @@ def build_configuration_assignments_within_subscription_list_request( # pylint: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scheduled_event_acknowledge_request( # pylint: disable=name-too-long +def build_scheduled_events_acknowledge_request( # pylint: disable=name-too-long resource_group_name: str, resource_type: str, resource_name: str, @@ -1116,7 +1116,7 @@ def build_scheduled_event_acknowledge_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1140,13 +1140,45 @@ def build_scheduled_event_acknowledge_request( # pylint: disable=name-too-long return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_scheduled_events_acknowledge_list_request( # pylint: disable=name-too-long + resource_group_name: str, resource_type: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/scheduledevents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceType": _SERIALIZER.url("resource_type", resource_type, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_apply_update_for_resource_group_list_request( # pylint: disable=name-too-long resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1180,7 +1212,7 @@ def build_updates_list_parent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1217,7 +1249,7 @@ def build_updates_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-10-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1241,7 +1273,7 @@ def build_updates_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1355,7 +1387,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class MaintenanceConfigurationsOperations: +class MaintenanceConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1478,7 +1510,7 @@ def create_or_update( self, resource_group_name: str, resource_name: str, - configuration: JSON, + configuration: _types.MaintenanceConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -1491,7 +1523,7 @@ def create_or_update( :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str :param configuration: The configuration. Required. - :type configuration: JSON + :type configuration: ~azure.mgmt.maintenance.types.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1534,7 +1566,7 @@ def create_or_update( self, resource_group_name: str, resource_name: str, - configuration: Union[_models.MaintenanceConfiguration, JSON, IO[bytes]], + configuration: Union[_models.MaintenanceConfiguration, _types.MaintenanceConfiguration, IO[bytes]], **kwargs: Any ) -> _models.MaintenanceConfiguration: """Create or Update configuration record. @@ -1544,10 +1576,10 @@ def create_or_update( :type resource_group_name: str :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str - :param configuration: The configuration. Is one of the following types: - MaintenanceConfiguration, JSON, IO[bytes] Required. - :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or JSON or - IO[bytes] + :param configuration: The configuration. Is either a MaintenanceConfiguration type or a + IO[bytes] type. Required. + :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or + ~azure.mgmt.maintenance.types.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.MaintenanceConfiguration @@ -1653,7 +1685,7 @@ def update( self, resource_group_name: str, resource_name: str, - configuration: JSON, + configuration: _types.MaintenanceConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -1666,7 +1698,7 @@ def update( :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str :param configuration: The configuration. Required. - :type configuration: JSON + :type configuration: ~azure.mgmt.maintenance.types.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1709,7 +1741,7 @@ def update( self, resource_group_name: str, resource_name: str, - configuration: Union[_models.MaintenanceConfiguration, JSON, IO[bytes]], + configuration: Union[_models.MaintenanceConfiguration, _types.MaintenanceConfiguration, IO[bytes]], **kwargs: Any ) -> _models.MaintenanceConfiguration: """Patch configuration record. @@ -1719,10 +1751,10 @@ def update( :type resource_group_name: str :param resource_name: The name of the MaintenanceConfiguration. Required. :type resource_name: str - :param configuration: The configuration. Is one of the following types: - MaintenanceConfiguration, JSON, IO[bytes] Required. - :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or JSON or - IO[bytes] + :param configuration: The configuration. Is either a MaintenanceConfiguration type or a + IO[bytes] type. Required. + :type configuration: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or + ~azure.mgmt.maintenance.types.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.MaintenanceConfiguration @@ -1964,7 +1996,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ApplyUpdatesOperations: +class ApplyUpdatesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2209,7 +2241,7 @@ def create_or_update_or_cancel( resource_type: str, resource_name: str, apply_update_name: str, - apply_update: JSON, + apply_update: _types.ApplyUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -2228,7 +2260,7 @@ def create_or_update_or_cancel( :param apply_update_name: The name of the ApplyUpdate. Required. :type apply_update_name: str :param apply_update: The ApplyUpdate. Required. - :type apply_update: JSON + :type apply_update: ~azure.mgmt.maintenance.types.ApplyUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2281,7 +2313,7 @@ def create_or_update_or_cancel( resource_type: str, resource_name: str, apply_update_name: str, - apply_update: Union[_models.ApplyUpdate, JSON, IO[bytes]], + apply_update: Union[_models.ApplyUpdate, _types.ApplyUpdate, IO[bytes]], **kwargs: Any ) -> _models.ApplyUpdate: """Apply maintenance updates to resource. @@ -2297,9 +2329,10 @@ def create_or_update_or_cancel( :type resource_name: str :param apply_update_name: The name of the ApplyUpdate. Required. :type apply_update_name: str - :param apply_update: The ApplyUpdate. Is one of the following types: ApplyUpdate, JSON, - IO[bytes] Required. - :type apply_update: ~azure.mgmt.maintenance.models.ApplyUpdate or JSON or IO[bytes] + :param apply_update: The ApplyUpdate. Is either a ApplyUpdate type or a IO[bytes] type. + Required. + :type apply_update: ~azure.mgmt.maintenance.models.ApplyUpdate or + ~azure.mgmt.maintenance.types.ApplyUpdate or IO[bytes] :return: ApplyUpdate. The ApplyUpdate is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ApplyUpdate :raises ~azure.core.exceptions.HttpResponseError: @@ -2649,7 +2682,7 @@ def create_or_update( return deserialized # type: ignore -class ConfigurationAssignmentsOperations: +class ConfigurationAssignmentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2815,7 +2848,7 @@ def create_or_update_parent( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -2838,7 +2871,7 @@ def create_or_update_parent( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2899,7 +2932,7 @@ def create_or_update_parent( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -2919,10 +2952,10 @@ def create_or_update_parent( :type resource_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -3349,7 +3382,7 @@ def create_or_update( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -3368,7 +3401,7 @@ def create_or_update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3421,7 +3454,7 @@ def create_or_update( resource_type: str, resource_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -3437,10 +3470,10 @@ def create_or_update( :type resource_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -3716,7 +3749,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ConfigurationAssignmentsForSubscriptionsOperations: # pylint: disable=name-too-long +class ConfigurationAssignmentsForSubscriptionsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3828,7 +3861,7 @@ def create_or_update( def create_or_update( self, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -3838,7 +3871,7 @@ def create_or_update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3874,17 +3907,17 @@ def create_or_update( def create_or_update( self, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -3982,7 +4015,7 @@ def update( def update( self, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -3992,7 +4025,7 @@ def update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4028,17 +4061,17 @@ def update( def update( self, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -4179,7 +4212,7 @@ def delete(self, configuration_assignment_name: str, **kwargs: Any) -> Optional[ return deserialized # type: ignore -class ConfigurationAssignmentsForResourceGroupOperations: # pylint: disable=name-too-long +class ConfigurationAssignmentsForResourceGroupOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -4302,7 +4335,7 @@ def create_or_update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -4315,7 +4348,7 @@ def create_or_update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4356,7 +4389,7 @@ def create_or_update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -4366,10 +4399,10 @@ def create_or_update( :type resource_group_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -4473,7 +4506,7 @@ def update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: JSON, + configuration_assignment: _types.ConfigurationAssignment, *, content_type: str = "application/json", **kwargs: Any @@ -4486,7 +4519,7 @@ def update( :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str :param configuration_assignment: The configurationAssignment. Required. - :type configuration_assignment: JSON + :type configuration_assignment: ~azure.mgmt.maintenance.types.ConfigurationAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4527,7 +4560,7 @@ def update( self, resource_group_name: str, configuration_assignment_name: str, - configuration_assignment: Union[_models.ConfigurationAssignment, JSON, IO[bytes]], + configuration_assignment: Union[_models.ConfigurationAssignment, _types.ConfigurationAssignment, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationAssignment: """Register configuration for resource. @@ -4537,10 +4570,10 @@ def update( :type resource_group_name: str :param configuration_assignment_name: The name of the ConfigurationAssignment. Required. :type configuration_assignment_name: str - :param configuration_assignment: The configurationAssignment. Is one of the following types: - ConfigurationAssignment, JSON, IO[bytes] Required. - :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or JSON - or IO[bytes] + :param configuration_assignment: The configurationAssignment. Is either a + ConfigurationAssignment type or a IO[bytes] type. Required. + :type configuration_assignment: ~azure.mgmt.maintenance.models.ConfigurationAssignment or + ~azure.mgmt.maintenance.types.ConfigurationAssignment or IO[bytes] :return: ConfigurationAssignment. The ConfigurationAssignment is compatible with MutableMapping :rtype: ~azure.mgmt.maintenance.models.ConfigurationAssignment :raises ~azure.core.exceptions.HttpResponseError: @@ -4688,7 +4721,7 @@ def delete( return deserialized # type: ignore -class PublicMaintenanceConfigurationsOperations: # pylint: disable=name-too-long +class PublicMaintenanceConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -4868,7 +4901,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class MaintenanceConfigurationsForResourceGroupOperations: # pylint: disable=name-too-long +class MaintenanceConfigurationsForResourceGroupOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -4985,7 +5018,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ConfigurationAssignmentsWithinSubscriptionOperations: # pylint: disable=name-too-long +class ConfigurationAssignmentsWithinSubscriptionOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -5099,14 +5132,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ScheduledEventOperations: +class ScheduledEventsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.maintenance.MaintenanceManagementClient`'s - :attr:`scheduled_event` attribute. + :attr:`scheduled_events` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -5121,10 +5154,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def acknowledge( self, resource_group_name: str, resource_type: str, resource_name: str, scheduled_event_id: str, **kwargs: Any - ) -> _models.ScheduledEventApproveResponse: - """Post Scheduled Event Acknowledgement. + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents Acknowledgement. - Post Scheduled Event Acknowledgement. + Post ScheduledEvents Acknowledgement. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5133,12 +5166,12 @@ def acknowledge( :type resource_type: str :param resource_name: Resource Name. Required. :type resource_name: str - :param scheduled_event_id: Scheduled Event Id. This is a GUID-formatted string (e.g. + :param scheduled_event_id: ScheduledEvents Id. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required. :type scheduled_event_id: str - :return: ScheduledEventApproveResponse. The ScheduledEventApproveResponse is compatible with + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with MutableMapping - :rtype: ~azure.mgmt.maintenance.models.ScheduledEventApproveResponse + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5152,9 +5185,9 @@ def acknowledge( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ScheduledEventApproveResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ScheduledEventsApproveResponse] = kwargs.pop("cls", None) - _request = build_scheduled_event_acknowledge_request( + _request = build_scheduled_events_acknowledge_request( resource_group_name=resource_group_name, resource_type=resource_type, resource_name=resource_name, @@ -5193,7 +5226,218 @@ def acknowledge( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ScheduledEventApproveResponse, response.json()) + deserialized = _deserialize(_models.ScheduledEventsApproveResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: _models.ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Required. + :type scheduled_events_id_list: ~azure.mgmt.maintenance.models.ScheduledEventsIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: _types.ScheduledEventsIdList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Required. + :type scheduled_events_id_list: ~azure.mgmt.maintenance.types.ScheduledEventsIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Required. + :type scheduled_events_id_list: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-01-preview", + params_added_on={ + "2025-10-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_type", + "resource_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-01-preview"], + ) + def acknowledge_list( + self, + resource_group_name: str, + resource_type: str, + resource_name: str, + scheduled_events_id_list: Union[_models.ScheduledEventsIdList, _types.ScheduledEventsIdList, IO[bytes]], + **kwargs: Any + ) -> _models.ScheduledEventsApproveResponse: + """Post ScheduledEvents List Acknowledgement. + + Post List of ScheduledEvents Acknowledgement. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_type: Resource type. Required. + :type resource_type: str + :param resource_name: Resource name. Required. + :type resource_name: str + :param scheduled_events_id_list: List of ScheduledEvents Id. Is either a ScheduledEventsIdList + type or a IO[bytes] type. Required. + :type scheduled_events_id_list: ~azure.mgmt.maintenance.models.ScheduledEventsIdList or + ~azure.mgmt.maintenance.types.ScheduledEventsIdList or IO[bytes] + :return: ScheduledEventsApproveResponse. The ScheduledEventsApproveResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.maintenance.models.ScheduledEventsApproveResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScheduledEventsApproveResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(scheduled_events_id_list, (IOBase, bytes)): + _content = scheduled_events_id_list + else: + _content = json.dumps(scheduled_events_id_list, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_scheduled_events_acknowledge_list_request( + resource_group_name=resource_group_name, + resource_type=resource_type, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ScheduledEventsListAcknowledgeError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ScheduledEventsApproveResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5201,7 +5445,7 @@ def acknowledge( return deserialized # type: ignore -class ApplyUpdateForResourceGroupOperations: +class ApplyUpdateForResourceGroupOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -5320,7 +5564,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class UpdatesOperations: +class UpdatesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/types.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/types.py new file mode 100644 index 000000000000..717aff6620da --- /dev/null +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/types.py @@ -0,0 +1,441 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import CreatedByType, MaintenanceScope, RebootOptions, TagOperators, UpdateStatus, Visibility + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class ApplyUpdate(ProxyResource): + """Apply Update request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Properties of the apply update. + :vartype properties: "ApplyUpdateProperties" + """ + + properties: "ApplyUpdateProperties" + """Properties of the apply update.""" + + +class ApplyUpdateProperties(TypedDict, total=False): + """Properties for apply update. + + :ivar status: The status. Known values are: "Pending", "InProgress", "Completed", "RetryNow", + "RetryLater", "NoUpdatesPending", "Cancel", and "Cancelled". + :vartype status: Union[str, "UpdateStatus"] + :ivar resourceId: The resourceId. + :vartype resourceId: str + :ivar lastUpdateTime: Last Update time. + :vartype lastUpdateTime: str + """ + + status: Union[str, "UpdateStatus"] + """The status. Known values are: \"Pending\", \"InProgress\", \"Completed\", \"RetryNow\", + \"RetryLater\", \"NoUpdatesPending\", \"Cancel\", and \"Cancelled\".""" + resourceId: str + """The resourceId.""" + lastUpdateTime: str + """Last Update time.""" + + +class ConfigurationAssignment(ProxyResource): + """Configuration Assignment. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Properties of the configuration assignment. + :vartype properties: "ConfigurationAssignmentProperties" + :ivar location: Location of the resource. + :vartype location: str + """ + + properties: "ConfigurationAssignmentProperties" + """Properties of the configuration assignment.""" + location: str + """Location of the resource.""" + + +class ConfigurationAssignmentFilterProperties(TypedDict, total=False): + """Azure query for the update configuration. + + :ivar resourceTypes: List of allowed resources. + :vartype resourceTypes: list[str] + :ivar resourceGroups: List of allowed resource groups. + :vartype resourceGroups: list[str] + :ivar osTypes: List of allowed operating systems. + :vartype osTypes: list[str] + :ivar locations: List of locations to scope the query to. + :vartype locations: list[str] + :ivar tagSettings: Tag settings for the VM. + :vartype tagSettings: "TagSettingsProperties" + """ + + resourceTypes: list[str] + """List of allowed resources.""" + resourceGroups: list[str] + """List of allowed resource groups.""" + osTypes: list[str] + """List of allowed operating systems.""" + locations: list[str] + """List of locations to scope the query to.""" + tagSettings: "TagSettingsProperties" + """Tag settings for the VM.""" + + +class ConfigurationAssignmentProperties(TypedDict, total=False): + """Properties for configuration assignment. + + :ivar maintenanceConfigurationId: The maintenance configuration Id. + :vartype maintenanceConfigurationId: str + :ivar resourceId: The unique resourceId. + :vartype resourceId: str + :ivar filter: Properties of the configuration assignment. + :vartype filter: "ConfigurationAssignmentFilterProperties" + """ + + maintenanceConfigurationId: str + """The maintenance configuration Id.""" + resourceId: str + """The unique resourceId.""" + filter: "ConfigurationAssignmentFilterProperties" + """Properties of the configuration assignment.""" + + +class InputLinuxParameters(TypedDict, total=False): + """Input properties for patching a Linux machine. + + :ivar packageNameMasksToExclude: Package names to be excluded for patching. + :vartype packageNameMasksToExclude: list[str] + :ivar packageNameMasksToInclude: Package names to be included for patching. + :vartype packageNameMasksToInclude: list[str] + :ivar classificationsToInclude: Classification category of patches to be patched. Allowed + values are 'Critical', 'Security', and 'Other'. + :vartype classificationsToInclude: list[str] + """ + + packageNameMasksToExclude: list[str] + """Package names to be excluded for patching.""" + packageNameMasksToInclude: list[str] + """Package names to be included for patching.""" + classificationsToInclude: list[str] + """Classification category of patches to be patched. Allowed values are 'Critical', 'Security', + and 'Other'.""" + + +class InputPatchConfiguration(TypedDict, total=False): + """Input configuration for a patch run. + + :ivar rebootSetting: Possible reboot preference as defined by the user based on which it would + be decided to reboot the machine or not after the patch operation is completed. Known values + are: "IfRequired", "Never", and "Always". + :vartype rebootSetting: Union[str, "RebootOptions"] + :ivar windowsParameters: Input parameters specific to patching a Windows machine. For Linux + machines, do not pass this property. + :vartype windowsParameters: "InputWindowsParameters" + :ivar linuxParameters: Input parameters specific to patching Linux machine. For Windows + machines, do not pass this property. + :vartype linuxParameters: "InputLinuxParameters" + """ + + rebootSetting: Union[str, "RebootOptions"] + """Possible reboot preference as defined by the user based on which it would be decided to reboot + the machine or not after the patch operation is completed. Known values are: \"IfRequired\", + \"Never\", and \"Always\".""" + windowsParameters: "InputWindowsParameters" + """Input parameters specific to patching a Windows machine. For Linux machines, do not pass this + property.""" + linuxParameters: "InputLinuxParameters" + """Input parameters specific to patching Linux machine. For Windows machines, do not pass this + property.""" + + +class InputWindowsParameters(TypedDict, total=False): + """Input properties for patching a Windows machine. + + :ivar kbNumbersToExclude: Windows KBID to be excluded for patching. + :vartype kbNumbersToExclude: list[str] + :ivar kbNumbersToInclude: Windows KBID to be included for patching. + :vartype kbNumbersToInclude: list[str] + :ivar classificationsToInclude: Classification category of patches to be patched. Allowed + values are 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', + 'Tools', and 'Updates'. + :vartype classificationsToInclude: list[str] + :ivar excludeKbsRequiringReboot: Exclude patches which need reboot. + :vartype excludeKbsRequiringReboot: bool + """ + + kbNumbersToExclude: list[str] + """Windows KBID to be excluded for patching.""" + kbNumbersToInclude: list[str] + """Windows KBID to be included for patching.""" + classificationsToInclude: list[str] + """Classification category of patches to be patched. Allowed values are 'Critical', 'Security', + 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', and 'Updates'.""" + excludeKbsRequiringReboot: bool + """Exclude patches which need reboot.""" + + +class MaintenanceConfiguration(ProxyResource): + """Maintenance configuration record type. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Gets or sets properties of the resource. + :vartype properties: "MaintenanceConfigurationProperties" + :ivar location: Gets or sets location of the resource. + :vartype location: str + :ivar tags: Gets or sets tags of the resource. + :vartype tags: dict[str, str] + """ + + properties: "MaintenanceConfigurationProperties" + """Gets or sets properties of the resource.""" + location: str + """Gets or sets location of the resource.""" + tags: dict[str, str] + """Gets or sets tags of the resource.""" + + +class MaintenanceConfigurationProperties(TypedDict, total=False): + """Properties for maintenance configuration. + + :ivar namespace: Gets or sets namespace of the resource. + :vartype namespace: str + :ivar extensionProperties: Gets or sets extensionProperties of the maintenanceConfiguration. + :vartype extensionProperties: dict[str, str] + :ivar maintenanceScope: Gets or sets maintenanceScope of the configuration. Known values are: + "Host", "Resource", "OSImage", "Extension", "InGuestPatch", "SQLDB", and "SQLManagedInstance". + :vartype maintenanceScope: Union[str, "MaintenanceScope"] + :ivar maintenanceWindow: Definition of a MaintenanceWindow. + :vartype maintenanceWindow: "MaintenanceWindow" + :ivar visibility: Gets or sets the visibility of the configuration. The default value is + 'Custom'. Known values are: "Custom" and "Public". + :vartype visibility: Union[str, "Visibility"] + :ivar installPatches: The input parameters to be passed to the patch run operation. + :vartype installPatches: "InputPatchConfiguration" + """ + + namespace: str + """Gets or sets namespace of the resource.""" + extensionProperties: dict[str, str] + """Gets or sets extensionProperties of the maintenanceConfiguration.""" + maintenanceScope: Union[str, "MaintenanceScope"] + """Gets or sets maintenanceScope of the configuration. Known values are: \"Host\", \"Resource\", + \"OSImage\", \"Extension\", \"InGuestPatch\", \"SQLDB\", and \"SQLManagedInstance\".""" + maintenanceWindow: "MaintenanceWindow" + """Definition of a MaintenanceWindow.""" + visibility: Union[str, "Visibility"] + """Gets or sets the visibility of the configuration. The default value is 'Custom'. Known values + are: \"Custom\" and \"Public\".""" + installPatches: "InputPatchConfiguration" + """The input parameters to be passed to the patch run operation.""" + + +class MaintenanceWindow(TypedDict, total=False): + """Definition of a MaintenanceWindow. + + :ivar startDateTime: Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. + The start date can be set to either the current date or future date. The window will be created + in the time zone provided and adjusted to daylight savings according to that time zone. + :vartype startDateTime: str + :ivar expirationDateTime: Effective expiration date of the maintenance window in YYYY-MM-DD + hh:mm format. The window will be created in the time zone provided and adjusted to daylight + savings according to that time zone. Expiration date must be set to a future date. If not + provided, it will be set to the maximum datetime 9999-12-31 23:59:59. + :vartype expirationDateTime: str + :ivar duration: Duration of the maintenance window in HH:mm format. If not provided, default + value will be used based on maintenance scope provided. Example: 05:00. + :vartype duration: str + :ivar timeZone: Name of the timezone. List of timezones can be obtained by executing + [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, + W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time. + :vartype timeZone: str + :ivar recurEvery: Rate at which a Maintenance window is expected to recur. The rate can be + expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: + [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. + Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted + as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays + Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week + Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma + separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, + Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset + value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, + recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: + Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday + Offset6. + :vartype recurEvery: str + """ + + startDateTime: str + """Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can + be set to either the current date or future date. The window will be created in the time zone + provided and adjusted to daylight savings according to that time zone.""" + expirationDateTime: str + """Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will + be created in the time zone provided and adjusted to daylight savings according to that time + zone. Expiration date must be set to a future date. If not provided, it will be set to the + maximum datetime 9999-12-31 23:59:59.""" + duration: str + """Duration of the maintenance window in HH:mm format. If not provided, default value will be used + based on maintenance scope provided. Example: 05:00.""" + timeZone: str + """Name of the timezone. List of timezones can be obtained by executing + [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, + W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.""" + recurEvery: str + """Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, + weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as + integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule + examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: + [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. + Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly + schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month + days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, + Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 + to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, + recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, + recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.""" + + +class ScheduledEventsIdList(TypedDict, total=False): + """ScheduledEvents Id List. + + :ivar value: The list of ScheduledEvents Id. Required. + :vartype value: list[str] + """ + + value: Required[list[str]] + """The list of ScheduledEvents Id. Required.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TagSettingsProperties(TypedDict, total=False): + """Tag filter information for the VM. + + :ivar tags: Dictionary of tags with its list of values. + :vartype tags: dict[str, list[str]] + :ivar filterOperator: Filter VMs by Any or All specified tags. Known values are: "All" and + "Any". + :vartype filterOperator: Union[str, "TagOperators"] + """ + + tags: dict[str, list[str]] + """Dictionary of tags with its list of values.""" + filterOperator: Union[str, "TagOperators"] + """Filter VMs by Any or All specified tags. Known values are: \"All\" and \"Any\".""" diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update.py index 88d65800c871..f34f38f9e2f3 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdate.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_cancel_maintenance.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_cancel_maintenance.py index 1e3c062bcf42..6c99289a53e1 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_cancel_maintenance.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_cancel_maintenance.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdate_CancelMaintenance.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_CreateOrUpdate_CancelMaintenance.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_only_no_cancellation.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_only_no_cancellation.py index 1a6f1c3bb532..b276656ff50c 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_only_no_cancellation.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_only_no_cancellation.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdateOnly_NoCancellation.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_CreateOrUpdateOnly_NoCancellation.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_parent.py index 638d72883c29..21b7fc42c9c7 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_create_or_update_parent.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdateParent.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_CreateOrUpdateParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get.py index ee93495a66d0..d6fdf3c4a616 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_Get.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_Get.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get_parent.py index c991a52c815c..97507e8dcd77 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_get_parent.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_GetParent.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_GetParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_list.py index ef30c0576215..58ee4d8213c4 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdates_List.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdates_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_resource_group_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_resource_group_list.py index 4540e1dfe098..5a1026013ed7 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_resource_group_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/apply_updates_resource_group_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/ApplyUpdatesResourceGroup_List.json +# x-ms-original-file: 2025-10-01-preview/ApplyUpdatesResourceGroup_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update.py index 8a2f32b891e9..0511bbf2015e 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_CreateOrUpdate.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update_parent.py index 6ba54145209d..028b68b3da3b 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_create_or_update_parent.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_CreateOrUpdateParent.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_CreateOrUpdateParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete.py index ba2c1ad769e6..4bce3f8d6c42 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_Delete.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete_parent.py index d0de58436166..2720e364c0de 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_delete_parent.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_DeleteParent.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_DeleteParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_create_or_update.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_create_or_update.py index 4bd16ff0db8d..030e2d962a0c 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_create_or_update.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_create_or_update.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_delete.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_delete.py index d0a6e44d0b2d..20e1fda99898 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_delete.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_Delete.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForResourceGroup_Delete.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_get.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_get.py index 7e3cd1a47174..e4671d9f3a27 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_get.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_Get.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForResourceGroup_Get.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_update_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_update_for_resource.py index e1331d2cb718..8e83e1efd1f8 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_update_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_resource_group_update_for_resource.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_UpdateForResource.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForResourceGroup_UpdateForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_create_or_update.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_create_or_update.py index 741dc79e6484..1dab05ad11b1 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_create_or_update.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_create_or_update.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_delete.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_delete.py index 676b3057e7db..b1fd8ff37094 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_delete.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_Delete.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForSubscriptions_Delete.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_get.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_get.py index b40f3ba29d47..f3859c24f8f3 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_get.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_Get.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForSubscriptions_Get.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_update_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_update_for_resource.py index 063ee476a693..673f66b000c2 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_update_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_for_subscriptions_update_for_resource.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_UpdateForResource.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsForSubscriptions_UpdateForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get.py index 9816d409820e..e6cdf89a602b 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_Get.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_Get.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get_parent.py index 9ac34b703f5b..58b6452a87d7 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_get_parent.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_GetParent.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_GetParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list.py index 0b94bb7ad9c9..b00346a824d1 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_List.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list_parent.py index fe78b3ca85f9..c16b3283d1a8 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_list_parent.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_ListParent.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignments_ListParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_result_within_subscription_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_result_within_subscription_list.py index 4a2814b06799..eac875a65159 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_result_within_subscription_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/configuration_assignments_result_within_subscription_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsResultWithinSubscription_List.json +# x-ms-original-file: 2025-10-01-preview/ConfigurationAssignmentsResultWithinSubscription_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_create_or_update_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_create_or_update_for_resource.py index 8df347aa55d9..c4c03623788c 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_create_or_update_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_create_or_update_for_resource.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_CreateOrUpdateForResource.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_CreateOrUpdateForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_delete_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_delete_for_resource.py index 1d8f08119bdc..4b75fc4e23ce 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_delete_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_delete_for_resource.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_DeleteForResource.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_DeleteForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource.py index 7d808489a1e8..498eabf71f94 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_GetForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_linux.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_linux.py index 7e7ce778808d..fae5f6d7872a 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_linux.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_linux.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_windows.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_windows.py index f0c7ddfb9b91..0db1d0188a4d 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_windows.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_get_for_resource_guest_os_patch_windows.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_list.py index 18f54ee0dd47..d4cc241b30fa 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_List.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_resource_group_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_resource_group_list.py index 25ecad374438..63fd0b3b99b5 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_resource_group_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_resource_group_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurationsResourceGroup_List.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurationsResourceGroup_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_update_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_update_for_resource.py index 82db004751bd..bce03607c55f 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_update_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/maintenance_configurations_update_for_resource.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_UpdateForResource.json +# x-ms-original-file: 2025-10-01-preview/MaintenanceConfigurations_UpdateForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/operations_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/operations_list.py index 0072cc92b38d..e2f2ec0a6619 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/operations_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/Operations_List.json +# x-ms-original-file: 2025-10-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_get_for_resource.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_get_for_resource.py index 815f001572d2..a78793cfd118 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_get_for_resource.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_get_for_resource.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2023-10-01-preview/PublicMaintenanceConfigurations_GetForResource.json +# x-ms-original-file: 2025-10-01-preview/PublicMaintenanceConfigurations_GetForResource.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_list.py index 5e15d5edb769..1a4ecbccc176 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/public_maintenance_configurations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/PublicMaintenanceConfigurations_List.json +# x-ms-original-file: 2025-10-01-preview/PublicMaintenanceConfigurations_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge.py index 687e1d49e5fe..d015eb7560bd 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge.py @@ -30,15 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.scheduled_event.acknowledge( - resource_group_name="examplerg", - resource_type="virtualMachines", - resource_name="configuration1", - scheduled_event_id="ad6d85cf-2c9e-4eec-9a1e-af3213cc0486", + response = client.scheduled_events.acknowledge( + resource_group_name="resource-group1", + resource_type="resource-type1", + resource_name="resource-name1", + scheduled_event_id="00000000-0000-0000-0000-000000000000", ) print(response) -# x-ms-original-file: 2023-10-01-preview/ScheduledEvents_Acknowledge.json +# x-ms-original-file: 2025-10-01-preview/ScheduledEvents_Acknowledge.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge_list.py new file mode 100644 index 000000000000..b469418b65a1 --- /dev/null +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/scheduled_events_acknowledge_list.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.maintenance import MaintenanceManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-maintenance +# USAGE + python scheduled_events_acknowledge_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MaintenanceManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.scheduled_events.acknowledge_list( + resource_group_name="resource-group1", + resource_type="resource-type1", + resource_name="resource-name1", + scheduled_events_id_list={ + "value": ["00000000-0000-0000-0000-000000000000", "11111111-1111-1111-1111-111111111111"] + }, + ) + print(response) + + +# x-ms-original-file: 2025-10-01-preview/ScheduledEvents_AcknowledgeList.json +if __name__ == "__main__": + main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list.py index 70847da82284..64dffd0c2546 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/Updates_List.json +# x-ms-original-file: 2025-10-01-preview/Updates_List.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list_parent.py b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list_parent.py index 3fae1ec6df65..c2aca53e8744 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list_parent.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_samples/updates_list_parent.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: 2023-10-01-preview/Updates_ListParent.json +# x-ms-original-file: 2025-10-01-preview/Updates_ListParent.json if __name__ == "__main__": main() diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_event_operations.py b/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_events_operations.py similarity index 63% rename from sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_event_operations.py rename to sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_events_operations.py index c09629506707..c841f8d534b6 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_event_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_events_operations.py @@ -14,14 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestMaintenanceManagementScheduledEventOperations(AzureMgmtRecordedTestCase): +class TestMaintenanceManagementScheduledEventsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(MaintenanceManagementClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_scheduled_event_acknowledge(self, resource_group): - response = self.client.scheduled_event.acknowledge( + def test_scheduled_events_acknowledge(self, resource_group): + response = self.client.scheduled_events.acknowledge( resource_group_name=resource_group.name, resource_type="str", resource_name="str", @@ -30,3 +30,16 @@ def test_scheduled_event_acknowledge(self, resource_group): # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_scheduled_events_acknowledge_list(self, resource_group): + response = self.client.scheduled_events.acknowledge_list( + resource_group_name=resource_group.name, + resource_type="str", + resource_name="str", + scheduled_events_id_list={"value": ["str"]}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_event_operations_async.py b/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_events_operations_async.py similarity index 63% rename from sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_event_operations_async.py rename to sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_events_operations_async.py index 4f2fcc554888..3d2f04a3f018 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_event_operations_async.py +++ b/sdk/maintenance/azure-mgmt-maintenance/generated_tests/test_maintenance_management_scheduled_events_operations_async.py @@ -15,14 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestMaintenanceManagementScheduledEventOperationsAsync(AzureMgmtRecordedTestCase): +class TestMaintenanceManagementScheduledEventsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(MaintenanceManagementClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_scheduled_event_acknowledge(self, resource_group): - response = await self.client.scheduled_event.acknowledge( + async def test_scheduled_events_acknowledge(self, resource_group): + response = await self.client.scheduled_events.acknowledge( resource_group_name=resource_group.name, resource_type="str", resource_name="str", @@ -31,3 +31,16 @@ async def test_scheduled_event_acknowledge(self, resource_group): # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_scheduled_events_acknowledge_list(self, resource_group): + response = await self.client.scheduled_events.acknowledge_list( + resource_group_name=resource_group.name, + resource_type="str", + resource_name="str", + scheduled_events_id_list={"value": ["str"]}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/maintenance/azure-mgmt-maintenance/pyproject.toml b/sdk/maintenance/azure-mgmt-maintenance/pyproject.toml index 6833c3ee18d1..1a50fe640f1d 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/pyproject.toml +++ b/sdk/maintenance/azure-mgmt-maintenance/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] requires-python = ">=3.10" keywords = [ diff --git a/sdk/maintenance/azure-mgmt-maintenance/tsp-location.yaml b/sdk/maintenance/azure-mgmt-maintenance/tsp-location.yaml index 5df062688995..99b7aff07f17 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/tsp-location.yaml +++ b/sdk/maintenance/azure-mgmt-maintenance/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance -commit: f34830624e2040e4777496c73aa7c6fe764f4bfc +commit: 5397de7dc9ec4150527dbdc14bf46c1f551305b8 repo: Azure/azure-rest-api-specs additionalDirectories: From 31f3f0115c599da702ae70218daac04c6778055b Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 12:34:33 -0700 Subject: [PATCH 06/35] [AutoPR azure-mgmt-durabletask]-generated-from-SDK Generation - Python-6977093 (#49563) * Configurations: 'specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask/tspconfig.yaml', and CommitSHA: 'd218330c5a3b727df9504ba852e97259479e8fef' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6962944 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md * Configurations: 'specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask/tspconfig.yaml', and CommitSHA: 'f1f796502a81c1cf4d44fe97109e8a71fe8ba485' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6977093 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md --------- Co-authored-by: azure-sdk Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- .../azure-mgmt-durabletask/CHANGELOG.md | 42 + .../azure-mgmt-durabletask/README.md | 6 +- .../azure-mgmt-durabletask/_metadata.json | 11 +- sdk/durabletask/azure-mgmt-durabletask/api.md | 2596 +++++++++ .../azure-mgmt-durabletask/api.metadata.yml | 4 + .../apiview-properties.json | 70 +- .../azure/mgmt/durabletask/_client.py | 44 +- .../azure/mgmt/durabletask/_configuration.py | 12 +- .../azure/mgmt/durabletask/_patch.py | 1 - .../mgmt/durabletask/_utils/model_base.py | 604 ++- .../mgmt/durabletask/_utils/serialization.py | 144 +- .../azure/mgmt/durabletask/_version.py | 2 +- .../azure/mgmt/durabletask/aio/_client.py | 44 +- .../mgmt/durabletask/aio/_configuration.py | 12 +- .../azure/mgmt/durabletask/aio/_patch.py | 1 - .../durabletask/aio/operations/__init__.py | 8 + .../durabletask/aio/operations/_operations.py | 3201 ++++++++++- .../mgmt/durabletask/aio/operations/_patch.py | 1 - .../azure/mgmt/durabletask/models/__init__.py | 50 + .../azure/mgmt/durabletask/models/_enums.py | 99 +- .../azure/mgmt/durabletask/models/_models.py | 778 ++- .../azure/mgmt/durabletask/models/_patch.py | 1 - .../mgmt/durabletask/operations/__init__.py | 8 + .../durabletask/operations/_operations.py | 4791 ++++++++++++++--- .../mgmt/durabletask/operations/_patch.py | 1 - .../azure/mgmt/durabletask/types.py | 721 +++ .../generated_samples/detectors_get.py | 43 + .../detectors_list_by_scheduler.py | 43 + ...ances_create_or_replace_maximum_set_gen.py | 48 + ...ilover_instances_delete_maximum_set_gen.py | 41 + .../failover_instances_failover.py | 42 + ...nstances_force_failover_allow_data_loss.py | 42 + .../failover_instances_get_maximum_set_gen.py | 42 + ...ances_list_by_scheduler_maximum_set_gen.py | 43 + .../generated_samples/operations_list.py | 2 +- ...oint_connections_create_maximum_set_gen.py | 2 +- ...oint_connections_delete_maximum_set_gen.py | 2 +- ...ndpoint_connections_get_maximum_set_gen.py | 2 +- ...dpoint_connections_list_maximum_set_gen.py | 2 +- .../private_endpoint_connections_update.py | 2 +- ...vate_link_resources_get_maximum_set_gen.py | 2 +- ...ate_link_resources_list_maximum_set_gen.py | 2 +- ...icies_create_or_replace_maximum_set_gen.py | 2 +- ...tention_policies_delete_maximum_set_gen.py | 2 +- .../retention_policies_get_maximum_set_gen.py | 2 +- ...icies_list_by_scheduler_maximum_set_gen.py | 2 +- ...tention_policies_update_maximum_set_gen.py | 2 +- .../schedulers_create_or_update.py | 9 +- .../generated_samples/schedulers_delete.py | 2 +- .../generated_samples/schedulers_get.py | 2 +- .../schedulers_list_by_resource_group.py | 2 +- .../schedulers_list_by_subscription.py | 2 +- .../generated_samples/schedulers_restart.py | 41 + .../generated_samples/schedulers_update.py | 3 +- .../task_hubs_create_or_update.py | 4 +- .../generated_samples/task_hubs_delete.py | 2 +- .../generated_samples/task_hubs_get.py | 2 +- .../task_hubs_list_by_scheduler.py | 2 +- .../task_queues_create_or_update.py | 45 + ...ask_queues_create_or_update_minimum_set.py | 45 + .../generated_samples/task_queues_delete.py | 43 + .../generated_samples/task_queues_get.py | 44 + .../task_queues_list_by_task_hub.py | 44 + .../generated_samples/task_queues_update.py | 45 + ...tions_create_or_replace_maximum_set_gen.py | 49 + ...data_encryptions_delete_maximum_set_gen.py | 41 + ...nt_data_encryptions_get_maximum_set_gen.py | 42 + ...tions_list_by_scheduler_maximum_set_gen.py | 43 + ..._durable_task_mgmt_detectors_operations.py | 42 + ...le_task_mgmt_detectors_operations_async.py | 43 + ...task_mgmt_failover_instances_operations.py | 105 + ...gmt_failover_instances_operations_async.py | 114 + ...durable_task_mgmt_schedulers_operations.py | 23 + ...e_task_mgmt_schedulers_operations_async.py | 23 + ..._durable_task_mgmt_task_hubs_operations.py | 2 +- ...le_task_mgmt_task_hubs_operations_async.py | 2 +- ...urable_task_mgmt_task_queues_operations.py | 98 + ..._task_mgmt_task_queues_operations_async.py | 105 + ...transparent_data_encryptions_operations.py | 82 + ...arent_data_encryptions_operations_async.py | 87 + .../azure-mgmt-durabletask/pyproject.toml | 8 +- .../azure-mgmt-durabletask/tsp-location.yaml | 4 +- 82 files changed, 13742 insertions(+), 1130 deletions(-) create mode 100644 sdk/durabletask/azure-mgmt-durabletask/api.md create mode 100644 sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml create mode 100644 sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py diff --git a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md index 837e55f94f5a..8d6de7473856 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md +++ b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md @@ -1,5 +1,47 @@ # Release History +## 1.2.0b1 (2026-10-20) + +### Features Added + + - Client `DurableTaskMgmtClient` added operation group `detectors` + - Client `DurableTaskMgmtClient` added operation group `failover_instances` + - Client `DurableTaskMgmtClient` added operation group `task_queues` + - Client `DurableTaskMgmtClient` added operation group `transparent_data_encryptions` + - Model `Scheduler` added property `identity` + - Model `SchedulerUpdate` added property `identity` + - Model `TaskHubProperties` added property `capabilities` + - Added model `Detector` + - Added model `DetectorDataset` + - Added model `DetectorMetadata` + - Added model `DetectorProperties` + - Added model `DetectorRenderingProperties` + - Added enum `DetectorRenderingType` + - Added model `DetectorStatus` + - Added enum `DetectorStatusId` + - Added model `DetectorTable` + - Added model `DetectorTableColumn` + - Added enum `DetectorType` + - Added model `FailoverInstance` + - Added model `FailoverInstanceProperties` + - Added enum `FailoverState` + - Added model `ManagedServiceIdentity` + - Added enum `ManagedServiceIdentityType` + - Added enum `ReplicationRole` + - Added model `TaskQueue` + - Added model `TaskQueueProperties` + - Added model `TaskQueueThroughput` + - Added model `TaskQueueUpdate` + - Added model `TransparentDataEncryption` + - Added enum `TransparentDataEncryptionKeySource` + - Added model `TransparentDataEncryptionProperties` + - Added model `UserAssignedIdentity` + - Operation group `SchedulersOperations` added method `restart` + - Added operation group `DetectorsOperations` + - Added operation group `FailoverInstancesOperations` + - Added operation group `TaskQueuesOperations` + - Added operation group `TransparentDataEncryptionsOperations` + ## 1.1.0 (2026-03-09) ### Features Added diff --git a/sdk/durabletask/azure-mgmt-durabletask/README.md b/sdk/durabletask/azure-mgmt-durabletask/README.md index dbdf7b3f22de..21085ea54b0b 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/README.md +++ b/sdk/durabletask/azure-mgmt-durabletask/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Durabletask Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/durabletask/azure-mgmt-durabletask/_metadata.json b/sdk/durabletask/azure-mgmt-durabletask/_metadata.json index 2a003262371c..083d4471a81b 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/_metadata.json +++ b/sdk/durabletask/azure-mgmt-durabletask/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2026-02-01", + "apiVersion": "2026-07-01-preview", "apiVersions": { - "Microsoft.DurableTask": "2026-02-01" + "Microsoft.DurableTask": "2026-07-01-preview" }, - "commit": "a86317f00c71ef51aab7f78e6f4a2be3cf58f2cd", + "commit": "f1f796502a81c1cf4d44fe97109e8a71fe8ba485", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/durabletask/DurableTask.Management", - "emitterVersion": "0.60.2" + "typespec_src": "specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask", + "emitterVersion": "0.63.10", + "httpClientPythonVersion": "0.39.0" } \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/api.md b/sdk/durabletask/azure-mgmt-durabletask/api.md new file mode 100644 index 000000000000..d1c0ac9b0d23 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/api.md @@ -0,0 +1,2596 @@ +```py +namespace azure.mgmt.durabletask + + class azure.mgmt.durabletask.DurableTaskMgmtClient: implements ContextManager + detectors: DetectorsOperations + failover_instances: FailoverInstancesOperations + operations: Operations + retention_policies: RetentionPoliciesOperations + schedulers: SchedulersOperations + task_hubs: TaskHubsOperations + task_queues: TaskQueuesOperations + transparent_data_encryptions: TransparentDataEncryptionsOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.durabletask.aio + + class azure.mgmt.durabletask.aio.DurableTaskMgmtClient: implements AsyncContextManager + detectors: DetectorsOperations + failover_instances: FailoverInstancesOperations + operations: Operations + retention_policies: RetentionPoliciesOperations + schedulers: SchedulersOperations + task_hubs: TaskHubsOperations + task_queues: TaskQueuesOperations + transparent_data_encryptions: TransparentDataEncryptionsOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.durabletask.aio.operations + + class azure.mgmt.durabletask.aio.operations.DetectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'detector_id', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + detector_id: str, + **kwargs: Any + ) -> Detector: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Detector]: ... + + + class azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def begin_failover( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def begin_force_failover_allow_data_loss( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> FailoverInstance: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[FailoverInstance]: ... + + + class azure.mgmt.durabletask.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> RetentionPolicy: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[RetentionPolicy]: ... + + + class azure.mgmt.durabletask.aio.operations.SchedulersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> Scheduler: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def get_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnection: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_link_resource_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def get_private_link( + self, + resource_group_name: str, + scheduler_name: str, + private_link_resource_name: str, + **kwargs: Any + ) -> SchedulerPrivateLinkResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Scheduler]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Scheduler]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_endpoint_connections( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PrivateEndpointConnection]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_links( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SchedulerPrivateLinkResource]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + async def restart( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> None: ... + + + class azure.mgmt.durabletask.aio.operations.TaskHubsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskHub]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskHub]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskHub]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> TaskHub: ... + + @distributed_trace + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[TaskHub]: ... + + + class azure.mgmt.durabletask.aio.operations.TaskQueuesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name']}, api_versions_list=['2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> TaskQueue: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_task_hub( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> AsyncItemPaged[TaskQueue]: ... + + + class azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TransparentDataEncryption]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TransparentDataEncryption]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TransparentDataEncryption]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> TransparentDataEncryption: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[TransparentDataEncryption]: ... + + +namespace azure.mgmt.durabletask.models + + class azure.mgmt.durabletask.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.durabletask.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.durabletask.models.Detector(ProxyResource): + id: str + name: str + properties: Optional[DetectorProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[DetectorProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.DetectorDataset(_Model): + rendering_properties: Optional[DetectorRenderingProperties] + table: Optional[DetectorTable] + + + class azure.mgmt.durabletask.models.DetectorMetadata(_Model): + analysis_types: Optional[list[str]] + author: Optional[str] + category: Optional[str] + description: Optional[str] + id: Optional[str] + name: Optional[str] + score: Optional[float] + support_topic_list: Optional[list[str]] + type: Optional[Union[str, DetectorType]] + + + class azure.mgmt.durabletask.models.DetectorProperties(_Model): + dataset: Optional[list[DetectorDataset]] + metadata: Optional[DetectorMetadata] + provisioning_state: Optional[Union[str, ProvisioningState]] + status: Optional[DetectorStatus] + + + class azure.mgmt.durabletask.models.DetectorRenderingProperties(_Model): + description: Optional[str] + title: Optional[str] + type: Optional[Union[int, DetectorRenderingType]] + + + class azure.mgmt.durabletask.models.DetectorRenderingType(int, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_SUMMARY = 5 + DYNAMIC_INSIGHT = 8 + EMAIL_SNIPPET = 6 + INSIGHT = 7 + MARKDOWN = 9 + PIE_CHART = 4 + TABLE = 1 + TIME_SERIES_GRAPH = 2 + TIME_SERIES_PER_INSTANCE_GRAPH = 3 + + + class azure.mgmt.durabletask.models.DetectorStatus(_Model): + message: Optional[str] + status_id: Optional[Union[int, DetectorStatusId]] + + + class azure.mgmt.durabletask.models.DetectorStatusId(int, Enum, metaclass=CaseInsensitiveEnumMeta): + CRITICAL = 0 + INFO = 2 + NONE = 4 + SUCCESS = 3 + WARNING = 1 + + + class azure.mgmt.durabletask.models.DetectorTable(_Model): + columns: Optional[list[DetectorTableColumn]] + rows: Optional[list[list[Any]]] + table_name: Optional[str] + + + class azure.mgmt.durabletask.models.DetectorTableColumn(_Model): + column_name: Optional[str] + column_type: Optional[str] + data_type: Optional[str] + + + class azure.mgmt.durabletask.models.DetectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANALYSIS = "Analysis" + CATEGORY_OVERVIEW = "CategoryOverview" + DETECTOR = "Detector" + + + class azure.mgmt.durabletask.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.durabletask.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.durabletask.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.FailoverInstance(ProxyResource): + id: str + name: str + properties: Optional[FailoverInstanceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[FailoverInstanceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.FailoverInstanceProperties(_Model): + failover_state: Optional[Union[str, FailoverState]] + partner_scheduler_location: Optional[str] + partner_scheduler_resource_id: str + provisioning_state: Optional[Union[str, ProvisioningState]] + replication_role: Optional[Union[str, ReplicationRole]] + + @overload + def __init__( + self, + *, + partner_scheduler_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.FailoverState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NONE = "None" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.durabletask.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.durabletask.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.durabletask.models.OptionalPropertiesUpdateableProperties(_Model): + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.durabletask.models.PrivateEndpoint(_Model): + id: Optional[str] + + + class azure.mgmt.durabletask.models.PrivateEndpointConnection(Resource): + id: str + name: str + properties: Optional[PrivateEndpointConnectionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateEndpointConnectionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateEndpointConnectionProperties(_Model): + group_ids: Optional[list[str]] + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: PrivateLinkServiceConnectionState + provisioning_state: Optional[Union[str, PrivateEndpointConnectionProvisioningState]] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: PrivateLinkServiceConnectionState + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate(_Model): + properties: Optional[OptionalPropertiesUpdateableProperties] + + @overload + def __init__( + self, + *, + properties: Optional[OptionalPropertiesUpdateableProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + PENDING = "Pending" + REJECTED = "Rejected" + + + class azure.mgmt.durabletask.models.PrivateLinkResourceProperties(_Model): + group_id: Optional[str] + required_members: Optional[list[str]] + required_zone_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + required_zone_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateLinkServiceConnectionState(_Model): + actions_required: Optional[str] + description: Optional[str] + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] + + @overload + def __init__( + self, + *, + actions_required: Optional[str] = ..., + description: Optional[str] = ..., + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + PROVISIONING = "Provisioning" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.durabletask.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.durabletask.models.PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.durabletask.models.PurgeableOrchestrationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + COMPLETED = "Completed" + FAILED = "Failed" + TERMINATED = "Terminated" + + + class azure.mgmt.durabletask.models.RedundancyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + ZONE = "Zone" + + + class azure.mgmt.durabletask.models.ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRIMARY = "Primary" + SECONDARY = "Secondary" + + + class azure.mgmt.durabletask.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.durabletask.models.RetentionPolicy(ProxyResource): + id: str + name: str + properties: Optional[RetentionPolicyProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[RetentionPolicyProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.RetentionPolicyDetails(_Model): + orchestration_state: Optional[Union[str, PurgeableOrchestrationState]] + retention_period_in_days: int + + @overload + def __init__( + self, + *, + orchestration_state: Optional[Union[str, PurgeableOrchestrationState]] = ..., + retention_period_in_days: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.RetentionPolicyProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + retention_policies: Optional[list[RetentionPolicyDetails]] + + @overload + def __init__( + self, + *, + retention_policies: Optional[list[RetentionPolicyDetails]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.Scheduler(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[SchedulerProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[SchedulerProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerPrivateLinkResource(Resource): + id: str + name: str + properties: Optional[PrivateLinkResourceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateLinkResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerProperties(_Model): + endpoint: Optional[str] + ip_allowlist: list[str] + private_endpoint_connections: Optional[list[PrivateEndpointConnection]] + provisioning_state: Optional[Union[str, ProvisioningState]] + public_network_access: Optional[Union[str, PublicNetworkAccess]] + sku: SchedulerSku + + @overload + def __init__( + self, + *, + ip_allowlist: list[str], + public_network_access: Optional[Union[str, PublicNetworkAccess]] = ..., + sku: SchedulerSku + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerPropertiesUpdate(_Model): + endpoint: Optional[str] + ip_allowlist: Optional[list[str]] + provisioning_state: Optional[Union[str, ProvisioningState]] + public_network_access: Optional[Union[str, PublicNetworkAccess]] + sku: Optional[SchedulerSkuUpdate] + + @overload + def __init__( + self, + *, + ip_allowlist: Optional[list[str]] = ..., + public_network_access: Optional[Union[str, PublicNetworkAccess]] = ..., + sku: Optional[SchedulerSkuUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerSku(_Model): + capacity: Optional[int] + name: Union[str, SchedulerSkuName] + redundancy_state: Optional[Union[str, RedundancyState]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + name: Union[str, SchedulerSkuName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONSUMPTION = "Consumption" + DEDICATED = "Dedicated" + + + class azure.mgmt.durabletask.models.SchedulerSkuUpdate(_Model): + capacity: Optional[int] + name: Optional[Union[str, SchedulerSkuName]] + redundancy_state: Optional[Union[str, RedundancyState]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + name: Optional[Union[str, SchedulerSkuName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[SchedulerPropertiesUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[SchedulerPropertiesUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskHub(ProxyResource): + id: str + name: str + properties: Optional[TaskHubProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[TaskHubProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskHubProperties(_Model): + capabilities: Optional[list[str]] + dashboard_url: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + capabilities: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueue(ProxyResource): + id: str + name: str + properties: Optional[TaskQueueProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[TaskQueueProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueueProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + throughput: Optional[TaskQueueThroughput] + + @overload + def __init__( + self, + *, + throughput: Optional[TaskQueueThroughput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueueThroughput(_Model): + actions_per_second: Optional[int] + + @overload + def __init__( + self, + *, + actions_per_second: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueueUpdate(_Model): + properties: Optional[TaskQueueProperties] + + @overload + def __init__( + self, + *, + properties: Optional[TaskQueueProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TransparentDataEncryption(ProxyResource): + id: str + name: str + properties: Optional[TransparentDataEncryptionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[TransparentDataEncryptionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TransparentDataEncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOMER_MANAGED = "CustomerManaged" + MICROSOFT_MANAGED = "MicrosoftManaged" + + + class azure.mgmt.durabletask.models.TransparentDataEncryptionProperties(_Model): + auto_rotation_enabled: Optional[bool] + key_source: Union[str, TransparentDataEncryptionKeySource] + key_vault_key_uri: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + auto_rotation_enabled: Optional[bool] = ..., + key_source: Union[str, TransparentDataEncryptionKeySource], + key_vault_key_uri: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + +namespace azure.mgmt.durabletask.operations + + class azure.mgmt.durabletask.operations.DetectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'detector_id', 'accept']}, api_versions_list=['2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + detector_id: str, + **kwargs: Any + ) -> Detector: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[Detector]: ... + + + class azure.mgmt.durabletask.operations.FailoverInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def begin_failover( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def begin_force_failover_allow_data_loss( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> FailoverInstance: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[FailoverInstance]: ... + + + class azure.mgmt.durabletask.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.durabletask.operations.RetentionPoliciesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> RetentionPolicy: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[RetentionPolicy]: ... + + + class azure.mgmt.durabletask.operations.SchedulersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> Scheduler: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def get_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnection: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_link_resource_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def get_private_link( + self, + resource_group_name: str, + scheduler_name: str, + private_link_resource_name: str, + **kwargs: Any + ) -> SchedulerPrivateLinkResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Scheduler]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Scheduler]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_endpoint_connections( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[PrivateEndpointConnection]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_links( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[SchedulerPrivateLinkResource]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def restart( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> None: ... + + + class azure.mgmt.durabletask.operations.TaskHubsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskHub]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskHub]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskHub]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> TaskHub: ... + + @distributed_trace + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[TaskHub]: ... + + + class azure.mgmt.durabletask.operations.TaskQueuesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name']}, api_versions_list=['2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> TaskQueue: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_task_hub( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> ItemPaged[TaskQueue]: ... + + + class azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TransparentDataEncryption]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TransparentDataEncryption]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TransparentDataEncryption]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> TransparentDataEncryption: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[TransparentDataEncryption]: ... + + +namespace azure.mgmt.durabletask.types + + class azure.mgmt.durabletask.types.FailoverInstance(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('FailoverInstanceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: FailoverInstanceProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.FailoverInstanceProperties(TypedDict, total=False): + key "failoverState": Union[str, FailoverState] + key "partnerSchedulerLocation": str + key "partnerSchedulerResourceId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "replicationRole": Union[str, ReplicationRole] + failoverState: Union[str, FailoverState] + partnerSchedulerLocation: str + partnerSchedulerResourceId: str + provisioningState: Union[str, ProvisioningState] + replicationRole: Union[str, ReplicationRole] + + + class azure.mgmt.durabletask.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principalId: str + tenantId: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.durabletask.types.OptionalPropertiesUpdateableProperties(TypedDict, total=False): + key "privateEndpoint": ForwardRef('PrivateEndpoint', module='types') + key "privateLinkServiceConnectionState": ForwardRef('PrivateLinkServiceConnectionState', module='types') + privateEndpoint: PrivateEndpoint + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState + + + class azure.mgmt.durabletask.types.PrivateEndpoint(TypedDict, total=False): + key "id": str + id: str + + + class azure.mgmt.durabletask.types.PrivateEndpointConnection(Resource): + key "id": str + key "name": str + key "properties": ForwardRef('PrivateEndpointConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PrivateEndpointConnectionProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.PrivateEndpointConnectionProperties(TypedDict, total=False): + key "privateEndpoint": ForwardRef('PrivateEndpoint', module='types') + key "privateLinkServiceConnectionState": Required[PrivateLinkServiceConnectionState] + key "provisioningState": Union[str, PrivateEndpointConnectionProvisioningState] + groupIds: list[str] + privateEndpoint: PrivateEndpoint + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState + provisioningState: Union[str, PrivateEndpointConnectionProvisioningState] + + + class azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate(TypedDict, total=False): + key "properties": ForwardRef('OptionalPropertiesUpdateableProperties', module='types') + properties: OptionalPropertiesUpdateableProperties + + + class azure.mgmt.durabletask.types.PrivateLinkServiceConnectionState(TypedDict, total=False): + key "actionsRequired": str + key "description": str + key "status": Union[str, PrivateEndpointServiceConnectionStatus] + actionsRequired: str + description: str + status: Union[str, PrivateEndpointServiceConnectionStatus] + + + class azure.mgmt.durabletask.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.RetentionPolicy(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('RetentionPolicyProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: RetentionPolicyProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.RetentionPolicyDetails(TypedDict, total=False): + key "orchestrationState": Union[str, PurgeableOrchestrationState] + key "retentionPeriodInDays": Required[int] + orchestrationState: Union[str, PurgeableOrchestrationState] + retentionPeriodInDays: int + + + class azure.mgmt.durabletask.types.RetentionPolicyProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + provisioningState: Union[str, ProvisioningState] + retentionPolicies: list[RetentionPolicyDetails] + + + class azure.mgmt.durabletask.types.Scheduler(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('SchedulerProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: SchedulerProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.durabletask.types.SchedulerProperties(TypedDict, total=False): + key "endpoint": str + key "ipAllowlist": Required[list[str]] + key "provisioningState": Union[str, ProvisioningState] + key "publicNetworkAccess": Union[str, PublicNetworkAccess] + key "sku": Required[SchedulerSku] + endpoint: str + ipAllowlist: list[str] + privateEndpointConnections: list[PrivateEndpointConnection] + provisioningState: Union[str, ProvisioningState] + publicNetworkAccess: Union[str, PublicNetworkAccess] + sku: SchedulerSku + + + class azure.mgmt.durabletask.types.SchedulerPropertiesUpdate(TypedDict, total=False): + key "endpoint": str + key "provisioningState": Union[str, ProvisioningState] + key "publicNetworkAccess": Union[str, PublicNetworkAccess] + key "sku": ForwardRef('SchedulerSkuUpdate', module='types') + endpoint: str + ipAllowlist: list[str] + provisioningState: Union[str, ProvisioningState] + publicNetworkAccess: Union[str, PublicNetworkAccess] + sku: SchedulerSkuUpdate + + + class azure.mgmt.durabletask.types.SchedulerSku(TypedDict, total=False): + key "capacity": int + key "name": Required[Union[str, SchedulerSkuName]] + key "redundancyState": Union[str, RedundancyState] + capacity: int + name: Union[str, SchedulerSkuName] + redundancyState: Union[str, RedundancyState] + + + class azure.mgmt.durabletask.types.SchedulerSkuUpdate(TypedDict, total=False): + key "capacity": int + key "name": Union[str, SchedulerSkuName] + key "redundancyState": Union[str, RedundancyState] + capacity: int + name: Union[str, SchedulerSkuName] + redundancyState: Union[str, RedundancyState] + + + class azure.mgmt.durabletask.types.SchedulerUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('SchedulerPropertiesUpdate', module='types') + identity: ManagedServiceIdentity + properties: SchedulerPropertiesUpdate + tags: dict[str, str] + + + class azure.mgmt.durabletask.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.durabletask.types.TaskHub(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('TaskHubProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: TaskHubProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.TaskHubProperties(TypedDict, total=False): + key "dashboardUrl": str + key "provisioningState": Union[str, ProvisioningState] + capabilities: list[str] + dashboardUrl: str + provisioningState: Union[str, ProvisioningState] + + + class azure.mgmt.durabletask.types.TaskQueue(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('TaskQueueProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: TaskQueueProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.TaskQueueProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + key "throughput": ForwardRef('TaskQueueThroughput', module='types') + provisioningState: Union[str, ProvisioningState] + throughput: TaskQueueThroughput + + + class azure.mgmt.durabletask.types.TaskQueueThroughput(TypedDict, total=False): + key "actionsPerSecond": int + actionsPerSecond: int + + + class azure.mgmt.durabletask.types.TaskQueueUpdate(TypedDict, total=False): + key "properties": ForwardRef('TaskQueueProperties', module='types') + properties: TaskQueueProperties + + + class azure.mgmt.durabletask.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.durabletask.types.TransparentDataEncryption(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('TransparentDataEncryptionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: TransparentDataEncryptionProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.TransparentDataEncryptionProperties(TypedDict, total=False): + key "autoRotationEnabled": bool + key "keySource": Required[Union[str, TransparentDataEncryptionKeySource]] + key "keyVaultKeyUri": str + key "provisioningState": Union[str, ProvisioningState] + autoRotationEnabled: bool + keySource: Union[str, TransparentDataEncryptionKeySource] + keyVaultKeyUri: str + provisioningState: Union[str, ProvisioningState] + + + class azure.mgmt.durabletask.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + clientId: str + principalId: str + + +``` \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml b/sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml new file mode 100644 index 000000000000..a334e84b75fc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml @@ -0,0 +1,4 @@ +apiMdSha256: 37226e58cfa0e1a3b7bd1f41554efd66701d1e0f7b3ab541fd24dad8331f74a1 +packageVersion: 1.2.0b1 +parserVersion: 0.3.31 +pythonVersion: 3.13.16 diff --git a/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json b/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json index 529451e3fd12..9d611cdaae23 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json +++ b/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json @@ -1,20 +1,31 @@ { "CrossLanguagePackageId": "Microsoft.DurableTask", "CrossLanguageDefinitionId": { + "azure.mgmt.durabletask.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.durabletask.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.durabletask.models.Detector": "Microsoft.DurableTask.Detector", + "azure.mgmt.durabletask.models.DetectorDataset": "Microsoft.DurableTask.DetectorDataset", + "azure.mgmt.durabletask.models.DetectorMetadata": "Microsoft.DurableTask.DetectorMetadata", + "azure.mgmt.durabletask.models.DetectorProperties": "Microsoft.DurableTask.DetectorProperties", + "azure.mgmt.durabletask.models.DetectorRenderingProperties": "Microsoft.DurableTask.DetectorRenderingProperties", + "azure.mgmt.durabletask.models.DetectorStatus": "Microsoft.DurableTask.DetectorStatus", + "azure.mgmt.durabletask.models.DetectorTable": "Microsoft.DurableTask.DetectorTable", + "azure.mgmt.durabletask.models.DetectorTableColumn": "Microsoft.DurableTask.DetectorTableColumn", "azure.mgmt.durabletask.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.durabletask.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.durabletask.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.durabletask.models.FailoverInstance": "Microsoft.DurableTask.FailoverInstance", + "azure.mgmt.durabletask.models.FailoverInstanceProperties": "Microsoft.DurableTask.FailoverInstanceProperties", + "azure.mgmt.durabletask.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", "azure.mgmt.durabletask.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.durabletask.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", "azure.mgmt.durabletask.models.OptionalPropertiesUpdateableProperties": "TypeSpec.OptionalProperties", "azure.mgmt.durabletask.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", - "azure.mgmt.durabletask.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.durabletask.models.PrivateEndpointConnection": "Microsoft.DurableTask.PrivateEndpointConnection", "azure.mgmt.durabletask.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", "azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate": "Azure.ResourceManager.PrivateEndpointConnectionUpdate", "azure.mgmt.durabletask.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", "azure.mgmt.durabletask.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", - "azure.mgmt.durabletask.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", "azure.mgmt.durabletask.models.RetentionPolicy": "Microsoft.DurableTask.RetentionPolicy", "azure.mgmt.durabletask.models.RetentionPolicyDetails": "Microsoft.DurableTask.RetentionPolicyDetails", "azure.mgmt.durabletask.models.RetentionPolicyProperties": "Microsoft.DurableTask.RetentionPolicyProperties", @@ -29,18 +40,36 @@ "azure.mgmt.durabletask.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.durabletask.models.TaskHub": "Microsoft.DurableTask.TaskHub", "azure.mgmt.durabletask.models.TaskHubProperties": "Microsoft.DurableTask.TaskHubProperties", + "azure.mgmt.durabletask.models.TaskQueue": "Microsoft.DurableTask.TaskQueue", + "azure.mgmt.durabletask.models.TaskQueueProperties": "Microsoft.DurableTask.TaskQueueProperties", + "azure.mgmt.durabletask.models.TaskQueueThroughput": "Microsoft.DurableTask.TaskQueueThroughput", + "azure.mgmt.durabletask.models.TaskQueueUpdate": "Microsoft.DurableTask.TaskQueueUpdate", + "azure.mgmt.durabletask.models.TransparentDataEncryption": "Microsoft.DurableTask.TransparentDataEncryption", + "azure.mgmt.durabletask.models.TransparentDataEncryptionProperties": "Microsoft.DurableTask.TransparentDataEncryptionProperties", + "azure.mgmt.durabletask.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.durabletask.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.durabletask.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.durabletask.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", "azure.mgmt.durabletask.models.ProvisioningState": "Microsoft.DurableTask.ProvisioningState", + "azure.mgmt.durabletask.models.DetectorType": "Microsoft.DurableTask.DetectorType", + "azure.mgmt.durabletask.models.DetectorRenderingType": "Microsoft.DurableTask.DetectorRenderingType", + "azure.mgmt.durabletask.models.DetectorStatusId": "Microsoft.DurableTask.DetectorStatusId", "azure.mgmt.durabletask.models.SchedulerSkuName": "Microsoft.DurableTask.SchedulerSkuName", "azure.mgmt.durabletask.models.RedundancyState": "Microsoft.DurableTask.RedundancyState", "azure.mgmt.durabletask.models.PublicNetworkAccess": "Microsoft.DurableTask.PublicNetworkAccess", "azure.mgmt.durabletask.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", "azure.mgmt.durabletask.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "azure.mgmt.durabletask.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.durabletask.models.PurgeableOrchestrationState": "Microsoft.DurableTask.PurgeableOrchestrationState", + "azure.mgmt.durabletask.models.TransparentDataEncryptionKeySource": "Microsoft.DurableTask.TransparentDataEncryptionKeySource", + "azure.mgmt.durabletask.models.ReplicationRole": "Microsoft.DurableTask.ReplicationRole", + "azure.mgmt.durabletask.models.FailoverState": "Microsoft.DurableTask.FailoverState", "azure.mgmt.durabletask.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.durabletask.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.durabletask.operations.DetectorsOperations.get": "Microsoft.DurableTask.Detectors.get", + "azure.mgmt.durabletask.aio.operations.DetectorsOperations.get": "Microsoft.DurableTask.Detectors.get", + "azure.mgmt.durabletask.operations.DetectorsOperations.list_by_scheduler": "Microsoft.DurableTask.Detectors.listByScheduler", + "azure.mgmt.durabletask.aio.operations.DetectorsOperations.list_by_scheduler": "Microsoft.DurableTask.Detectors.listByScheduler", "azure.mgmt.durabletask.operations.SchedulersOperations.get": "Microsoft.DurableTask.Schedulers.get", "azure.mgmt.durabletask.aio.operations.SchedulersOperations.get": "Microsoft.DurableTask.Schedulers.get", "azure.mgmt.durabletask.operations.SchedulersOperations.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate", @@ -67,6 +96,8 @@ "azure.mgmt.durabletask.aio.operations.SchedulersOperations.begin_delete_private_endpoint_connection": "Microsoft.DurableTask.Schedulers.deletePrivateEndpointConnection", "azure.mgmt.durabletask.operations.SchedulersOperations.list_private_endpoint_connections": "Microsoft.DurableTask.Schedulers.listPrivateEndpointConnections", "azure.mgmt.durabletask.aio.operations.SchedulersOperations.list_private_endpoint_connections": "Microsoft.DurableTask.Schedulers.listPrivateEndpointConnections", + "azure.mgmt.durabletask.operations.SchedulersOperations.restart": "Microsoft.DurableTask.Schedulers.restart", + "azure.mgmt.durabletask.aio.operations.SchedulersOperations.restart": "Microsoft.DurableTask.Schedulers.restart", "azure.mgmt.durabletask.operations.TaskHubsOperations.get": "Microsoft.DurableTask.TaskHubs.get", "azure.mgmt.durabletask.aio.operations.TaskHubsOperations.get": "Microsoft.DurableTask.TaskHubs.get", "azure.mgmt.durabletask.operations.TaskHubsOperations.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate", @@ -75,6 +106,16 @@ "azure.mgmt.durabletask.aio.operations.TaskHubsOperations.begin_delete": "Microsoft.DurableTask.TaskHubs.delete", "azure.mgmt.durabletask.operations.TaskHubsOperations.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler", "azure.mgmt.durabletask.aio.operations.TaskHubsOperations.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.get": "Microsoft.DurableTask.TaskQueues.get", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.get": "Microsoft.DurableTask.TaskQueues.get", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.begin_create_or_update": "Microsoft.DurableTask.TaskQueues.createOrUpdate", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.begin_create_or_update": "Microsoft.DurableTask.TaskQueues.createOrUpdate", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.begin_update": "Microsoft.DurableTask.TaskQueues.update", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.begin_update": "Microsoft.DurableTask.TaskQueues.update", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.begin_delete": "Microsoft.DurableTask.TaskQueues.delete", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.begin_delete": "Microsoft.DurableTask.TaskQueues.delete", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.list_by_task_hub": "Microsoft.DurableTask.TaskQueues.listByTaskHub", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.list_by_task_hub": "Microsoft.DurableTask.TaskQueues.listByTaskHub", "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.get": "Microsoft.DurableTask.RetentionPolicies.get", "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.get": "Microsoft.DurableTask.RetentionPolicies.get", "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_create_or_replace": "Microsoft.DurableTask.RetentionPolicies.createOrReplace", @@ -84,6 +125,27 @@ "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete", "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete", "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler", - "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler" - } + "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.get": "Microsoft.DurableTask.TransparentDataEncryptions.get", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.get": "Microsoft.DurableTask.TransparentDataEncryptions.get", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.begin_create_or_replace": "Microsoft.DurableTask.TransparentDataEncryptions.createOrReplace", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.begin_create_or_replace": "Microsoft.DurableTask.TransparentDataEncryptions.createOrReplace", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.begin_delete": "Microsoft.DurableTask.TransparentDataEncryptions.delete", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.begin_delete": "Microsoft.DurableTask.TransparentDataEncryptions.delete", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.list_by_scheduler": "Microsoft.DurableTask.TransparentDataEncryptions.listByScheduler", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.list_by_scheduler": "Microsoft.DurableTask.TransparentDataEncryptions.listByScheduler", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.get": "Microsoft.DurableTask.FailoverInstances.get", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.get": "Microsoft.DurableTask.FailoverInstances.get", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_create_or_replace": "Microsoft.DurableTask.FailoverInstances.createOrReplace", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_create_or_replace": "Microsoft.DurableTask.FailoverInstances.createOrReplace", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_delete": "Microsoft.DurableTask.FailoverInstances.delete", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_delete": "Microsoft.DurableTask.FailoverInstances.delete", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.list_by_scheduler": "Microsoft.DurableTask.FailoverInstances.listByScheduler", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.list_by_scheduler": "Microsoft.DurableTask.FailoverInstances.listByScheduler", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_failover": "Microsoft.DurableTask.FailoverInstances.failover", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_failover": "Microsoft.DurableTask.FailoverInstances.failover", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_force_failover_allow_data_loss": "Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_force_failover_allow_data_loss": "Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss" + }, + "CrossLanguageVersion": "1df18bc0d591" } \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py index 0fd9b1d201e6..a1580cb336f1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -19,24 +19,47 @@ from ._configuration import DurableTaskMgmtClientConfiguration from ._utils.serialization import Deserializer, Serializer -from .operations import Operations, RetentionPoliciesOperations, SchedulersOperations, TaskHubsOperations +from .operations import ( + DetectorsOperations, + FailoverInstancesOperations, + Operations, + RetentionPoliciesOperations, + SchedulersOperations, + TaskHubsOperations, + TaskQueuesOperations, + TransparentDataEncryptionsOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class DurableTaskMgmtClient: +class DurableTaskMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """DurableTaskMgmtClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.durabletask.operations.Operations + :ivar detectors: DetectorsOperations operations + :vartype detectors: azure.mgmt.durabletask.operations.DetectorsOperations :ivar schedulers: SchedulersOperations operations :vartype schedulers: azure.mgmt.durabletask.operations.SchedulersOperations :ivar task_hubs: TaskHubsOperations operations :vartype task_hubs: azure.mgmt.durabletask.operations.TaskHubsOperations + :ivar task_queues: TaskQueuesOperations operations + :vartype task_queues: azure.mgmt.durabletask.operations.TaskQueuesOperations :ivar retention_policies: RetentionPoliciesOperations operations :vartype retention_policies: azure.mgmt.durabletask.operations.RetentionPoliciesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations + :ivar failover_instances: FailoverInstancesOperations operations + :vartype failover_instances: azure.mgmt.durabletask.operations.FailoverInstancesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -46,9 +69,10 @@ class DurableTaskMgmtClient: :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -102,11 +126,19 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.detectors = DetectorsOperations(self._client, self._config, self._serialize, self._deserialize) self.schedulers = SchedulersOperations(self._client, self._config, self._serialize, self._deserialize) self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) + self.task_queues = TaskQueuesOperations(self._client, self._config, self._serialize, self._deserialize) self.retention_policies = RetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.failover_instances = FailoverInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py index c3cb9d9052ef..c42eaedef1e1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials import TokenCredential -class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for DurableTaskMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,9 +34,10 @@ class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-a :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-02-01") + api_version: str = kwargs.pop("api_version", "2026-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py index b4433021b4e5..35d5fc024978 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -130,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -296,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -308,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -325,12 +373,18 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: @@ -420,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +614,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +640,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,59 +883,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -664,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -690,6 +1038,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -718,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -891,6 +1242,8 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore @@ -1049,6 +1402,7 @@ def _failsafe_deserialize_xml( return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -1061,6 +1415,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1068,10 +1423,12 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1091,7 +1448,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1104,7 +1464,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1150,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1159,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1183,6 +1549,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1194,10 +1610,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1219,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1231,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1245,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1252,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1261,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1279,8 +1702,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1301,11 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1316,6 +1758,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py index 81ec1de5922b..ae08f9d89f74 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -476,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -516,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1460,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py index ed0855dea5e6..5bf479b145f7 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "1.2.0b1" diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py index c8a870228efa..9ed283cdf0fd 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -19,24 +19,47 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import DurableTaskMgmtClientConfiguration -from .operations import Operations, RetentionPoliciesOperations, SchedulersOperations, TaskHubsOperations +from .operations import ( + DetectorsOperations, + FailoverInstancesOperations, + Operations, + RetentionPoliciesOperations, + SchedulersOperations, + TaskHubsOperations, + TaskQueuesOperations, + TransparentDataEncryptionsOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class DurableTaskMgmtClient: +class DurableTaskMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """DurableTaskMgmtClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.durabletask.aio.operations.Operations + :ivar detectors: DetectorsOperations operations + :vartype detectors: azure.mgmt.durabletask.aio.operations.DetectorsOperations :ivar schedulers: SchedulersOperations operations :vartype schedulers: azure.mgmt.durabletask.aio.operations.SchedulersOperations :ivar task_hubs: TaskHubsOperations operations :vartype task_hubs: azure.mgmt.durabletask.aio.operations.TaskHubsOperations + :ivar task_queues: TaskQueuesOperations operations + :vartype task_queues: azure.mgmt.durabletask.aio.operations.TaskQueuesOperations :ivar retention_policies: RetentionPoliciesOperations operations :vartype retention_policies: azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations + :ivar failover_instances: FailoverInstancesOperations operations + :vartype failover_instances: azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -46,9 +69,10 @@ class DurableTaskMgmtClient: :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -104,11 +128,19 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.detectors = DetectorsOperations(self._client, self._config, self._serialize, self._deserialize) self.schedulers = SchedulersOperations(self._client, self._config, self._serialize, self._deserialize) self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) + self.task_queues = TaskQueuesOperations(self._client, self._config, self._serialize, self._deserialize) self.retention_policies = RetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.failover_instances = FailoverInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py index 5e2132b7f447..27b5ced74578 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for DurableTaskMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,9 +34,10 @@ class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-a :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-02-01") + api_version: str = kwargs.pop("api_version", "2026-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py index 18dc884c6cc0..2c8eaa1bc1f9 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py @@ -13,9 +13,13 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore +from ._operations import DetectorsOperations # type: ignore from ._operations import SchedulersOperations # type: ignore from ._operations import TaskHubsOperations # type: ignore +from ._operations import TaskQueuesOperations # type: ignore from ._operations import RetentionPoliciesOperations # type: ignore +from ._operations import TransparentDataEncryptionsOperations # type: ignore +from ._operations import FailoverInstancesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -23,9 +27,13 @@ __all__ = [ "Operations", + "DetectorsOperations", "SchedulersOperations", "TaskHubsOperations", + "TaskQueuesOperations", "RetentionPoliciesOperations", + "TransparentDataEncryptionsOperations", + "FailoverInstancesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py index 37fea430dd4a..3540d35ccc12 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py @@ -33,11 +33,19 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation from ...operations._operations import ( + build_detectors_get_request, + build_detectors_list_by_scheduler_request, + build_failover_instances_create_or_replace_request, + build_failover_instances_delete_request, + build_failover_instances_failover_request, + build_failover_instances_force_failover_allow_data_loss_request, + build_failover_instances_get_request, + build_failover_instances_list_by_scheduler_request, build_operations_list_request, build_retention_policies_create_or_replace_request, build_retention_policies_delete_request, @@ -55,22 +63,31 @@ build_schedulers_list_by_subscription_request, build_schedulers_list_private_endpoint_connections_request, build_schedulers_list_private_links_request, + build_schedulers_restart_request, build_schedulers_update_private_endpoint_connection_request, build_schedulers_update_request, build_task_hubs_create_or_update_request, build_task_hubs_delete_request, build_task_hubs_get_request, build_task_hubs_list_by_scheduler_request, + build_task_queues_create_or_update_request, + build_task_queues_delete_request, + build_task_queues_get_request, + build_task_queues_list_by_task_hub_request, + build_task_queues_update_request, + build_transparent_data_encryptions_create_or_replace_request, + build_transparent_data_encryptions_delete_request, + build_transparent_data_encryptions_get_request, + build_transparent_data_encryptions_list_by_scheduler_request, ) from .._configuration import DurableTaskMgmtClientConfiguration T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -134,7 +151,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -177,7 +197,223 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class SchedulersOperations: +class DetectorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`detectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "detector_id", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def get( + self, resource_group_name: str, scheduler_name: str, detector_id: str, **kwargs: Any + ) -> _models.Detector: + """Gets a diagnostic detector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param detector_id: The name of the Detector. Required. + :type detector_id: str + :return: Detector. The Detector is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.Detector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Detector] = kwargs.pop("cls", None) + + _request = build_detectors_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + detector_id=detector_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Detector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Detector"]: + """Lists the diagnostic detectors belonging to a scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of Detector + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Detector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Detector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_detectors_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Detector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SchedulersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -268,7 +504,7 @@ async def _create_or_update_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -374,7 +610,7 @@ async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + resource: _types.Scheduler, *, content_type: str = "application/json", **kwargs: Any @@ -387,7 +623,7 @@ async def begin_create_or_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.Scheduler :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -430,7 +666,7 @@ async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Scheduler]: """Create or update a Scheduler. @@ -440,9 +676,10 @@ async def begin_create_or_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: Scheduler, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.Scheduler or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Scheduler type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.Scheduler or + ~azure.mgmt.durabletask.types.Scheduler or IO[bytes] :return: An instance of AsyncLROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -504,7 +741,7 @@ async def _update_initial( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -608,7 +845,7 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: JSON, + properties: _types.SchedulerUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -621,7 +858,7 @@ async def begin_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.SchedulerUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -664,7 +901,7 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Scheduler]: """Update a Scheduler. @@ -674,9 +911,10 @@ async def begin_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - SchedulerUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a SchedulerUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or + ~azure.mgmt.durabletask.types.SchedulerUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -904,7 +1142,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -994,7 +1235,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1049,7 +1293,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def get_private_link( self, resource_group_name: str, scheduler_name: str, private_link_resource_name: str, **kwargs: Any @@ -1133,7 +1377,7 @@ async def get_private_link( params_added_on={ "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) def list_private_links( self, resource_group_name: str, scheduler_name: str, **kwargs: Any @@ -1192,7 +1436,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1247,7 +1494,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def get_private_endpoint_connection( self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -1338,14 +1585,14 @@ async def get_private_endpoint_connection( "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def _create_or_update_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1458,7 +1705,7 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - resource: JSON, + resource: _types.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any @@ -1474,7 +1721,7 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable with the Azure resource. Required. :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1532,14 +1779,14 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: """Create or update a private endpoint connection for the durable task scheduler. @@ -1552,9 +1799,10 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Is one of the following types: - PrivateEndpointConnection, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a PrivateEndpointConnection type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or + ~azure.mgmt.durabletask.types.PrivateEndpointConnection or IO[bytes] :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The PrivateEndpointConnection is compatible with MutableMapping :rtype: @@ -1627,14 +1875,14 @@ def get_long_running_output(pipeline_response): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def _update_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1745,7 +1993,7 @@ async def begin_update_private_endpoint_connection( resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - properties: JSON, + properties: _types.PrivateEndpointConnectionUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1761,7 +2009,7 @@ async def begin_update_private_endpoint_connection( with the Azure resource. Required. :type private_endpoint_connection_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1819,14 +2067,14 @@ async def begin_update_private_endpoint_connection( "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def begin_update_private_endpoint_connection( self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: """Update a private endpoint connection for the durable task scheduler. @@ -1839,10 +2087,10 @@ async def begin_update_private_endpoint_connection( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PrivateEndpointConnectionUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + PrivateEndpointConnectionUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or + ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The PrivateEndpointConnection is compatible with MutableMapping :rtype: @@ -1913,7 +2161,7 @@ def get_long_running_output(pipeline_response): "private_endpoint_connection_name", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -1989,7 +2237,7 @@ async def _delete_private_endpoint_connection_initial( # pylint: disable=name-t "private_endpoint_connection_name", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def begin_delete_private_endpoint_connection( self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -2059,7 +2307,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) def list_private_endpoint_connections( self, resource_group_name: str, scheduler_name: str, **kwargs: Any @@ -2118,7 +2366,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2160,8 +2411,72 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def restart(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> None: + """Restart a Scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_schedulers_restart_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore -class TaskHubsOperations: + +class TaskHubsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2258,7 +2573,7 @@ async def _create_or_update_initial( resource_group_name: str, scheduler_name: str, task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2369,7 +2684,7 @@ async def begin_create_or_update( resource_group_name: str, scheduler_name: str, task_hub_name: str, - resource: JSON, + resource: _types.TaskHub, *, content_type: str = "application/json", **kwargs: Any @@ -2384,7 +2699,7 @@ async def begin_create_or_update( :param task_hub_name: The name of the TaskHub. Required. :type task_hub_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.TaskHub :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2431,7 +2746,7 @@ async def begin_create_or_update( resource_group_name: str, scheduler_name: str, task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.TaskHub]: """Create or Update a Task Hub. @@ -2443,9 +2758,10 @@ async def begin_create_or_update( :type scheduler_name: str :param task_hub_name: The name of the TaskHub. Required. :type task_hub_name: str - :param resource: Resource create parameters. Is one of the following types: TaskHub, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub or ~azure.mgmt.durabletask.types.TaskHub + or IO[bytes] :return: An instance of AsyncLROPoller that returns TaskHub. The TaskHub is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskHub] @@ -2685,7 +3001,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2728,14 +3047,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class RetentionPoliciesOperations: +class TaskQueuesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s - :attr:`retention_policies` attribute. + :attr:`task_queues` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2747,22 +3066,36 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "accept", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: - """Get a Retention Policy. + async def get( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> _models.TaskQueue: + """Get a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :return: TaskQueue. The TaskQueue is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TaskQueue :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2776,11 +3109,13 @@ async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) - _request = build_retention_policies_get_request( + _request = build_task_queues_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2815,7 +3150,7 @@ async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.TaskQueue, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2823,24 +3158,28 @@ async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any return deserialized # type: ignore @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def _create_or_replace_initial( + async def _create_or_update_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2864,9 +3203,11 @@ async def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_retention_policies_create_or_replace_request( + _request = build_task_queues_create_or_update_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2914,138 +3255,167 @@ async def _create_or_replace_initial( return deserialized # type: ignore @overload - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: _models.RetentionPolicy, + task_hub_name: str, + task_queue_name: str, + resource: _models.TaskQueue, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy + :type resource: ~azure.mgmt.durabletask.models.TaskQueue :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + task_hub_name: str, + task_queue_name: str, + resource: _types.TaskQueue, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.TaskQueue :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, + task_hub_name: str, + task_queue_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: RetentionPolicy, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Is either a TaskQueue type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskQueue or + ~azure.mgmt.durabletask.types.TaskQueue or IO[bytes] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_replace_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -3058,7 +3428,7 @@ async def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.TaskQueue, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3076,35 +3446,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + return AsyncLROPoller[_models.TaskQueue].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.RetentionPolicy]( + return AsyncLROPoller[_models.TaskQueue]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) async def _update_initial( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3128,9 +3502,11 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_retention_policies_update_request( + _request = build_task_queues_update_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3180,26 +3556,32 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: _models.RetentionPolicy, + task_hub_name: str, + task_queue_name: str, + properties: _models.TaskQueueUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3208,26 +3590,32 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: JSON, + task_hub_name: str, + task_queue_name: str, + properties: _types.TaskQueueUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.TaskQueueUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3236,71 +3624,86 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, + task_hub_name: str, + task_queue_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - RetentionPolicy, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Is either a TaskQueueUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate or + ~azure.mgmt.durabletask.types.TaskQueueUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -3308,6 +3711,8 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -3320,7 +3725,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.TaskQueue, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3338,25 +3743,32 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + return AsyncLROPoller[_models.TaskQueue].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.RetentionPolicy]( + return AsyncLROPoller[_models.TaskQueue]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) async def _delete_initial( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3371,9 +3783,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_retention_policies_delete_request( + _request = build_task_queues_delete_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3418,20 +3832,33 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a Retention Policy. + async def begin_delete( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3447,6 +3874,8 @@ async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kw raw_result = await self._delete_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3482,30 +3911,39 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "accept", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def list_by_scheduler( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RetentionPolicy"]: - """List Retention Policies. + def list_by_task_hub( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.TaskQueue"]: + """List Task Queues by Task Hub. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of RetentionPolicy - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: An iterator like instance of TaskQueue + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.TaskQueue]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3518,9 +3956,10 @@ def list_by_scheduler( def prepare_request(next_link=None): if not next_link: - _request = build_retention_policies_list_by_scheduler_request( + _request = build_task_queues_list_by_task_hub_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3544,7 +3983,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3558,7 +4000,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RetentionPolicy], + List[_models.TaskQueue], deserialized.get("value", []), ) if cls: @@ -3585,3 +4027,2406 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) + + +class RetentionPoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: + """Get a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + + _request = build_retention_policies_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_retention_policies_create_or_replace_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _models.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _types.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.RetentionPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Is either a RetentionPolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def _update_initial( + self, + resource_group_name: str, + scheduler_name: str, + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_retention_policies_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: _models.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: _types.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.types.RetentionPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Is either a RetentionPolicy type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def _delete_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_retention_policies_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RetentionPolicy"]: + """List Retention Policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of RetentionPolicy + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_retention_policies_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class TransparentDataEncryptionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`transparent_data_encryptions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def get( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> _models.TransparentDataEncryption: + """Get a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: TransparentDataEncryption. The TransparentDataEncryption is compatible with + MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TransparentDataEncryption] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_transparent_data_encryptions_create_or_replace_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _models.TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _types.TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.TransparentDataEncryption + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Is either a TransparentDataEncryption type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption or + ~azure.mgmt.durabletask.types.TransparentDataEncryption or IO[bytes] + :return: An instance of AsyncLROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TransparentDataEncryption] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.TransparentDataEncryption"]: + """List Transparent Data Encryptions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of TransparentDataEncryption + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TransparentDataEncryption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_transparent_data_encryptions_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TransparentDataEncryption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FailoverInstancesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`failover_instances` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.FailoverInstance: + """Get a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: FailoverInstance. The FailoverInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.FailoverInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) + + _request = build_failover_instances_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FailoverInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_instances_create_or_replace_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _models.FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _types.FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.FailoverInstance + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Is either a FailoverInstance type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance or + ~azure.mgmt.durabletask.types.FailoverInstance or IO[bytes] + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FailoverInstance"]: + """List Failover Instances. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of FailoverInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_failover_instances_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FailoverInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _failover_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_failover_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_failover( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Trigger a graceful failover for the parent scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._failover_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_force_failover_allow_data_loss( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Trigger a forced failover with potential data loss for the parent scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py index 5dc55ea84dcc..bd918bd0fbb8 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py @@ -14,9 +14,20 @@ from ._models import ( # type: ignore + Detector, + DetectorDataset, + DetectorMetadata, + DetectorProperties, + DetectorRenderingProperties, + DetectorStatus, + DetectorTable, + DetectorTableColumn, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, + FailoverInstance, + FailoverInstanceProperties, + ManagedServiceIdentity, Operation, OperationDisplay, OptionalPropertiesUpdateableProperties, @@ -41,12 +52,24 @@ SystemData, TaskHub, TaskHubProperties, + TaskQueue, + TaskQueueProperties, + TaskQueueThroughput, + TaskQueueUpdate, TrackedResource, + TransparentDataEncryption, + TransparentDataEncryptionProperties, + UserAssignedIdentity, ) from ._enums import ( # type: ignore ActionType, CreatedByType, + DetectorRenderingType, + DetectorStatusId, + DetectorType, + FailoverState, + ManagedServiceIdentityType, Origin, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, @@ -54,16 +77,29 @@ PublicNetworkAccess, PurgeableOrchestrationState, RedundancyState, + ReplicationRole, SchedulerSkuName, + TransparentDataEncryptionKeySource, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "Detector", + "DetectorDataset", + "DetectorMetadata", + "DetectorProperties", + "DetectorRenderingProperties", + "DetectorStatus", + "DetectorTable", + "DetectorTableColumn", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", + "FailoverInstance", + "FailoverInstanceProperties", + "ManagedServiceIdentity", "Operation", "OperationDisplay", "OptionalPropertiesUpdateableProperties", @@ -88,9 +124,21 @@ "SystemData", "TaskHub", "TaskHubProperties", + "TaskQueue", + "TaskQueueProperties", + "TaskQueueThroughput", + "TaskQueueUpdate", "TrackedResource", + "TransparentDataEncryption", + "TransparentDataEncryptionProperties", + "UserAssignedIdentity", "ActionType", "CreatedByType", + "DetectorRenderingType", + "DetectorStatusId", + "DetectorType", + "FailoverState", + "ManagedServiceIdentityType", "Origin", "PrivateEndpointConnectionProvisioningState", "PrivateEndpointServiceConnectionStatus", @@ -98,7 +146,9 @@ "PublicNetworkAccess", "PurgeableOrchestrationState", "RedundancyState", + "ReplicationRole", "SchedulerSkuName", + "TransparentDataEncryptionKeySource", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py index 7ef293ceac02..331f19e1b1dc 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py @@ -11,7 +11,7 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. """ @@ -32,9 +32,86 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" +class DetectorRenderingType(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The rendering type for a detector dataset.""" + + TABLE = 1 + """A table rendering.""" + TIME_SERIES_GRAPH = 2 + """A time series graph rendering.""" + TIME_SERIES_PER_INSTANCE_GRAPH = 3 + """A time series per-instance graph rendering.""" + PIE_CHART = 4 + """A pie chart rendering.""" + DATA_SUMMARY = 5 + """A data summary rendering.""" + EMAIL_SNIPPET = 6 + """An email snippet rendering.""" + INSIGHT = 7 + """An insight rendering.""" + DYNAMIC_INSIGHT = 8 + """A dynamic insight rendering.""" + MARKDOWN = 9 + """A Markdown rendering.""" + + +class DetectorStatusId(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a detector result.""" + + CRITICAL = 0 + """A critical issue was detected.""" + WARNING = 1 + """A warning was detected.""" + INFO = 2 + """An informational result was returned.""" + SUCCESS = 3 + """The detector completed without detecting an issue.""" + NONE = 4 + """The detector did not run or returned no insights.""" + + +class DetectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of diagnostic response.""" + + DETECTOR = "Detector" + """A diagnostic detector.""" + ANALYSIS = "Analysis" + """A diagnostic analysis.""" + CATEGORY_OVERVIEW = "CategoryOverview" + """A diagnostic category overview.""" + + +class FailoverState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the failover operation.""" + + NONE = "None" + """No failover operation is active.""" + IN_PROGRESS = "InProgress" + """The failover operation is in progress.""" + SUCCEEDED = "Succeeded" + """The failover operation completed successfully.""" + FAILED = "Failed" + """The failover operation failed.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". + logs UX. Default value is \"user,system\". """ USER = "user" @@ -121,6 +198,15 @@ class RedundancyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The resource is zone redundant.""" +class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The replication role of the scheduler.""" + + PRIMARY = "Primary" + """The parent scheduler is the primary in the failover configuration.""" + SECONDARY = "Secondary" + """The parent scheduler is the secondary in the failover configuration.""" + + class SchedulerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The name of the Stock Keeping Unit (SKU) of a Durable Task Scheduler.""" @@ -128,3 +214,12 @@ class SchedulerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Dedicated SKU.""" CONSUMPTION = "Consumption" """Consumption SKU.""" + + +class TransparentDataEncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The key source for the transparent data encryption.""" + + MICROSOFT_MANAGED = "MicrosoftManaged" + """The key source is Microsoft-managed.""" + CUSTOMER_MANAGED = "CustomerManaged" + """The key source is customer-managed.""" diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py index bfa5939e6772..2c52da0246db 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py @@ -17,6 +17,255 @@ from .. import models as _models +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + """ + + +class Detector(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A diagnostic detector resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.DetectorProperties + """ + + properties: Optional["_models.DetectorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DetectorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DetectorDataset(_Model): + """A dataset produced by a detector. + + :ivar table: The tabular data produced by the detector. + :vartype table: ~azure.mgmt.durabletask.models.DetectorTable + :ivar rendering_properties: The rendering information for the tabular data. + :vartype rendering_properties: ~azure.mgmt.durabletask.models.DetectorRenderingProperties + """ + + table: Optional["_models.DetectorTable"] = rest_field(visibility=["read"]) + """The tabular data produced by the detector.""" + rendering_properties: Optional["_models.DetectorRenderingProperties"] = rest_field( + name="renderingProperties", visibility=["read"] + ) + """The rendering information for the tabular data.""" + + +class DetectorMetadata(_Model): + """Metadata that identifies and describes a detector. + + :ivar id: The unique identifier of the detector. + :vartype id: str + :ivar name: The display name of the detector. + :vartype name: str + :ivar description: A description of the detector. + :vartype description: str + :ivar author: The author of the detector when available for the caller. + :vartype author: str + :ivar category: The category of the detector. + :vartype category: str + :ivar support_topic_list: The case-submission support topic identifiers for which the detector + is enabled. + :vartype support_topic_list: list[str] + :ivar analysis_types: The analysis identifiers for which the detector is enabled. + :vartype analysis_types: list[str] + :ivar type: The kind of diagnostic response. Known values are: "Detector", "Analysis", and + "CategoryOverview". + :vartype type: str or ~azure.mgmt.durabletask.models.DetectorType + :ivar score: The match score when the detector is returned from a search. + :vartype score: float + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The unique identifier of the detector.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The display name of the detector.""" + description: Optional[str] = rest_field(visibility=["read"]) + """A description of the detector.""" + author: Optional[str] = rest_field(visibility=["read"]) + """The author of the detector when available for the caller.""" + category: Optional[str] = rest_field(visibility=["read"]) + """The category of the detector.""" + support_topic_list: Optional[list[str]] = rest_field(name="supportTopicList", visibility=["read"]) + """The case-submission support topic identifiers for which the detector is enabled.""" + analysis_types: Optional[list[str]] = rest_field(name="analysisTypes", visibility=["read"]) + """The analysis identifiers for which the detector is enabled.""" + type: Optional[Union[str, "_models.DetectorType"]] = rest_field(visibility=["read"]) + """The kind of diagnostic response. Known values are: \"Detector\", \"Analysis\", and + \"CategoryOverview\".""" + score: Optional[float] = rest_field(visibility=["read"]) + """The match score when the detector is returned from a search.""" + + +class DetectorProperties(_Model): + """The diagnostic response returned for a detector. + + :ivar provisioning_state: The provisioning state of the detector. Known values are: + "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar metadata: Metadata that identifies and describes the detector. + :vartype metadata: ~azure.mgmt.durabletask.models.DetectorMetadata + :ivar dataset: The datasets produced when the detector runs. + :vartype dataset: list[~azure.mgmt.durabletask.models.DetectorDataset] + :ivar status: The overall result of the detector. + :vartype status: ~azure.mgmt.durabletask.models.DetectorStatus + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the detector. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + metadata: Optional["_models.DetectorMetadata"] = rest_field(visibility=["read"]) + """Metadata that identifies and describes the detector.""" + dataset: Optional[list["_models.DetectorDataset"]] = rest_field(visibility=["read"]) + """The datasets produced when the detector runs.""" + status: Optional["_models.DetectorStatus"] = rest_field(visibility=["read"]) + """The overall result of the detector.""" + + +class DetectorRenderingProperties(_Model): + """The rendering information for a detector dataset. + + :ivar type: The rendering type for the dataset. Known values are: 1, 2, 3, 4, 5, 6, 7, 8, and + 9. + :vartype type: int or ~azure.mgmt.durabletask.models.DetectorRenderingType + :ivar title: The optional title of the rendering block. + :vartype title: str + :ivar description: The optional description of the rendering block. + :vartype description: str + """ + + type: Optional[Union[int, "_models.DetectorRenderingType"]] = rest_field(visibility=["read"]) + """The rendering type for the dataset. Known values are: 1, 2, 3, 4, 5, 6, 7, 8, and 9.""" + title: Optional[str] = rest_field(visibility=["read"]) + """The optional title of the rendering block.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The optional description of the rendering block.""" + + +class DetectorStatus(_Model): + """The overall result of a detector. + + :ivar message: The optional message describing the detector result. + :vartype message: str + :ivar status_id: The status of the detector result. Known values are: 0, 1, 2, 3, and 4. + :vartype status_id: int or ~azure.mgmt.durabletask.models.DetectorStatusId + """ + + message: Optional[str] = rest_field(visibility=["read"]) + """The optional message describing the detector result.""" + status_id: Optional[Union[int, "_models.DetectorStatusId"]] = rest_field(name="statusId", visibility=["read"]) + """The status of the detector result. Known values are: 0, 1, 2, 3, and 4.""" + + +class DetectorTable(_Model): + """A table included in a detector dataset. + + :ivar table_name: The name of the table. + :vartype table_name: str + :ivar columns: The column definitions for the table. + :vartype columns: list[~azure.mgmt.durabletask.models.DetectorTableColumn] + :ivar rows: The rows in the table. Values use the types specified by their columns. + :vartype rows: list[list[any]] + """ + + table_name: Optional[str] = rest_field(name="tableName", visibility=["read"]) + """The name of the table.""" + columns: Optional[list["_models.DetectorTableColumn"]] = rest_field(visibility=["read"]) + """The column definitions for the table.""" + rows: Optional[list[list[Any]]] = rest_field(visibility=["read"]) + """The rows in the table. Values use the types specified by their columns.""" + + +class DetectorTableColumn(_Model): + """A column definition in a detector table. + + :ivar column_name: The name of the column. + :vartype column_name: str + :ivar data_type: The data type of values in the column. + :vartype data_type: str + :ivar column_type: The optional semantic classification of the column. + :vartype column_type: str + """ + + column_name: Optional[str] = rest_field(name="columnName", visibility=["read"]) + """The name of the column.""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read"]) + """The data type of values in the column.""" + column_type: Optional[str] = rest_field(name="columnType", visibility=["read"]) + """The optional semantic classification of the column.""" + + class ErrorAdditionalInfo(_Model): """The resource management error additional info. @@ -61,7 +310,7 @@ class ErrorDetail(_Model): """The error additional info.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response. :ivar error: The error object. @@ -89,7 +338,159 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_Model): +class FailoverInstance(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A failover instance belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.FailoverInstanceProperties + """ + + properties: Optional["_models.FailoverInstanceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.FailoverInstanceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FailoverInstanceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The failover instance settings for the resource. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar replication_role: The replication role of the parent scheduler. Known values are: + "Primary" and "Secondary". + :vartype replication_role: str or ~azure.mgmt.durabletask.models.ReplicationRole + :ivar failover_state: The current state of the failover operation. Known values are: "None", + "InProgress", "Succeeded", and "Failed". + :vartype failover_state: str or ~azure.mgmt.durabletask.models.FailoverState + :ivar partner_scheduler_resource_id: The resource ID of the partner scheduler in the failover + configuration. Required. + :vartype partner_scheduler_resource_id: str + :ivar partner_scheduler_location: The location of the partner scheduler in the failover + configuration. + :vartype partner_scheduler_location: str + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + replication_role: Optional[Union[str, "_models.ReplicationRole"]] = rest_field( + name="replicationRole", visibility=["read"] + ) + """The replication role of the parent scheduler. Known values are: \"Primary\" and \"Secondary\".""" + failover_state: Optional[Union[str, "_models.FailoverState"]] = rest_field( + name="failoverState", visibility=["read"] + ) + """The current state of the failover operation. Known values are: \"None\", \"InProgress\", + \"Succeeded\", and \"Failed\".""" + partner_scheduler_resource_id: str = rest_field( + name="partnerSchedulerResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the partner scheduler in the failover configuration. Required.""" + partner_scheduler_location: Optional[str] = rest_field(name="partnerSchedulerLocation", visibility=["read"]) + """The location of the partner scheduler in the failover configuration.""" + + @overload + def __init__( + self, + *, + partner_scheduler_resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.durabletask.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.durabletask.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -177,7 +578,7 @@ class OperationDisplay(_Model): views.""" -class OptionalPropertiesUpdateableProperties(_Model): +class OptionalPropertiesUpdateableProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The template for adding optional properties. :ivar private_endpoint: The private endpoint resource. @@ -228,35 +629,7 @@ class PrivateEndpoint(_Model): """The resource identifier of the private endpoint.""" -class Resource(_Model): - """Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class PrivateEndpointConnection(Resource): +class PrivateEndpointConnection(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """A private endpoint connection resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -297,7 +670,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionProperties(_Model): +class PrivateEndpointConnectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of the private endpoint connection. :ivar group_ids: The group ids for the private endpoint resource. @@ -350,7 +723,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionUpdate(_Model): +class PrivateEndpointConnectionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """PATCH model for private endpoint connections. :ivar properties: The private endpoint connection properties. @@ -380,7 +753,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkResourceProperties(_Model): +class PrivateLinkResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a private link resource. :ivar group_id: The private link resource group id. @@ -418,7 +791,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkServiceConnectionState(_Model): +class PrivateLinkServiceConnectionState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A collection of information about the state of the connection between service consumer and provider. @@ -464,24 +837,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProxyResource(Resource): - """Proxy Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - """ - - -class RetentionPolicy(ProxyResource): +class RetentionPolicy(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """A retention policy resource belonging to the scheduler. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -522,7 +878,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RetentionPolicyDetails(_Model): +class RetentionPolicyDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The properties of a retention policy. :ivar retention_period_in_days: The retention period in days after which the orchestration will @@ -565,7 +921,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RetentionPolicyProperties(_Model): +class RetentionPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The retention policy settings for the resource. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -603,7 +959,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResource(Resource): +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -647,7 +1003,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Scheduler(TrackedResource): +class Scheduler(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """A Durable Task Scheduler resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -667,12 +1023,18 @@ class Scheduler(TrackedResource): :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.durabletask.models.SchedulerProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.durabletask.models.ManagedServiceIdentity """ properties: Optional["_models.SchedulerProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" @overload def __init__( @@ -681,6 +1043,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, properties: Optional["_models.SchedulerProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -694,7 +1057,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerPrivateLinkResource(Resource): +class SchedulerPrivateLinkResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """A private link resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -735,7 +1098,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerProperties(_Model): +class SchedulerProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Details of the Scheduler. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -797,7 +1160,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerPropertiesUpdate(_Model): +class SchedulerPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The Scheduler resource properties to be updated. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -853,7 +1216,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerSku(_Model): +class SchedulerSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The SKU (Stock Keeping Unit) assigned to this durable task scheduler. :ivar name: The name of the SKU. Required. Known values are: "Dedicated" and "Consumption". @@ -897,7 +1260,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerSkuUpdate(_Model): +class SchedulerSkuUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The SKU (Stock Keeping Unit) properties to be updated. :ivar name: The name of the SKU. Known values are: "Dedicated" and "Consumption". @@ -941,13 +1304,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerUpdate(_Model): +class SchedulerUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The update request model for the Scheduler resource. :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.durabletask.models.SchedulerPropertiesUpdate :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.durabletask.models.ManagedServiceIdentity """ properties: Optional["_models.SchedulerPropertiesUpdate"] = rest_field( @@ -956,6 +1321,10 @@ class SchedulerUpdate(_Model): """The resource-specific properties for this resource.""" tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" @overload def __init__( @@ -963,6 +1332,7 @@ def __init__( *, properties: Optional["_models.SchedulerPropertiesUpdate"] = None, tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -976,7 +1346,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -1043,7 +1413,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaskHub(ProxyResource): +class TaskHub(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """A Task Hub resource belonging to the scheduler. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1084,7 +1454,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaskHubProperties(_Model): +class TaskHubProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The properties of Task Hub. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -1092,6 +1462,9 @@ class TaskHubProperties(_Model): :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState :ivar dashboard_url: URL of the durable task scheduler dashboard. :vartype dashboard_url: str + :ivar capabilities: A set of Task Hub capabilities that can be enabled or disabled for a Task + Hub. + :vartype capabilities: list[str] """ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -1101,3 +1474,274 @@ class TaskHubProperties(_Model): \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" dashboard_url: Optional[str] = rest_field(name="dashboardUrl", visibility=["read"]) """URL of the durable task scheduler dashboard.""" + capabilities: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A set of Task Hub capabilities that can be enabled or disabled for a Task Hub.""" + + @overload + def __init__( + self, + *, + capabilities: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaskQueue(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Task Queue resource belonging to a Task Hub. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TaskQueueProperties + """ + + properties: Optional["_models.TaskQueueProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.TaskQueueProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaskQueueProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a Task Queue. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar throughput: The throughput configuration of the Task Queue. + :vartype throughput: ~azure.mgmt.durabletask.models.TaskQueueThroughput + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + throughput: Optional["_models.TaskQueueThroughput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The throughput configuration of the Task Queue.""" + + @overload + def __init__( + self, + *, + throughput: Optional["_models.TaskQueueThroughput"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaskQueueThroughput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The throughput configuration of a Task Queue. + + :ivar actions_per_second: The rate of work-item handouts per second. + :vartype actions_per_second: int + """ + + actions_per_second: Optional[int] = rest_field( + name="actionsPerSecond", visibility=["read", "create", "update", "delete", "query"] + ) + """The rate of work-item handouts per second.""" + + @overload + def __init__( + self, + *, + actions_per_second: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaskQueueUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The update request model for a Task Queue. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TaskQueueProperties + """ + + properties: Optional["_models.TaskQueueProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.TaskQueueProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransparentDataEncryption(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transparent data encryption resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TransparentDataEncryptionProperties + """ + + properties: Optional["_models.TransparentDataEncryptionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.TransparentDataEncryptionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransparentDataEncryptionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The transparent data encryption settings for the resource. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar key_source: The key source for the transparent data encryption. Required. Known values + are: "MicrosoftManaged" and "CustomerManaged". + :vartype key_source: str or ~azure.mgmt.durabletask.models.TransparentDataEncryptionKeySource + :ivar key_vault_key_uri: The URI of the key in Key Vault to be used for transparent data + encryption. + :vartype key_vault_key_uri: str + :ivar auto_rotation_enabled: Indicates whether auto-rotation of the customer-managed keys is + enabled for transparent data encryption. + :vartype auto_rotation_enabled: bool + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + key_source: Union[str, "_models.TransparentDataEncryptionKeySource"] = rest_field( + name="keySource", visibility=["read", "create", "update", "delete", "query"] + ) + """The key source for the transparent data encryption. Required. Known values are: + \"MicrosoftManaged\" and \"CustomerManaged\".""" + key_vault_key_uri: Optional[str] = rest_field( + name="keyVaultKeyUri", visibility=["read", "create", "update", "delete", "query"] + ) + """The URI of the key in Key Vault to be used for transparent data encryption.""" + auto_rotation_enabled: Optional[bool] = rest_field( + name="autoRotationEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether auto-rotation of the customer-managed keys is enabled for transparent data + encryption.""" + + @overload + def __init__( + self, + *, + key_source: Union[str, "_models.TransparentDataEncryptionKeySource"], + key_vault_key_uri: Optional[str] = None, + auto_rotation_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py index 18dc884c6cc0..2c8eaa1bc1f9 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py @@ -13,9 +13,13 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore +from ._operations import DetectorsOperations # type: ignore from ._operations import SchedulersOperations # type: ignore from ._operations import TaskHubsOperations # type: ignore +from ._operations import TaskQueuesOperations # type: ignore from ._operations import RetentionPoliciesOperations # type: ignore +from ._operations import TransparentDataEncryptionsOperations # type: ignore +from ._operations import FailoverInstancesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -23,9 +27,13 @@ __all__ = [ "Operations", + "DetectorsOperations", "SchedulersOperations", "TaskHubsOperations", + "TaskQueuesOperations", "RetentionPoliciesOperations", + "TransparentDataEncryptionsOperations", + "FailoverInstancesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py index 18abe743dff9..faace5f71da1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py @@ -32,7 +32,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import DurableTaskMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -40,7 +40,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -51,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,13 +65,70 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_detectors_get_request( + resource_group_name: str, scheduler_name: str, detector_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors/{detectorId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "detectorId": _SERIALIZER.url("detector_id", detector_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_detectors_list_by_scheduler_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_schedulers_get_request( resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +157,7 @@ def build_schedulers_create_or_update_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +188,7 @@ def build_schedulers_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +217,7 @@ def build_schedulers_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}" path_format_arguments = { @@ -184,7 +240,7 @@ def build_schedulers_list_by_resource_group_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +269,7 @@ def build_schedulers_list_by_subscription_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +295,7 @@ def build_schedulers_get_private_link_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +324,7 @@ def build_schedulers_list_private_links_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -300,7 +356,7 @@ def build_schedulers_get_private_endpoint_connection_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +392,7 @@ def build_schedulers_create_or_update_private_endpoint_connection_request( # py _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +430,7 @@ def build_schedulers_update_private_endpoint_connection_request( # pylint: disa _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -410,7 +466,7 @@ def build_schedulers_delete_private_endpoint_connection_request( # pylint: disa ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -436,7 +492,7 @@ def build_schedulers_list_private_endpoint_connections_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -458,13 +514,35 @@ def build_schedulers_list_private_endpoint_connections_request( # pylint: disab return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_schedulers_restart_request( + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/restart" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + def build_task_hubs_get_request( resource_group_name: str, scheduler_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -494,7 +572,7 @@ def build_task_hubs_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -524,7 +602,7 @@ def build_task_hubs_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}" path_format_arguments = { @@ -548,7 +626,7 @@ def build_task_hubs_list_by_scheduler_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -570,13 +648,182 @@ def build_task_hubs_list_by_scheduler_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_task_queues_get_request( + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_task_queues_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_task_queues_update_request( + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_task_queues_delete_request( + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_task_queues_list_by_task_hub_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_retention_policies_get_request( resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -605,7 +852,7 @@ def build_retention_policies_create_or_replace_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -636,7 +883,7 @@ def build_retention_policies_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -665,7 +912,7 @@ def build_retention_policies_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/retentionPolicies/default" path_format_arguments = { @@ -688,7 +935,7 @@ def build_retention_policies_list_by_scheduler_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -710,43 +957,317 @@ def build_retention_policies_list_by_scheduler_request( # pylint: disable=name- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. +def build_transparent_data_encryptions_get_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s - :attr:`operations` attribute. - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """List the operations for the provider. + _url: str = _url.format(**path_format_arguments) # type: ignore - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_delete_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_transparent_data_encryptions_list_by_scheduler_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_get_request( + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_delete_request( + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_failover_instances_list_by_scheduler_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_failover_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_force_failover_allow_data_loss_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/forceFailoverAllowDataLoss" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -774,7 +1295,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -817,7 +1341,221 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class SchedulersOperations: +class DetectorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`detectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "detector_id", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def get(self, resource_group_name: str, scheduler_name: str, detector_id: str, **kwargs: Any) -> _models.Detector: + """Gets a diagnostic detector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param detector_id: The name of the Detector. Required. + :type detector_id: str + :return: Detector. The Detector is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.Detector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Detector] = kwargs.pop("cls", None) + + _request = build_detectors_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + detector_id=detector_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Detector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.Detector"]: + """Lists the diagnostic detectors belonging to a scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of Detector + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Detector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Detector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_detectors_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Detector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SchedulersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -908,7 +1646,7 @@ def _create_or_update_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1014,7 +1752,7 @@ def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + resource: _types.Scheduler, *, content_type: str = "application/json", **kwargs: Any @@ -1027,7 +1765,7 @@ def begin_create_or_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.Scheduler :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1070,7 +1808,7 @@ def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Scheduler]: """Create or update a Scheduler. @@ -1080,9 +1818,10 @@ def begin_create_or_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: Scheduler, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.Scheduler or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Scheduler type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.Scheduler or + ~azure.mgmt.durabletask.types.Scheduler or IO[bytes] :return: An instance of LROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -1144,7 +1883,7 @@ def _update_initial( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1248,7 +1987,7 @@ def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: JSON, + properties: _types.SchedulerUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1261,7 +2000,7 @@ def begin_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.SchedulerUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1304,7 +2043,7 @@ def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Scheduler]: """Update a Scheduler. @@ -1314,9 +2053,10 @@ def begin_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - SchedulerUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a SchedulerUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or + ~azure.mgmt.durabletask.types.SchedulerUpdate or IO[bytes] :return: An instance of LROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -1542,7 +2282,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1632,7 +2375,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1687,7 +2433,7 @@ def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) def get_private_link( self, resource_group_name: str, scheduler_name: str, private_link_resource_name: str, **kwargs: Any @@ -1732,66 +2478,2603 @@ def get_private_link( path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchedulerPrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def list_private_links( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.SchedulerPrivateLinkResource"]: + """List private link resources for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of SchedulerPrivateLinkResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.SchedulerPrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SchedulerPrivateLinkResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schedulers_list_private_links_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SchedulerPrivateLinkResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def get_private_endpoint_connection( + self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_schedulers_get_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def _create_or_update_private_endpoint_connection_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schedulers_create_or_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: _types.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Is either a PrivateEndpointConnection type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or + ~azure.mgmt.durabletask.types.PrivateEndpointConnection or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def _update_private_endpoint_connection_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schedulers_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: _models.PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: _types.PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Is either a + PrivateEndpointConnectionUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or + ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-long + self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_schedulers_delete_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_delete_private_endpoint_connection( + self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def list_private_endpoint_connections( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateEndpointConnection"]: + """List private endpoint connections for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of PrivateEndpointConnection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schedulers_list_private_endpoint_connections_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def restart( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> None: + """Restart a Scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_schedulers_restart_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class TaskHubsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`task_hubs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any) -> _models.TaskHub: + """Get a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: TaskHub. The TaskHub is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + _request = build_task_hubs_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TaskHub, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_task_hubs_create_or_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: _models.TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: _types.TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.TaskHub + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub or ~azure.mgmt.durabletask.types.TaskHub + or IO[bytes] + :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TaskHub, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TaskHub].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TaskHub]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_task_hubs_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.TaskHub"]: + """List Task Hubs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of TaskHub + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TaskHub]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_task_hubs_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TaskHub], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class TaskQueuesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`task_queues` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def get( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> _models.TaskQueue: + """Get a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :return: TaskQueue. The TaskQueue is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TaskQueue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) + + _request = build_task_queues_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TaskQueue, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_task_queues_create_or_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: _models.TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TaskQueue + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: _types.TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.TaskQueue + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Is either a TaskQueue type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskQueue or + ~azure.mgmt.durabletask.types.TaskQueue or IO[bytes] + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TaskQueue, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TaskQueue].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TaskQueue]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _update_initial( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_task_queues_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: _models.TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: _types.TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.types.TaskQueueUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Is either a TaskQueueUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate or + ~azure.mgmt.durabletask.types.TaskQueueUpdate or IO[bytes] + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TaskQueue, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TaskQueue].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TaskQueue]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _delete_initial( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_task_queues_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_delete( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.SchedulerPrivateLinkResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2026-07-01-preview", params_added_on={ - "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "accept", + ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def list_private_links( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.SchedulerPrivateLinkResource"]: - """List private link resources for the durable task scheduler. + def list_by_task_hub( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> ItemPaged["_models.TaskQueue"]: + """List Task Queues by Task Hub. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of SchedulerPrivateLinkResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.SchedulerPrivateLinkResource] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: An iterator like instance of TaskQueue + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchedulerPrivateLinkResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.TaskQueue]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1804,9 +5087,10 @@ def list_private_links( def prepare_request(next_link=None): if not next_link: - _request = build_schedulers_list_private_links_request( + _request = build_task_queues_list_by_task_hub_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1830,7 +5114,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1844,7 +5131,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SchedulerPrivateLinkResource], + List[_models.TaskQueue], deserialized.get("value", []), ) if cls: @@ -1872,37 +5159,48 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + +class RetentionPoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "private_endpoint_connection_name", - "accept", - ] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def get_private_endpoint_connection( - self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Get a private endpoint connection for the durable task scheduler. + def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: + """Get a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1916,12 +5214,11 @@ def get_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) - _request = build_schedulers_get_private_endpoint_connection_request( + _request = build_retention_policies_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1956,7 +5253,7 @@ def get_private_endpoint_connection( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.RetentionPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1964,26 +5261,30 @@ def get_private_endpoint_connection( return deserialized # type: ignore @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def _create_or_update_private_endpoint_connection_initial( # pylint: disable=name-too-long + def _create_or_replace_initial( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2007,10 +5308,9 @@ def _create_or_update_private_endpoint_connection_initial( # pylint: disable=na else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schedulers_create_or_update_private_endpoint_connection_request( + _request = build_retention_policies_create_or_replace_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2058,156 +5358,145 @@ def _create_or_update_private_endpoint_connection_initial( # pylint: disable=na return deserialized # type: ignore @overload - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: _models.PrivateEndpointConnection, + resource: _models.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: JSON, + resource: _types.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.RetentionPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Is one of the following types: - PrivateEndpointConnection, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or JSON or IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :param resource: Resource create parameters. Is either a RetentionPolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_private_endpoint_connection_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -2220,7 +5509,7 @@ def begin_create_or_update_private_endpoint_connection( # pylint: disable=name- def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.RetentionPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2238,37 +5527,41 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + return LROPoller[_models.RetentionPolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PrivateEndpointConnection]( + return LROPoller[_models.RetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def _update_private_endpoint_connection_initial( # pylint: disable=name-too-long + def _update_initial( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2292,10 +5585,9 @@ def _update_private_endpoint_connection_initial( # pylint: disable=name-too-lon else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schedulers_update_private_endpoint_connection_request( + _request = build_retention_policies_update_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2341,157 +5633,145 @@ def _update_private_endpoint_connection_initial( # pylint: disable=name-too-lon return deserialized # type: ignore @overload - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: _models.PrivateEndpointConnectionUpdate, + properties: _models.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: JSON, + properties: _types.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.RetentionPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PrivateEndpointConnectionUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or JSON or - IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :param properties: The resource properties to be updated. Is either a RetentionPolicy type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_private_endpoint_connection_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -2504,7 +5784,7 @@ def begin_update_private_endpoint_connection( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.RetentionPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2522,32 +5802,30 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + return LROPoller[_models.RetentionPolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PrivateEndpointConnection]( + return LROPoller[_models.RetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "private_endpoint_connection_name", - ] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-long - self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2561,10 +5839,9 @@ def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-lon cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_schedulers_delete_private_endpoint_connection_request( + _request = build_retention_policies_delete_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2609,31 +5886,26 @@ def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-lon @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "private_endpoint_connection_name", - ] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def begin_delete_private_endpoint_connection( - self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a private endpoint connection for the durable task scheduler. + def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2646,10 +5918,9 @@ def begin_delete_private_endpoint_connection( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_private_endpoint_connection_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2685,30 +5956,36 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def list_private_endpoint_connections( + def list_by_scheduler( self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateEndpointConnection"]: - """List private endpoint connections for the durable task scheduler. + ) -> ItemPaged["_models.RetentionPolicy"]: + """List Retention Policies. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of PrivateEndpointConnection - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An iterator like instance of RetentionPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2721,7 +5998,7 @@ def list_private_endpoint_connections( def prepare_request(next_link=None): if not next_link: - _request = build_schedulers_list_private_endpoint_connections_request( + _request = build_retention_policies_list_by_scheduler_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -2747,7 +6024,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2761,7 +6041,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PrivateEndpointConnection], + List[_models.RetentionPolicy], deserialized.get("value", []), ) if cls: @@ -2790,14 +6070,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class TaskHubsOperations: +class TransparentDataEncryptionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s - :attr:`task_hubs` attribute. + :attr:`transparent_data_encryptions` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2808,18 +6088,24 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any) -> _models.TaskHub: - """Get a Task Hub. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.TransparentDataEncryption: + """Get a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str - :return: TaskHub. The TaskHub is compatible with MutableMapping - :rtype: ~azure.mgmt.durabletask.models.TaskHub + :return: TransparentDataEncryption. The TransparentDataEncryption is compatible with + MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2833,12 +6119,11 @@ def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + cls: ClsType[_models.TransparentDataEncryption] = kwargs.pop("cls", None) - _request = build_task_hubs_get_request( + _request = build_transparent_data_encryptions_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2873,19 +6158,32 @@ def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.TaskHub, response.json()) + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def _create_or_replace_initial( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2909,10 +6207,9 @@ def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_task_hubs_create_or_update_request( + _request = build_transparent_data_encryptions_create_or_replace_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2960,137 +6257,139 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: _models.TaskHub, + resource: _models.TransparentDataEncryption, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: JSON, + resource: _types.TransparentDataEncryption, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.TransparentDataEncryption :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Is one of the following types: TaskHub, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub or JSON or IO[bytes] - :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :param resource: Resource create parameters. Is either a TransparentDataEncryption type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption or + ~azure.mgmt.durabletask.types.TransparentDataEncryption or IO[bytes] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + cls: ClsType[_models.TransparentDataEncryption] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -3103,7 +6402,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.TaskHub, response.json()) + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3121,19 +6420,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.TaskHub].from_continuation_token( + return LROPoller[_models.TransparentDataEncryption].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.TaskHub]( + return LROPoller[_models.TransparentDataEncryption]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any - ) -> Iterator[bytes]: + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3147,10 +6451,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_task_hubs_delete_request( + _request = build_transparent_data_encryptions_delete_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3194,18 +6497,21 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - def begin_delete( - self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Task Hub. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3221,7 +6527,6 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3256,24 +6561,31 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) def list_by_scheduler( self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.TaskHub"]: - """List Task Hubs. + ) -> ItemPaged["_models.TransparentDataEncryption"]: + """List Transparent Data Encryptions. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of TaskHub - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskHub] + :return: An iterator like instance of TransparentDataEncryption + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.TaskHub]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.TransparentDataEncryption]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3286,7 +6598,7 @@ def list_by_scheduler( def prepare_request(next_link=None): if not next_link: - _request = build_task_hubs_list_by_scheduler_request( + _request = build_transparent_data_encryptions_list_by_scheduler_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -3312,7 +6624,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3326,7 +6641,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.TaskHub], + List[_models.TransparentDataEncryption], deserialized.get("value", []), ) if cls: @@ -3355,14 +6670,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class RetentionPoliciesOperations: +class FailoverInstancesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s - :attr:`retention_policies` attribute. + :attr:`failover_instances` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3374,22 +6689,22 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: - """Get a Retention Policy. + def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.FailoverInstance: + """Get a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy + :return: FailoverInstance. The FailoverInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.FailoverInstance :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3403,9 +6718,9 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) - _request = build_retention_policies_get_request( + _request = build_failover_instances_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -3442,7 +6757,7 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3450,9 +6765,9 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ return deserialized # type: ignore @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", @@ -3461,13 +6776,13 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) def _create_or_replace_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3491,7 +6806,7 @@ def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_retention_policies_create_or_replace_request( + _request = build_failover_instances_create_or_replace_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -3545,12 +6860,12 @@ def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - resource: _models.RetentionPolicy, + resource: _models.FailoverInstance, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3558,13 +6873,13 @@ def begin_create_or_replace( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3573,12 +6888,12 @@ def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + resource: _types.FailoverInstance, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3586,13 +6901,13 @@ def begin_create_or_replace( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.FailoverInstance :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3605,8 +6920,8 @@ def begin_create_or_replace( *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3618,17 +6933,17 @@ def begin_create_or_replace( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", @@ -3637,35 +6952,36 @@ def begin_create_or_replace( "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: RetentionPolicy, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :param resource: Resource create parameters. Is either a FailoverInstance type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance or + ~azure.mgmt.durabletask.types.FailoverInstance or IO[bytes] + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -3685,7 +7001,7 @@ def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3703,37 +7019,263 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.RetentionPolicy].from_continuation_token( + return LROPoller[_models.FailoverInstance].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.RetentionPolicy]( + return LROPoller[_models.FailoverInstance]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "content_type", - "accept", - ] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def _update_initial( - self, - resource_group_name: str, - scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.FailoverInstance"]: + """List Failover Instances. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of FailoverInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_failover_instances_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FailoverInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _failover_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3742,26 +7284,16 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_retention_policies_update_request( + _request = build_failover_instances_failover_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3802,141 +7334,40 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: _models.RetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "content_type", - "accept", - ] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + def begin_failover( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverInstance]: + """Trigger a graceful failover for the parent scheduler. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - RetentionPolicy, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._failover_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - properties=properties, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3947,7 +7378,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3965,24 +7396,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.RetentionPolicy].from_continuation_token( + return LROPoller[_models.FailoverInstance].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.RetentionPolicy]( + return LROPoller[_models.FailoverInstance]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: + def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3996,7 +7429,7 @@ def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwarg cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_retention_policies_delete_request( + _request = build_failover_instances_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -4017,7 +7450,7 @@ def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwarg response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4043,33 +7476,36 @@ def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwarg @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a Retention Policy. + def begin_force_failover_allow_data_loss( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverInstance]: + """Trigger a forced failover with potential data loss for the parent scheduler. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._force_failover_allow_data_loss_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, cls=lambda x, y, z: x, @@ -4080,9 +7516,12 @@ def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -4097,116 +7536,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.FailoverInstance].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-04-01-preview", - params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] - }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], - ) - def list_by_scheduler( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.RetentionPolicy"]: - """List Retention Policies. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :return: An iterator like instance of RetentionPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_retention_policies_list_by_scheduler_request( - resource_group_name=resource_group_name, - scheduler_name=scheduler_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RetentionPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + return LROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py new file mode 100644 index 000000000000..ca9b227c6acf --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py @@ -0,0 +1,721 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + CreatedByType, + FailoverState, + ManagedServiceIdentityType, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccess, + PurgeableOrchestrationState, + RedundancyState, + ReplicationRole, + SchedulerSkuName, + TransparentDataEncryptionKeySource, + ) + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class FailoverInstance(ProxyResource): + """A failover instance belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "FailoverInstanceProperties" + """ + + properties: "FailoverInstanceProperties" + """The resource-specific properties for this resource.""" + + +class FailoverInstanceProperties(TypedDict, total=False): + """The failover instance settings for the resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar replicationRole: The replication role of the parent scheduler. Known values are: + "Primary" and "Secondary". + :vartype replicationRole: Union[str, "ReplicationRole"] + :ivar failoverState: The current state of the failover operation. Known values are: "None", + "InProgress", "Succeeded", and "Failed". + :vartype failoverState: Union[str, "FailoverState"] + :ivar partnerSchedulerResourceId: The resource ID of the partner scheduler in the failover + configuration. Required. + :vartype partnerSchedulerResourceId: str + :ivar partnerSchedulerLocation: The location of the partner scheduler in the failover + configuration. + :vartype partnerSchedulerLocation: str + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + replicationRole: Union[str, "ReplicationRole"] + """The replication role of the parent scheduler. Known values are: \"Primary\" and \"Secondary\".""" + failoverState: Union[str, "FailoverState"] + """The current state of the failover operation. Known values are: \"None\", \"InProgress\", + \"Succeeded\", and \"Failed\".""" + partnerSchedulerResourceId: Required[str] + """The resource ID of the partner scheduler in the failover configuration. Required.""" + partnerSchedulerLocation: str + """The location of the partner scheduler in the failover configuration.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class OptionalPropertiesUpdateableProperties(TypedDict, total=False): + """The template for adding optional properties. + + :ivar privateEndpoint: The private endpoint resource. + :vartype privateEndpoint: "PrivateEndpoint" + :ivar privateLinkServiceConnectionState: A collection of information about the state of the + connection between service consumer and provider. + :vartype privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + """ + + privateEndpoint: "PrivateEndpoint" + """The private endpoint resource.""" + privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + """A collection of information about the state of the connection between service consumer and + provider.""" + + +class PrivateEndpoint(TypedDict, total=False): + """The private endpoint resource. + + :ivar id: The resource identifier of the private endpoint. + :vartype id: str + """ + + id: str + """The resource identifier of the private endpoint.""" + + +class PrivateEndpointConnection(Resource): + """A private endpoint connection resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The private endpoint connection properties. + :vartype properties: "PrivateEndpointConnectionProperties" + """ + + properties: "PrivateEndpointConnectionProperties" + """The private endpoint connection properties.""" + + +class PrivateEndpointConnectionProperties(TypedDict, total=False): + """Properties of the private endpoint connection. + + :ivar groupIds: The group ids for the private endpoint resource. + :vartype groupIds: list[str] + :ivar privateEndpoint: The private endpoint resource. + :vartype privateEndpoint: "PrivateEndpoint" + :ivar privateLinkServiceConnectionState: A collection of information about the state of the + connection between service consumer and provider. Required. + :vartype privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + :ivar provisioningState: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Creating", "Deleting", and "Failed". + :vartype provisioningState: Union[str, "PrivateEndpointConnectionProvisioningState"] + """ + + groupIds: list[str] + """The group ids for the private endpoint resource.""" + privateEndpoint: "PrivateEndpoint" + """The private endpoint resource.""" + privateLinkServiceConnectionState: Required["PrivateLinkServiceConnectionState"] + """A collection of information about the state of the connection between service consumer and + provider. Required.""" + provisioningState: Union[str, "PrivateEndpointConnectionProvisioningState"] + """The provisioning state of the private endpoint connection resource. Known values are: + \"Succeeded\", \"Creating\", \"Deleting\", and \"Failed\".""" + + +class PrivateEndpointConnectionUpdate(TypedDict, total=False): + """PATCH model for private endpoint connections. + + :ivar properties: The private endpoint connection properties. + :vartype properties: "OptionalPropertiesUpdateableProperties" + """ + + properties: "OptionalPropertiesUpdateableProperties" + """The private endpoint connection properties.""" + + +class PrivateLinkServiceConnectionState(TypedDict, total=False): + """A collection of information about the state of the connection between service consumer and + provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Known values are: "Pending", "Approved", and "Rejected". + :vartype status: Union[str, "PrivateEndpointServiceConnectionStatus"] + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actionsRequired: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actionsRequired: str + """ + + status: Union[str, "PrivateEndpointServiceConnectionStatus"] + """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" + description: str + """The reason for approval/rejection of the connection.""" + actionsRequired: str + """A message indicating if changes on the service provider require any updates on the consumer.""" + + +class RetentionPolicy(ProxyResource): + """A retention policy resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "RetentionPolicyProperties" + """ + + properties: "RetentionPolicyProperties" + """The resource-specific properties for this resource.""" + + +class RetentionPolicyDetails(TypedDict, total=False): + """The properties of a retention policy. + + :ivar retentionPeriodInDays: The retention period in days after which the orchestration will be + purged automatically. Required. + :vartype retentionPeriodInDays: int + :ivar orchestrationState: The orchestration state to which this policy applies. If omitted, the + policy applies to all purgeable orchestration states. Known values are: "Completed", "Failed", + "Terminated", and "Canceled". + :vartype orchestrationState: Union[str, "PurgeableOrchestrationState"] + """ + + retentionPeriodInDays: Required[int] + """The retention period in days after which the orchestration will be purged automatically. + Required.""" + orchestrationState: Union[str, "PurgeableOrchestrationState"] + """The orchestration state to which this policy applies. If omitted, the policy applies to all + purgeable orchestration states. Known values are: \"Completed\", \"Failed\", \"Terminated\", + and \"Canceled\".""" + + +class RetentionPolicyProperties(TypedDict, total=False): + """The retention policy settings for the resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar retentionPolicies: The orchestration retention policies. + :vartype retentionPolicies: list["RetentionPolicyDetails"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + retentionPolicies: list["RetentionPolicyDetails"] + """The orchestration retention policies.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class Scheduler(TrackedResource): + """A Durable Task Scheduler resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchedulerProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "SchedulerProperties" + """The resource-specific properties for this resource.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class SchedulerProperties(TypedDict, total=False): + """Details of the Scheduler. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar endpoint: URL of the durable task scheduler. + :vartype endpoint: str + :ivar ipAllowlist: IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR. + Required. + :vartype ipAllowlist: list[str] + :ivar sku: SKU of the durable task scheduler. Required. + :vartype sku: "SchedulerSku" + :ivar publicNetworkAccess: Allow or disallow public network access to durable task scheduler. + Known values are: "Enabled" and "Disabled". + :vartype publicNetworkAccess: Union[str, "PublicNetworkAccess"] + :ivar privateEndpointConnections: The private endpoints exposed by this resource. + :vartype privateEndpointConnections: list["PrivateEndpointConnection"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + endpoint: str + """URL of the durable task scheduler.""" + ipAllowlist: Required[list[str]] + """IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR. Required.""" + sku: Required["SchedulerSku"] + """SKU of the durable task scheduler. Required.""" + publicNetworkAccess: Union[str, "PublicNetworkAccess"] + """Allow or disallow public network access to durable task scheduler. Known values are: + \"Enabled\" and \"Disabled\".""" + privateEndpointConnections: list["PrivateEndpointConnection"] + """The private endpoints exposed by this resource.""" + + +class SchedulerPropertiesUpdate(TypedDict, total=False): + """The Scheduler resource properties to be updated. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar endpoint: URL of the durable task scheduler. + :vartype endpoint: str + :ivar ipAllowlist: IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR. + :vartype ipAllowlist: list[str] + :ivar sku: SKU of the durable task scheduler. + :vartype sku: "SchedulerSkuUpdate" + :ivar publicNetworkAccess: Allow or disallow public network access to durable task scheduler. + Known values are: "Enabled" and "Disabled". + :vartype publicNetworkAccess: Union[str, "PublicNetworkAccess"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + endpoint: str + """URL of the durable task scheduler.""" + ipAllowlist: list[str] + """IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR.""" + sku: "SchedulerSkuUpdate" + """SKU of the durable task scheduler.""" + publicNetworkAccess: Union[str, "PublicNetworkAccess"] + """Allow or disallow public network access to durable task scheduler. Known values are: + \"Enabled\" and \"Disabled\".""" + + +class SchedulerSku(TypedDict, total=False): + """The SKU (Stock Keeping Unit) assigned to this durable task scheduler. + + :ivar name: The name of the SKU. Required. Known values are: "Dedicated" and "Consumption". + :vartype name: Union[str, "SchedulerSkuName"] + :ivar capacity: The SKU capacity. This allows scale out/in for the resource and impacts zone + redundancy. + :vartype capacity: int + :ivar redundancyState: Indicates whether the current SKU configuration is zone redundant. Known + values are: "None" and "Zone". + :vartype redundancyState: Union[str, "RedundancyState"] + """ + + name: Required[Union[str, "SchedulerSkuName"]] + """The name of the SKU. Required. Known values are: \"Dedicated\" and \"Consumption\".""" + capacity: int + """The SKU capacity. This allows scale out/in for the resource and impacts zone redundancy.""" + redundancyState: Union[str, "RedundancyState"] + """Indicates whether the current SKU configuration is zone redundant. Known values are: \"None\" + and \"Zone\".""" + + +class SchedulerSkuUpdate(TypedDict, total=False): + """The SKU (Stock Keeping Unit) properties to be updated. + + :ivar name: The name of the SKU. Known values are: "Dedicated" and "Consumption". + :vartype name: Union[str, "SchedulerSkuName"] + :ivar capacity: The SKU capacity. This allows scale out/in for the resource and impacts zone + redundancy. + :vartype capacity: int + :ivar redundancyState: Indicates whether the current SKU configuration is zone redundant. Known + values are: "None" and "Zone". + :vartype redundancyState: Union[str, "RedundancyState"] + """ + + name: Union[str, "SchedulerSkuName"] + """The name of the SKU. Known values are: \"Dedicated\" and \"Consumption\".""" + capacity: int + """The SKU capacity. This allows scale out/in for the resource and impacts zone redundancy.""" + redundancyState: Union[str, "RedundancyState"] + """Indicates whether the current SKU configuration is zone redundant. Known values are: \"None\" + and \"Zone\".""" + + +class SchedulerUpdate(TypedDict, total=False): + """The update request model for the Scheduler resource. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchedulerPropertiesUpdate" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "SchedulerPropertiesUpdate" + """The resource-specific properties for this resource.""" + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TaskHub(ProxyResource): + """A Task Hub resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TaskHubProperties" + """ + + properties: "TaskHubProperties" + """The resource-specific properties for this resource.""" + + +class TaskHubProperties(TypedDict, total=False): + """The properties of Task Hub. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar dashboardUrl: URL of the durable task scheduler dashboard. + :vartype dashboardUrl: str + :ivar capabilities: A set of Task Hub capabilities that can be enabled or disabled for a Task + Hub. + :vartype capabilities: list[str] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + dashboardUrl: str + """URL of the durable task scheduler dashboard.""" + capabilities: list[str] + """A set of Task Hub capabilities that can be enabled or disabled for a Task Hub.""" + + +class TaskQueue(ProxyResource): + """A Task Queue resource belonging to a Task Hub. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TaskQueueProperties" + """ + + properties: "TaskQueueProperties" + """The resource-specific properties for this resource.""" + + +class TaskQueueProperties(TypedDict, total=False): + """The properties of a Task Queue. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar throughput: The throughput configuration of the Task Queue. + :vartype throughput: "TaskQueueThroughput" + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + throughput: "TaskQueueThroughput" + """The throughput configuration of the Task Queue.""" + + +class TaskQueueThroughput(TypedDict, total=False): + """The throughput configuration of a Task Queue. + + :ivar actionsPerSecond: The rate of work-item handouts per second. + :vartype actionsPerSecond: int + """ + + actionsPerSecond: int + """The rate of work-item handouts per second.""" + + +class TaskQueueUpdate(TypedDict, total=False): + """The update request model for a Task Queue. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TaskQueueProperties" + """ + + properties: "TaskQueueProperties" + """The resource-specific properties for this resource.""" + + +class TransparentDataEncryption(ProxyResource): + """A transparent data encryption resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TransparentDataEncryptionProperties" + """ + + properties: "TransparentDataEncryptionProperties" + """The resource-specific properties for this resource.""" + + +class TransparentDataEncryptionProperties(TypedDict, total=False): + """The transparent data encryption settings for the resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar keySource: The key source for the transparent data encryption. Required. Known values + are: "MicrosoftManaged" and "CustomerManaged". + :vartype keySource: Union[str, "TransparentDataEncryptionKeySource"] + :ivar keyVaultKeyUri: The URI of the key in Key Vault to be used for transparent data + encryption. + :vartype keyVaultKeyUri: str + :ivar autoRotationEnabled: Indicates whether auto-rotation of the customer-managed keys is + enabled for transparent data encryption. + :vartype autoRotationEnabled: bool + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + keySource: Required[Union[str, "TransparentDataEncryptionKeySource"]] + """The key source for the transparent data encryption. Required. Known values are: + \"MicrosoftManaged\" and \"CustomerManaged\".""" + keyVaultKeyUri: str + """The URI of the key in Key Vault to be used for transparent data encryption.""" + autoRotationEnabled: bool + """Indicates whether auto-rotation of the customer-managed keys is enabled for transparent data + encryption.""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py new file mode 100644 index 000000000000..3c218f805d01 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python detectors_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.detectors.get( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + detector_id="cpuhealth", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/Detectors_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py new file mode 100644 index 000000000000..ccb646de07dd --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python detectors_list_by_scheduler.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.detectors.list_by_scheduler( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/Detectors_ListByScheduler.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py new file mode 100644 index 000000000000..f471c8dabb65 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py @@ -0,0 +1,48 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_create_or_replace_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.begin_create_or_replace( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + resource={ + "properties": { + "partnerSchedulerResourceId": "/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask-secondary/providers/Microsoft.DurableTask/schedulers/testscheduler-secondary" + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_CreateOrReplace_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py new file mode 100644 index 000000000000..a9f8740e5976 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.failover_instances.begin_delete( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py new file mode 100644 index 000000000000..450906b6d357 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_failover.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.begin_failover( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_Failover.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py new file mode 100644 index 000000000000..076556b8de79 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_force_failover_allow_data_loss.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.begin_force_failover_allow_data_loss( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_ForceFailoverAllowDataLoss.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py new file mode 100644 index 000000000000..b292e0d32141 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.get( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py new file mode 100644 index 000000000000..6da395321c06 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_list_by_scheduler_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.list_by_scheduler( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_ListByScheduler_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py index 620d5d0dbd8e..318c01bc13db 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/Operations_List.json +# x-ms-original-file: 2026-07-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py index 5ed09e5d6d21..939987175565 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py index bad74af3e971..2c3974c0736c 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py index 6e0d8832d95a..64ddf5326515 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py index a5f4c3348534..83652ecc9cf4 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py index 3ad1d020dce3..fcde80cd55af 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Update.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Update.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py index a93718ecc69c..54a3beb79b65 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateLinkResources_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py index 377f28ae4385..3727cd15fd15 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/PrivateLinkResources_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py index c4b2b2dd832c..57acc66c93b1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py index 7db2aeac74d2..599aad86378f 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/RetentionPolicies_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py index 19f9ba8febac..ec6426163dbe 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/RetentionPolicies_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py index 7570b91005ab..eae681d27a0e 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py index 6ee0acf008a8..c6a9478e3dc5 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/RetentionPolicies_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py index beb891aebcbe..952da95117af 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,12 @@ def main(): resource_group_name="rgopenapi", scheduler_name="testscheduler", resource={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/EE9BD735-67CE-4A90-89C4-439D3F6A4C93/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {} + }, + }, "location": "northcentralus", "properties": {"ipAllowlist": ["10.0.0.0/8"], "sku": {"name": "Dedicated"}}, "tags": {"department": "research", "development": "true"}, @@ -42,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/Schedulers_CreateOrUpdate.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py index 97e88de7bc3a..1ecca2392c29 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/Schedulers_Delete.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py index 984e5c0f16ea..a2c974f3f718 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/Schedulers_Get.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_Get.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py index f9ebb33fc3e5..1643bee20653 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/Schedulers_ListByResourceGroup.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py index 13415de76658..f6d0ea4ca28d 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/Schedulers_ListBySubscription.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py new file mode 100644 index 000000000000..7599dac0fe6b --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python schedulers_restart.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.schedulers.restart( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + ) + + +# x-ms-original-file: 2026-07-01-preview/Schedulers_Restart.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py index 2338bcbe2e79..7d2f5d783912 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py @@ -34,6 +34,7 @@ def main(): resource_group_name="rgopenapi", scheduler_name="testscheduler", properties={ + "identity": {"type": "None"}, "properties": {"ipAllowlist": ["10.0.0.0/8"], "sku": {"capacity": 3, "name": "Dedicated"}}, "tags": {"hello": "world"}, }, @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/Schedulers_Update.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_Update.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py index d0109c2be9e9..6b05cd350abe 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py @@ -34,11 +34,11 @@ def main(): resource_group_name="rgopenapi", scheduler_name="testscheduler", task_hub_name="testtaskhub", - resource={"properties": {}}, + resource={"properties": {"capabilities": ["ExampleFutureCapability"]}}, ).result() print(response) -# x-ms-original-file: 2026-02-01/TaskHubs_CreateOrUpdate.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py index 2aad219c26bc..48ba140f3f7a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/TaskHubs_Delete.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py index 117a8fec166a..9893b9cdb3fb 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/TaskHubs_Get.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_Get.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py index 3c72c31ad9ce..d863225880cf 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/TaskHubs_ListByScheduler.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_ListByScheduler.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py new file mode 100644 index 000000000000..192fdb6d1909 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.begin_create_or_update( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + resource={"properties": {"throughput": {"actionsPerSecond": 40}}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py new file mode 100644 index 000000000000..d8cd7fe31613 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_create_or_update_minimum_set.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.begin_create_or_update( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + resource={"properties": {}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate_MinimumSet.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py new file mode 100644 index 000000000000..b80ba90ea7df --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.task_queues.begin_delete( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + ).result() + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py new file mode 100644 index 000000000000..0c51754dfddb --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.get( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py new file mode 100644 index 000000000000..d0790fa139bc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_list_by_task_hub.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.list_by_task_hub( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_ListByTaskHub.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py new file mode 100644 index 000000000000..8918683d296a --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.begin_update( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + properties={"properties": {"throughput": {"actionsPerSecond": 80}}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py new file mode 100644 index 000000000000..021f04d149bc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_create_or_replace_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.transparent_data_encryptions.begin_create_or_replace( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + resource={ + "properties": { + "autoRotationEnabled": True, + "keySource": "CustomerManaged", + "keyVaultKeyUri": "https://microsoft.com/ap", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_CreateOrReplace_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py new file mode 100644 index 000000000000..ed6261c60b37 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.transparent_data_encryptions.begin_delete( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py new file mode 100644 index 000000000000..fd53e1a7ca74 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.transparent_data_encryptions.get( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py new file mode 100644 index 000000000000..62de924bdca2 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.transparent_data_encryptions.list_by_scheduler( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_ListByScheduler_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py new file mode 100644 index 000000000000..bb146fedc8c8 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtDetectorsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_detectors_get(self, resource_group): + response = self.client.detectors.get( + resource_group_name=resource_group.name, + scheduler_name="str", + detector_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_detectors_list_by_scheduler(self, resource_group): + response = self.client.detectors.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py new file mode 100644 index 000000000000..a0c3501947cc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtDetectorsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_detectors_get(self, resource_group): + response = await self.client.detectors.get( + resource_group_name=resource_group.name, + scheduler_name="str", + detector_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_detectors_list_by_scheduler(self, resource_group): + response = self.client.detectors.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py new file mode 100644 index 000000000000..100682d5baea --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtFailoverInstancesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_get(self, resource_group): + response = self.client.failover_instances.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_create_or_replace(self, resource_group): + response = self.client.failover_instances.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "partnerSchedulerResourceId": "str", + "failoverState": "str", + "partnerSchedulerLocation": "str", + "provisioningState": "str", + "replicationRole": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_delete(self, resource_group): + response = self.client.failover_instances.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_list_by_scheduler(self, resource_group): + response = self.client.failover_instances.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_failover(self, resource_group): + response = self.client.failover_instances.begin_failover( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_force_failover_allow_data_loss(self, resource_group): + response = self.client.failover_instances.begin_force_failover_allow_data_loss( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py new file mode 100644 index 000000000000..ee616e089643 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtFailoverInstancesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_get(self, resource_group): + response = await self.client.failover_instances.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.failover_instances.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "partnerSchedulerResourceId": "str", + "failoverState": "str", + "partnerSchedulerLocation": "str", + "provisioningState": "str", + "replicationRole": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_delete(self, resource_group): + response = await ( + await self.client.failover_instances.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_list_by_scheduler(self, resource_group): + response = self.client.failover_instances.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_failover(self, resource_group): + response = await ( + await self.client.failover_instances.begin_failover( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_force_failover_allow_data_loss(self, resource_group): + response = await ( + await self.client.failover_instances.begin_force_failover_allow_data_loss( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py index 81a9af59bc7c..583b9a8bcff8 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py @@ -38,6 +38,12 @@ def test_schedulers_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "ipAllowlist": ["str"], @@ -94,6 +100,12 @@ def test_schedulers_begin_update(self, resource_group): resource_group_name=resource_group.name, scheduler_name="str", properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { "endpoint": "str", "ipAllowlist": ["str"], @@ -251,3 +263,14 @@ def test_schedulers_list_private_endpoint_connections(self, resource_group): result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_schedulers_restart(self, resource_group): + response = self.client.schedulers.restart( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py index e6418815bf3e..296130c61b94 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py @@ -40,6 +40,12 @@ async def test_schedulers_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "ipAllowlist": ["str"], @@ -98,6 +104,12 @@ async def test_schedulers_begin_update(self, resource_group): resource_group_name=resource_group.name, scheduler_name="str", properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { "endpoint": "str", "ipAllowlist": ["str"], @@ -264,3 +276,14 @@ async def test_schedulers_list_private_endpoint_connections(self, resource_group result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_schedulers_restart(self, resource_group): + response = await self.client.schedulers.restart( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py index 5493ac320100..825bf0fa5090 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py @@ -40,7 +40,7 @@ def test_task_hubs_begin_create_or_update(self, resource_group): resource={ "id": "str", "name": "str", - "properties": {"dashboardUrl": "str", "provisioningState": "str"}, + "properties": {"capabilities": ["str"], "dashboardUrl": "str", "provisioningState": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py index c345f405a6fc..4491e1ee0191 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py @@ -42,7 +42,7 @@ async def test_task_hubs_begin_create_or_update(self, resource_group): resource={ "id": "str", "name": "str", - "properties": {"dashboardUrl": "str", "provisioningState": "str"}, + "properties": {"capabilities": ["str"], "dashboardUrl": "str", "provisioningState": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py new file mode 100644 index 000000000000..6d672190401c --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTaskQueuesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_get(self, resource_group): + response = self.client.task_queues.get( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_begin_create_or_update(self, resource_group): + response = self.client.task_queues.begin_create_or_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + resource={ + "id": "str", + "name": "str", + "properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_begin_update(self, resource_group): + response = self.client.task_queues.begin_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + properties={"properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_begin_delete(self, resource_group): + response = self.client.task_queues.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_list_by_task_hub(self, resource_group): + response = self.client.task_queues.list_by_task_hub( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py new file mode 100644 index 000000000000..abb160991551 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTaskQueuesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_get(self, resource_group): + response = await self.client.task_queues.get( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_begin_create_or_update(self, resource_group): + response = await ( + await self.client.task_queues.begin_create_or_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + resource={ + "id": "str", + "name": "str", + "properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_begin_update(self, resource_group): + response = await ( + await self.client.task_queues.begin_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + properties={"properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_begin_delete(self, resource_group): + response = await ( + await self.client.task_queues.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_list_by_task_hub(self, resource_group): + response = self.client.task_queues.list_by_task_hub( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py new file mode 100644 index 000000000000..6282b5e8c988 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTransparentDataEncryptionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_get(self, resource_group): + response = self.client.transparent_data_encryptions.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_begin_create_or_replace(self, resource_group): + response = self.client.transparent_data_encryptions.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "keySource": "str", + "autoRotationEnabled": bool, + "keyVaultKeyUri": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_begin_delete(self, resource_group): + response = self.client.transparent_data_encryptions.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_list_by_scheduler(self, resource_group): + response = self.client.transparent_data_encryptions.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py new file mode 100644 index 000000000000..2b58c6610e8c --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTransparentDataEncryptionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_get(self, resource_group): + response = await self.client.transparent_data_encryptions.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.transparent_data_encryptions.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "keySource": "str", + "autoRotationEnabled": bool, + "keyVaultKeyUri": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_begin_delete(self, resource_group): + response = await ( + await self.client.transparent_data_encryptions.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_list_by_scheduler(self, resource_group): + response = self.client.transparent_data_encryptions.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml b/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml index 1f7687cf95b6..f2b328fa5732 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml +++ b/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml @@ -13,17 +13,17 @@ authors = [ description = "Microsoft Azure Durabletask Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", @@ -77,7 +77,7 @@ package_name = "azure-mgmt-durabletask" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Durabletask Management" package_doc_id = "" -is_stable = true +is_stable = false is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml b/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml index 88b0416152cb..83acb22e0796 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml +++ b/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/durabletask/DurableTask.Management -commit: a86317f00c71ef51aab7f78e6f4a2be3cf58f2cd +directory: specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask +commit: f1f796502a81c1cf4d44fe97109e8a71fe8ba485 repo: Azure/azure-rest-api-specs additionalDirectories: From 91855742c14d3703155bcec7197f103ad65dc51b Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Wed, 21 Oct 2026 10:49:51 +0800 Subject: [PATCH 07/35] Add ARM SDK approver team to CODEOWNERS (#49596) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7f6d3bdd67b0..315f6003b751 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -798,7 +798,7 @@ # Management Libraries #################### -/**/*mgmt*/ @ChenxiJiang333 @msyyc +/**/*mgmt*/ @ChenxiJiang333 @msyyc @Azure/azure-arm-sdk-approver # ServiceLabel: %ARM %Service Attention # ServiceOwners: @armleads-azure @@ -859,10 +859,10 @@ /eng/tools/emitter/ @tadelesh @msyyc @iscai-msft @xirzec @lirenhe @ChenxiJiang333 /pylintrc @JennyPng @l0lawrence @danieljurek @laiapat -/sdk/**/ci.yml @JennyPng @l0lawrence @msyyc @xirzec @danieljurek +/sdk/**/ci.yml @JennyPng @l0lawrence @msyyc @xirzec @danieljurek @Azure/azure-arm-sdk-approver # Add Johnathan Walker as code owner for Event Hubs SDK /sdk/eventhub/azure-eventhub/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 # Add Johnathan Walker as code owner for Service Bus SDK -/sdk/servicebus/azure-servicebus/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 +/sdk/servicebus/azure-servicebus/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 \ No newline at end of file From 0bf19a3231c2858ed03cfb8dc03fc68f3217db36 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Wed, 21 Oct 2026 12:23:43 +0800 Subject: [PATCH 08/35] Use existing ARM SDK reviewers team in CODEOWNERS (#49634) Follow up on #49596 by replacing the new approver team with the existing azure-arm-sdk-reviewers team. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 315f6003b751..de168fce4e40 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -798,7 +798,7 @@ # Management Libraries #################### -/**/*mgmt*/ @ChenxiJiang333 @msyyc @Azure/azure-arm-sdk-approver +/**/*mgmt*/ @ChenxiJiang333 @msyyc @Azure/azure-arm-sdk-reviewers # ServiceLabel: %ARM %Service Attention # ServiceOwners: @armleads-azure @@ -859,7 +859,7 @@ /eng/tools/emitter/ @tadelesh @msyyc @iscai-msft @xirzec @lirenhe @ChenxiJiang333 /pylintrc @JennyPng @l0lawrence @danieljurek @laiapat -/sdk/**/ci.yml @JennyPng @l0lawrence @msyyc @xirzec @danieljurek @Azure/azure-arm-sdk-approver +/sdk/**/ci.yml @JennyPng @l0lawrence @msyyc @xirzec @danieljurek @Azure/azure-arm-sdk-reviewers # Add Johnathan Walker as code owner for Event Hubs SDK /sdk/eventhub/azure-eventhub/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 From f8bcbd03f816c519aade2ec6452674dfe3dbda7d Mon Sep 17 00:00:00 2001 From: Kashif Khan <361477+kashifkhan@users.noreply.github.com> Date: Wed, 21 Oct 2026 08:53:47 -0500 Subject: [PATCH 09/35] [Identity] Aio Token Fix (#49533) * fix with hashing * tests * update tests * update changelog * update changelog version * black fix --- sdk/identity/azure-identity/CHANGELOG.md | 6 + .../identity/_internal/aad_client_base.py | 28 +- .../azure-identity/azure/identity/_version.py | 2 +- .../identity/aio/_credentials/on_behalf_of.py | 46 +- .../identity/aio/_internal/aad_client.py | 6 +- .../azure-identity/tests/obo_cache_process.py | 76 ++++ .../azure-identity/tests/test_obo_async.py | 429 +++++++++++++++++- 7 files changed, 554 insertions(+), 39 deletions(-) create mode 100644 sdk/identity/azure-identity/tests/obo_cache_process.py diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index 0ab940da5849..15e5d69dd824 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.26.1 (Unreleased) + +### Bugs Fixed + +- Fixed a regression in 1.26.0 where asynchronous `OnBehalfOfCredential` instances could not reuse access or refresh tokens cached by another instance with the same user assertion. Cache entries are now isolated by user assertion, allowing safe reuse across instances, including with `TokenCachePersistenceOptions`. Existing cache entries without assertion binding require a fresh token exchange. ([#49533](https://github.com/Azure/azure-sdk-for-python/pull/49533)) + ## 1.26.0 (2026-09-30) ### Features Added diff --git a/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py b/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py index 0ee80452122c..85837b9230cf 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py @@ -4,6 +4,7 @@ # ------------------------------------ import abc import base64 +import hashlib import json import logging import time @@ -21,7 +22,6 @@ from .aadclient_certificate import AadClientCertificate from .._persistent_cache import _load_persistent_cache - if TYPE_CHECKING: from azure.core.pipeline import AsyncPipeline, Pipeline from azure.core.pipeline.policies import AsyncHTTPPolicy, HTTPPolicy, SansIOHTTPPolicy @@ -48,12 +48,14 @@ def __init__( # pylint: disable=too-many-positional-arguments cae_cache: Optional[TokenCache] = None, *, additionally_allowed_tenants: Optional[List[str]] = None, + obo_assertion: Optional[str] = None, **kwargs: Any, ) -> None: self._authority = normalize_authority(authority) if authority else get_default_authority() self._tenant_id = tenant_id self._client_id = client_id + self._obo_assertion_hash = hashlib.sha256(obo_assertion.encode("utf-8")).hexdigest() if obo_assertion else None self._additionally_allowed_tenants = additionally_allowed_tenants or [] self._pipeline = self._build_pipeline(**kwargs) @@ -77,6 +79,17 @@ def __init__( # pylint: disable=too-many-positional-arguments # constrain later cache lookups to that account specifically. self.last_home_account_id: Optional[str] = None + def _get_cache_client_id(self, **kwargs: Any) -> str: + if self._obo_assertion_hash: + tenant = resolve_tenant( + self._tenant_id, additionally_allowed_tenants=self._additionally_allowed_tenants, **kwargs + ) + # MSAL's account-based keys don't distinguish assertions for the same user. Use an OBO-only + # client namespace for cache storage, never on the wire, so both access and refresh tokens + # remain bound to the exact assertion, authority and requested tenant across instances. + return "{}:obo:{}:{}:{}".format(self._client_id, self._obo_assertion_hash, self._authority, tenant) + return self._client_id + def _get_cache(self, **kwargs: Any) -> TokenCache: cache = self._cae_cache if kwargs.get("enable_cae") else self._cache if not cache: @@ -106,7 +119,7 @@ def get_cached_access_token( self._tenant_id, additionally_allowed_tenants=self._additionally_allowed_tenants, **kwargs ) - query: Dict[str, Any] = {"client_id": self._client_id, "realm": tenant} + query: Dict[str, Any] = {"client_id": self._get_cache_client_id(**kwargs), "realm": tenant} if home_account_id: # Constrain the search to the account established by this credential, so a cache shared by multiple # accounts (e.g. a persistent cache shared by several `AuthorizationCodeCredential` instances) can't @@ -142,7 +155,7 @@ def get_cached_refresh_tokens( self, scopes: Iterable[str], home_account_id: Optional[str] = None, **kwargs ) -> List[Dict]: cache = self._get_cache(**kwargs) - query: Dict[str, Any] = {"client_id": self._client_id} + query: Dict[str, Any] = {"client_id": self._get_cache_client_id(**kwargs)} if home_account_id: # Constrain the search to the account established by this credential, so a cache shared by multiple # accounts (e.g. a persistent cache shared by several `AuthorizationCodeCredential` instances) can't @@ -190,12 +203,15 @@ def _process_response(self, response: PipelineResponse, request_time: int, **kwa cache = self._get_cache(**kwargs) if response.http_request.body.get("grant_type") == "refresh_token": + refresh_token_query = {"secret": response.http_request.body["refresh_token"]} + if self._obo_assertion_hash: + refresh_token_query["client_id"] = self._get_cache_client_id(**kwargs) if content.get("error") == "invalid_grant": # the request's refresh token is invalid -> evict it from the cache cache_entries = list( cache.search( TokenCache.CredentialType.REFRESH_TOKEN, - query={"secret": response.http_request.body["refresh_token"]}, + query=refresh_token_query, ) ) for invalid_token in cache_entries: @@ -205,7 +221,7 @@ def _process_response(self, response: PipelineResponse, request_time: int, **kwa cache_entries = list( cache.search( TokenCache.CredentialType.REFRESH_TOKEN, - query={"secret": response.http_request.body["refresh_token"]}, + query=refresh_token_query, ) ) # If the old token is in multiple cache entries, the cache is in a state we don't @@ -245,7 +261,7 @@ def _process_response(self, response: PipelineResponse, request_time: int, **kwa # caching is the final step because 'add' mutates 'content' cache.add( event={ - "client_id": self._client_id, + "client_id": self._get_cache_client_id(**kwargs), "response": content, "scope": response.http_request.body["scope"].split(), "token_endpoint": response.http_request.url, diff --git a/sdk/identity/azure-identity/azure/identity/_version.py b/sdk/identity/azure-identity/azure/identity/_version.py index 7bf5f5179a02..bf1a5a06394c 100644 --- a/sdk/identity/azure-identity/azure/identity/_version.py +++ b/sdk/identity/azure-identity/azure/identity/_version.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -VERSION = "1.26.0" +VERSION = "1.26.1" diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/on_behalf_of.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/on_behalf_of.py index 9ce25a1464a1..762901b2a48a 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/on_behalf_of.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/on_behalf_of.py @@ -102,7 +102,7 @@ def __init__( raise TypeError('Either "client_certificate", "client_secret", or "client_assertion_func" must be provided') # note AadClient handles "authority" and any pipeline kwargs - self._client = AadClient(tenant_id, client_id, **kwargs) + self._client = AadClient(tenant_id, client_id, obo_assertion=self._assertion, **kwargs) async def __aenter__(self) -> "OnBehalfOfCredential": await self._client.__aenter__() @@ -113,34 +113,24 @@ async def close(self) -> None: await self._client.close() async def _acquire_token_silently(self, *scopes: str, **kwargs: Any) -> Optional[AccessTokenInfo]: - if not self._client.token_exchanged or not self._client.last_home_account_id: - # Either this credential hasn't yet exchanged its assertion, so its account isn't established, or it - # did but the STS response didn't let us determine the resulting account's identity. In both cases, a - # cache shared with other accounts must not satisfy this credential's token request because doing so - # risks returning another account's token. - return None - return self._client.get_cached_access_token(scopes, home_account_id=self._client.last_home_account_id, **kwargs) + # The cache namespace binds tokens to the exact assertion, not this instance or decoded account claims. + # This permits per-request credentials to reuse tokens without trusting an assertion Entra hasn't accepted. + return self._client.get_cached_access_token(scopes, **kwargs) async def _request_token(self, *scopes: str, **kwargs: Any) -> AccessTokenInfo: - if self._client.token_exchanged and self._client.last_home_account_id: - # Note we assume the cache has tokens for one user only. That's okay because each instance of this class - # is locked to a single user (assertion). This assumption will become unsafe if this class allows - # applications to change an instance's assertion. - refresh_tokens = self._client.get_cached_refresh_tokens( - scopes, home_account_id=self._client.last_home_account_id, **kwargs - ) - if len(refresh_tokens) == 1: # there should be only one - try: - refresh_token = refresh_tokens[0]["secret"] - return await self._client.obtain_token_by_refresh_token_on_behalf_of( - scopes, self._client_credential, refresh_token, **kwargs - ) - except ClientAuthenticationError as ex: - _LOGGER.debug("silent authentication failed: %s", ex, exc_info=True) - except (IndexError, KeyError, TypeError) as ex: - # this is purely defensive, hasn't been observed in practice - _LOGGER.debug("silent authentication failed due to malformed refresh token: %s", ex, exc_info=True) - - # we don't have a refresh token bound to this credential's account, or silent auth failed: + refresh_tokens = self._client.get_cached_refresh_tokens(scopes, **kwargs) + if len(refresh_tokens) == 1: # there should be only one + try: + refresh_token = refresh_tokens[0]["secret"] + return await self._client.obtain_token_by_refresh_token_on_behalf_of( + scopes, self._client_credential, refresh_token, **kwargs + ) + except ClientAuthenticationError as ex: + _LOGGER.debug("silent authentication failed: %s", ex, exc_info=True) + except (IndexError, KeyError, TypeError) as ex: + # this is purely defensive, hasn't been observed in practice + _LOGGER.debug("silent authentication failed due to malformed refresh token: %s", ex, exc_info=True) + + # we don't have a refresh token bound to this credential's assertion, or silent auth failed: # acquire a new token from the assertion return await self._client.obtain_token_on_behalf_of(scopes, self._client_credential, self._assertion, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py b/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py index bfe2625f24da..400cb2da2daf 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py @@ -87,11 +87,11 @@ def _build_pipeline(self, **kwargs) -> AsyncPipeline: async def _run_pipeline(self, request: HttpRequest, **kwargs) -> AccessTokenInfo: # remove tenant_id and claims kwarg that could have been passed from credential's get_token method - # tenant_id is already part of `request` at this point - kwargs.pop("tenant_id", None) + # tenant_id is already part of `request`, but response processing needs it to select the OBO cache namespace. + tenant_id = kwargs.pop("tenant_id", None) kwargs.pop("claims", None) kwargs.pop("client_secret", None) enable_cae = kwargs.pop("enable_cae", False) now = int(time.time()) response = await self._pipeline.run(request, retry_on_methods=self._POST, **kwargs) - return self._process_response(response, now, enable_cae=enable_cae, **kwargs) + return self._process_response(response, now, enable_cae=enable_cae, tenant_id=tenant_id, **kwargs) diff --git a/sdk/identity/azure-identity/tests/obo_cache_process.py b/sdk/identity/azure-identity/tests/obo_cache_process.py new file mode 100644 index 000000000000..7fbf877c6f0c --- /dev/null +++ b/sdk/identity/azure-identity/tests/obo_cache_process.py @@ -0,0 +1,76 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Subprocess worker for the async OBO persistent cache regression test.""" + +import asyncio +import json +from pathlib import Path +import sys +from unittest.mock import patch + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) + +from azure.identity import TokenCachePersistenceOptions +from azure.identity.aio import OnBehalfOfCredential +from msal_extensions import FilePersistence + +from helpers import build_aad_response, mock_response +from helpers_async import AsyncMockTransport + + +async def main(): + settings = json.load(sys.stdin) + directory = Path(settings["directory"]) + assertion = settings["assertion"] + requests = [] + + async def send(request, **kwargs): + assert request.body["client_id"] == "client-id" + requests.append(request.body["grant_type"]) + if settings["mode"] == "write": + assert request.body["assertion"] == assertion + assert "refresh_token" not in request.body + (directory / (assertion + ".ready")).touch() + + async def wait_for_writers(): + while not all((directory / (user + ".ready")).exists() for user in ("a", "b")): + await asyncio.sleep(0.01) + + await asyncio.wait_for(wait_for_writers(), timeout=10) + return mock_response( + json_payload=build_aad_response( + access_token="access-" + assertion, + refresh_token="refresh-" + assertion, + expires_in=0 if settings["expired"] else 3600, + uid="same-user", + utid="home-tenant", + ) + ) + assert settings["mode"] == "refresh", "a new process unexpectedly contacted the token endpoint" + assert request.body["refresh_token"] == "refresh-" + assertion + assert "assertion" not in request.body + return mock_response( + json_payload=build_aad_response(access_token="refreshed-" + assertion, refresh_token="rotated-" + assertion) + ) + + def persistence(**kwargs): + return FilePersistence(str(directory / kwargs["cache_name"])) + + with patch("azure.identity._persistent_cache._get_persistence", persistence): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion=assertion, + cache_persistence_options=TokenCachePersistenceOptions(name="obo-process-test"), + transport=AsyncMockTransport(send=send), + ) as credential: + token = await credential.get_token("scope", enable_cae=settings["enable_cae"]) + refresh_tokens = credential._client.get_cached_refresh_tokens(["scope"], enable_cae=settings["enable_cae"]) + print(json.dumps({"token": token.token, "requests": requests, "refresh_tokens": refresh_tokens})) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/sdk/identity/azure-identity/tests/test_obo_async.py b/sdk/identity/azure-identity/tests/test_obo_async.py index 585a9d7d03f6..20f9f179b9e5 100644 --- a/sdk/identity/azure-identity/tests/test_obo_async.py +++ b/sdk/identity/azure-identity/tests/test_obo_async.py @@ -3,6 +3,10 @@ # Licensed under the MIT License. # ------------------------------------ import os +import asyncio +import json +import sys +from pathlib import Path from itertools import product from urllib.parse import urlparse from unittest.mock import Mock, patch @@ -12,7 +16,7 @@ from devtools_testutils import is_live from devtools_testutils.aio import recorded_by_proxy_async from azure.core.pipeline.policies import ContentDecodePolicy, SansIOHTTPPolicy -from azure.identity import UsernamePasswordCredential +from azure.identity import TokenCachePersistenceOptions, UsernamePasswordCredential from azure.identity._constants import EnvironmentVariables from azure.identity._internal.aad_client_base import JWT_BEARER_ASSERTION from azure.identity._internal.user_agent import USER_AGENT @@ -403,6 +407,429 @@ async def send_b(request, **kwargs): assert credential_b._client.last_home_account_id == "b.utid" +@pytest.mark.asyncio +@pytest.mark.parametrize("get_token_method", GET_TOKEN_METHODS) +@pytest.mark.parametrize("expired", [True, False]) +async def test_shared_cache_per_request_credentials(get_token_method, expired): + """Per-request credentials reuse exact-assertion tokens, including after refresh. + + Different assertions for one account can coexist, as with concurrent sessions or upstream token renewal. + """ + shared_cache = msal.TokenCache() + requests = [] + + async def send(request, **kwargs): + assertion = request.body.get("assertion") + refresh_token = request.body.get("refresh_token") + requests.append((assertion, refresh_token)) + if refresh_token: + assert refresh_token == "refresh-a" + return mock_response(json_payload=build_aad_response(access_token="refreshed-a")) + return mock_response( + json_payload=build_aad_response( + access_token="access-" + assertion, + refresh_token="refresh-" + assertion, + expires_in=0 if expired and assertion == "a" else 3600, + uid="same-user", + utid="tenant", + ) + ) + + transport = AsyncMockTransport(send=send) + for assertion, expected_token in ( + ("a", "access-a"), + ("b", "access-b"), + ("a", "refreshed-a" if expired else "access-a"), + ("a", "refreshed-a" if expired else "access-a"), + ("b", "access-b"), + ): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion=assertion, + cache=shared_cache, + transport=transport, + ) as credential: + assert (await getattr(credential, get_token_method)("scope")).token == expected_token + + assert requests == ([("a", None), ("b", None), (None, "refresh-a")] if expired else [("a", None), ("b", None)]) + + +@pytest.fixture +def persistent_obo_cache(tmp_path, monkeypatch): + from msal_extensions import FilePersistence + + def get_persistence(**kwargs): + return FilePersistence(str(tmp_path / kwargs["cache_name"])) + + monkeypatch.setattr("azure.identity._persistent_cache._get_persistence", get_persistence) + return TokenCachePersistenceOptions(name="obo-test", allow_unencrypted_storage=True) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("get_token_method", GET_TOKEN_METHODS) +@pytest.mark.parametrize("enable_cae", [True, False]) +@pytest.mark.parametrize("account_info", [True, False]) +async def test_persistent_cache_new_instance(persistent_obo_cache, get_token_method, enable_cae, account_info): + """A new per-request credential reads the same assertion's token from a separate persistent cache object.""" + + async def send(request, **kwargs): + assert request.body["client_id"] == "client-id" + assert request.body["assertion"] == "assertion" + return mock_response( + json_payload=build_aad_response( + access_token="cached-token", + uid="user" if account_info else None, + utid="tenant" if account_info else None, + ) + ) + + transport = AsyncMockTransport(send=Mock(wraps=send)) + options = {"enable_cae": enable_cae} + kwargs = {"options": options} if get_token_method == "get_token_info" else options + caches = [] + for _ in range(2): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion="assertion", + cache_persistence_options=persistent_obo_cache, + transport=transport, + ) as credential: + token = await getattr(credential, get_token_method)("scope", **kwargs) + assert token.token == "cached-token" + caches.append(credential._client._get_cache(enable_cae=enable_cae)) + assert caches[0] is not caches[1] + assert transport.send.call_count == 1 + + +@pytest.mark.asyncio +@pytest.mark.parametrize("get_token_method", GET_TOKEN_METHODS) +@pytest.mark.parametrize("enable_cae", [True, False]) +@pytest.mark.parametrize("same_account", [True, False]) +@pytest.mark.parametrize("expired", [True, False]) +async def test_persistent_cache_assertion_isolation( + persistent_obo_cache, get_token_method, enable_cae, same_account, expired +): + """Assertion renewal must not overwrite another assertion's access or refresh tokens, even for one account.""" + requests = [] + + async def send(request, **kwargs): + assert request.body["client_id"] == "client-id" + assertion = request.body.get("assertion") + refresh_token = request.body.get("refresh_token") + requests.append((assertion, refresh_token)) + if refresh_token: + assert refresh_token == "refresh-a" + # A rotation response need not identify the account. + return mock_response( + json_payload=build_aad_response( + access_token="refreshed-a", + refresh_token="rotated-a", + expires_in=0, + ) + ) + return mock_response( + json_payload=build_aad_response( + access_token="access-" + assertion, + refresh_token="refresh-" + assertion, + expires_in=0 if expired else 3600, + uid="same-user" if same_account else assertion, + utid="tenant", + ) + ) + + transport = AsyncMockTransport(send=Mock(wraps=send)) + options = {"enable_cae": enable_cae} + kwargs = {"options": options} if get_token_method == "get_token_info" else options + for assertion in ("a", "b", "a"): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion=assertion, + cache_persistence_options=persistent_obo_cache, + transport=transport, + ) as credential: + token = await getattr(credential, get_token_method)("scope", **kwargs) + assert token.token == ("refreshed-a" if expired and len(requests) == 3 else "access-" + assertion) + assert requests == ([("a", None), ("b", None), (None, "refresh-a")] if expired else [("a", None), ("b", None)]) + + if expired: + + async def send_rotated(request, **kwargs): + assert request.body["refresh_token"] == "rotated-a" + return mock_response(json_payload=build_aad_response(access_token="after-rotation")) + + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion="a", + cache_persistence_options=persistent_obo_cache, + transport=AsyncMockTransport(send=send_rotated), + ) as credential: + assert (await getattr(credential, get_token_method)("scope", **kwargs)).token == "after-rotation" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("enable_cae", [True, False]) +async def test_persistent_cache_ignores_unbound_entries(persistent_obo_cache, enable_cae): + from azure.identity._persistent_cache import _load_persistent_cache + + cache = _load_persistent_cache(persistent_obo_cache, enable_cae) + cache.add( + { + "client_id": "client-id", + "scope": ["scope"], + "token_endpoint": "https://login.microsoftonline.com/tenant-id/oauth2/v2.0/token", + "response": build_aad_response( + access_token="legacy-token", + refresh_token="legacy-refresh", + uid="user", + utid="tenant", + ), + } + ) + + async def send(request, **kwargs): + assert request.body["assertion"] == "assertion" + assert "refresh_token" not in request.body + return mock_response(json_payload=build_aad_response(access_token="bound-token")) + + transport = AsyncMockTransport(send=Mock(wraps=send)) + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion="assertion", + cache_persistence_options=persistent_obo_cache, + transport=transport, + ) as credential: + assert (await credential.get_token("scope", enable_cae=enable_cae)).token == "bound-token" + assert transport.send.call_count == 1 + + +@pytest.mark.asyncio +@pytest.mark.parametrize("expired", [True, False]) +async def test_persistent_cache_client_tenant_and_authority_isolation(persistent_obo_cache, expired): + requests = [] + + async def send(request, **kwargs): + assert "refresh_token" not in request.body + requests.append(request.url) + return mock_response( + json_payload=build_aad_response( + access_token=request.body["client_id"] + ":" + request.url, + refresh_token="refresh", + expires_in=0 if expired else 3600, + uid="same-user", + utid="home-tenant", + ) + ) + + for client, authority, tenant in ( + ("client-id", "https://login.microsoftonline.com", "tenant-a"), + ("client-id", "https://login.microsoftonline.com", "tenant-b"), + ("client-id", "https://other-authority", "tenant-a"), + ("other-client", "https://login.microsoftonline.com", "tenant-a"), + ): + async with OnBehalfOfCredential( + "tenant-a", + client, + client_secret="secret", + user_assertion="assertion", + authority=authority, + additionally_allowed_tenants=["tenant-b"], + cache_persistence_options=persistent_obo_cache, + transport=AsyncMockTransport(send=send), + ) as credential: + token = await credential.get_token("scope", tenant_id=tenant) + assert token.token == f"{client}:{authority}/{tenant}/oauth2/v2.0/token" + assert len(requests) == 4 + + +@pytest.mark.asyncio +async def test_persistent_cache_claims_and_scopes(persistent_obo_cache): + requests = [] + + async def send(request, **kwargs): + requests.append((request.body["scope"], request.body.get("claims"))) + return mock_response(json_payload=build_aad_response(access_token=str(len(requests)))) + + for scope, claims in (("scope", None), ("other-scope", None), ("scope", '{"access_token": {}}')): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion="assertion", + cache_persistence_options=persistent_obo_cache, + transport=AsyncMockTransport(send=send), + ) as credential: + token = await credential.get_token(scope, claims=claims) + assert token.token == str(len(requests)) + assert requests == [("scope", None), ("other-scope", None), ("scope", '{"access_token": {}}')] + + +@pytest.mark.asyncio +async def test_persistent_cache_concurrent_writers(persistent_obo_cache): + ready = asyncio.Event() + requests = [] + + async def send(request, **kwargs): + assertion = request.body["assertion"] + requests.append(assertion) + if len(requests) == 2: + ready.set() + await ready.wait() + return mock_response( + json_payload=build_aad_response( + access_token=assertion, + uid="same-user", + utid="tenant", + ) + ) + + async def acquire(assertion, transport): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion=assertion, + cache_persistence_options=persistent_obo_cache, + transport=transport, + ) as credential: + assert (await credential.get_token("scope")).token == assertion + + await asyncio.gather(*(acquire(user, AsyncMockTransport(send=send)) for user in ("a", "b"))) + no_network = AsyncMockTransport(send=Mock(side_effect=AssertionError("unexpected exchange"))) + await asyncio.gather(*(acquire(user, no_network) for user in ("a", "b"))) + assert sorted(requests) == ["a", "b"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("invalid_grant", [True, False]) +async def test_persistent_cache_refresh_updates_are_assertion_bound(persistent_obo_cache, invalid_grant): + async def exchange(request, **kwargs): + return mock_response( + json_payload=build_aad_response( + access_token="expired", + refresh_token="shared-refresh-secret", + expires_in=0, + uid="same-user", + utid="tenant", + ) + ) + + for assertion in ("a", "b"): + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion=assertion, + cache_persistence_options=persistent_obo_cache, + transport=AsyncMockTransport(send=exchange), + ) as credential: + await credential.get_token("scope") + + a_requests = [] + + async def refresh_a(request, **kwargs): + a_requests.append(request.body["grant_type"]) + if request.body.get("refresh_token"): + assert request.body["refresh_token"] == "shared-refresh-secret" + if invalid_grant: + return mock_response(status_code=400, json_payload={"error": "invalid_grant"}) + return mock_response(json_payload=build_aad_response(access_token="refreshed-a", refresh_token="rotated-a")) + assert request.body["assertion"] == "a" + return mock_response(json_payload=build_aad_response(access_token="exchanged-a")) + + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion="a", + cache_persistence_options=persistent_obo_cache, + transport=AsyncMockTransport(send=refresh_a), + ) as credential: + token = await credential.get_token("scope") + assert token.token == ("exchanged-a" if invalid_grant else "refreshed-a") + refresh_tokens = credential._client.get_cached_refresh_tokens(["scope"]) + assert [entry["secret"] for entry in refresh_tokens] == ([] if invalid_grant else ["rotated-a"]) + + assert a_requests == ( + ["refresh_token", "urn:ietf:params:oauth:grant-type:jwt-bearer"] if invalid_grant else ["refresh_token"] + ) + + async def refresh_b(request, **kwargs): + assert request.body["refresh_token"] == "shared-refresh-secret" + assert "assertion" not in request.body + return mock_response(json_payload=build_aad_response(access_token="refreshed-b")) + + async with OnBehalfOfCredential( + "tenant-id", + "client-id", + client_secret="secret", + user_assertion="b", + cache_persistence_options=persistent_obo_cache, + transport=AsyncMockTransport(send=refresh_b), + ) as credential: + assert (await credential.get_token("scope")).token == "refreshed-b" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("enable_cae", [True, False]) +@pytest.mark.parametrize("expired", [True, False]) +async def test_persistent_cache_separate_processes(tmp_path, enable_cae, expired): + worker = Path(__file__).with_name("obo_cache_process.py") + + async def run(assertion, mode): + process = await asyncio.create_subprocess_exec( + sys.executable, + str(worker), + stdin=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + settings = json.dumps( + { + "directory": str(tmp_path), + "assertion": assertion, + "mode": mode, + "enable_cae": enable_cae, + "expired": expired, + } + ).encode() + try: + stdout, stderr = await asyncio.wait_for(process.communicate(settings), timeout=30) + finally: + if process.returncode is None: + process.kill() + await process.wait() + assert process.returncode == 0, stdout.decode() + stderr.decode() + return json.loads(stdout) + + writers = await asyncio.gather(*(run(user, "write") for user in ("a", "b"))) + for user, result in zip(("a", "b"), writers): + assert result["token"] == "access-" + user + assert result["requests"] == ["urn:ietf:params:oauth:grant-type:jwt-bearer"] + + for user in ("a", "b"): + result = await run(user, "refresh" if expired else "read") + assert result["token"] == ("refreshed-" if expired else "access-") + user + assert result["requests"] == (["refresh_token"] if expired else []) + assert [entry["secret"] for entry in result["refresh_tokens"]] == [ + ("rotated-" if expired else "refresh-") + user + ] + # A third process must read the refreshed access token and rotated refresh token from disk. + repeated = await run(user, "read") + assert repeated["token"] == result["token"] + assert repeated["requests"] == [] + assert repeated["refresh_tokens"] == result["refresh_tokens"] + + def test_tenant_id_validation(): """The credential should raise ValueError when given an invalid tenant_id""" valid_ids = {"c878a2ab-8ef4-413b-83a0-199afb84d7fb", "contoso.onmicrosoft.com", "organizations", "common"} From c14465e38f345aa0679a74def95ccb9e4a9cfa29 Mon Sep 17 00:00:00 2001 From: M-Hietala <78813398+M-Hietala@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:50:30 -0500 Subject: [PATCH 10/35] Adding automated tests for cost control (#49524) * adding cost control tests * adding cost control test --- .../azure-mgmt-cognitiveservices/assets.json | 6 + .../tests/conftest.py | 15 ++ .../tests/test_cost_controls_live.py | 170 ++++++++++++ .../tests/test_cost_controls_operations.py | 242 +++++++++++++++++ .../test_cost_controls_operations_async.py | 251 ++++++++++++++++++ 5 files changed, 684 insertions(+) create mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/assets.json create mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py create mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py create mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/assets.json b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/assets.json new file mode 100644 index 000000000000..ac420de827aa --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "python", + "TagPrefix": "python/cognitiveservices/azure-mgmt-cognitiveservices", + "Tag": "python/cognitiveservices/azure-mgmt-cognitiveservices_af88212872" +} diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/conftest.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/conftest.py index de62be014178..ddc2bd4c2708 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/conftest.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/conftest.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os +import re import pytest from dotenv import load_dotenv from devtools_testutils import ( @@ -17,6 +18,9 @@ load_dotenv() +SANITIZED_RESOURCE_GROUP = "sanitized-resource-group" +SANITIZED_ACCOUNT_NAME = "sanitized-cognitive-account" + # aovid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) @@ -41,7 +45,18 @@ def add_sanitizers(test_proxy): add_general_regex_sanitizer( regex=cognitiveservicesmanagement_client_secret, value="00000000-0000-0000-0000-000000000000" ) + resource_group_name = os.environ.get("AZURE_RESOURCE_GROUP") + account_name = os.environ.get("AZURE_COGNITIVE_SERVICES_ACCOUNT") + if resource_group_name: + add_general_regex_sanitizer(regex=re.escape(resource_group_name), value=SANITIZED_RESOURCE_GROUP) + if account_name: + add_general_regex_sanitizer(regex=re.escape(account_name), value=SANITIZED_ACCOUNT_NAME) add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_header_regex_sanitizer(key="etag", value="Sanitized") + add_header_regex_sanitizer(key="if-match", value="Sanitized") + add_header_regex_sanitizer(key="x-ms-operation-identifier", value="Sanitized") + add_header_regex_sanitizer(key="x-ms-correlation-request-id", value="Sanitized") + add_header_regex_sanitizer(key="x-ms-routing-request-id", value="Sanitized") add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py new file mode 100644 index 000000000000..2d800db05679 --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py @@ -0,0 +1,170 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Live Cost Control lifecycle tests. + +TODO: Remove ``_PreviewApiVersionPolicy`` when the service accepts +``2026-09-15-preview`` for these operations. +""" + +import os +from types import SimpleNamespace + +import pytest + +from azure.core import MatchConditions +from azure.core.exceptions import ResourceNotFoundError +from azure.core.pipeline.policies import SansIOHTTPPolicy +from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient, models +from devtools_testutils import AzureMgmtRecordedTestCase, recorded_by_proxy + +SANITIZED_RESOURCE_GROUP = "sanitized-resource-group" +SANITIZED_ACCOUNT_NAME = "sanitized-cognitive-account" + + +class _PreviewApiVersionPolicy(SansIOHTTPPolicy): + """Temporarily send the working service API version on the wire.""" + + def on_request(self, request): + request.http_request.url = request.http_request.url.replace( + "api-version=2026-09-15-preview", + "api-version=2026-07-15-preview", + ) + + +def test_preview_api_version_policy(): + request = SimpleNamespace( + http_request=SimpleNamespace(url="https://management.azure.com/resource?api-version=2026-09-15-preview") + ) + + _PreviewApiVersionPolicy().on_request(request) + + assert request.http_request.url.endswith("api-version=2026-07-15-preview") + + +class TestCostControlsLive(AzureMgmtRecordedTestCase): + def setup_method(self, method): # pylint: disable=unused-argument + self.resource_group_name = _live_value(self, "AZURE_RESOURCE_GROUP", SANITIZED_RESOURCE_GROUP) + self.account_name = _live_value(self, "AZURE_COGNITIVE_SERVICES_ACCOUNT", SANITIZED_ACCOUNT_NAME) + self.client = self.create_mgmt_client( + CognitiveServicesManagementClient, + api_version="2026-09-15-preview", + per_call_policies=[_PreviewApiVersionPolicy()], + ) + + @recorded_by_proxy + def test_cost_control_lifecycle(self): + cost_control_name = self.get_resource_name("costctrl")[:64] + created = False + rule = _cost_control_rule(amount=25, threshold_action=models.CostControlThresholdAction.BLOCK) + + try: + cost_control = self.client.cost_controls.create_or_update( + self.resource_group_name, + self.account_name, + cost_control_name, + models.CostControl( + properties=models.CostControlProperties( + display_name="SDK live test", + rules=[rule], + ) + ), + etag="*", + match_condition=MatchConditions.IfMissing, + ) + created = True + assert cost_control.name + assert cost_control.type == "Microsoft.CognitiveServices/accounts/costControls" + assert cost_control.properties.rules[0].thresholds[0].action == models.CostControlThresholdAction.BLOCK + + fetched, response_headers = self.client.cost_controls.get( + self.resource_group_name, + self.account_name, + cost_control_name, + cls=lambda _, model, headers: (model, headers), + ) + etag = fetched.etag or response_headers["ETag"] + assert etag + assert fetched.properties.rules[0].thresholds[0].value == 80 + + cost_controls = list(self.client.cost_controls.list(self.resource_group_name, self.account_name)) + assert any(item.properties.display_name == "SDK live test" for item in cost_controls) + + updated = self.client.cost_controls.update( + self.resource_group_name, + self.account_name, + cost_control_name, + models.CostControlPatch( + properties=models.CostControlPatchProperties( + display_name="SDK live test updated", + rules=[ + _cost_control_rule(amount=50, threshold_action=models.CostControlThresholdAction.BLOCK) + ], + ) + ), + etag=etag, + match_condition=MatchConditions.IfNotModified, + ) + assert updated.properties.display_name == "SDK live test updated" + assert updated.properties.rules[0].amount == 50 + + fetched, response_headers = self.client.cost_controls.get( + self.resource_group_name, + self.account_name, + cost_control_name, + cls=lambda _, model, headers: (model, headers), + ) + etag = fetched.etag or response_headers["ETag"] + self.client.cost_controls.delete( + self.resource_group_name, + self.account_name, + cost_control_name, + etag=etag, + match_condition=MatchConditions.IfNotModified, + ) + created = False + + with pytest.raises(ResourceNotFoundError): + self.client.cost_controls.get( + self.resource_group_name, + self.account_name, + cost_control_name, + ) + finally: + if created: + try: + self.client.cost_controls.delete( + self.resource_group_name, + self.account_name, + cost_control_name, + ) + except ResourceNotFoundError: + pass + +def _cost_control_rule(amount, threshold_action): + return models.CostControlRule( + name="account-budget", + counter_key=[models.CostControlDimension(type="account")], + unit="usd", + amount=amount, + period="month", + recurring=True, + thresholds=[ + models.CostControlThreshold( + type="percentage", + value=80, + action=threshold_action, + ) + ], + ) + + +def _live_value(test_case, name, playback_value): + if not test_case.is_live: + return playback_value + value = os.environ.get(name) + if not value: + pytest.fail(f"Set {name} before running the live Cost Control tests.") + return value diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py new file mode 100644 index 000000000000..aa7cc3c45e87 --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Unit tests for Cost Control request serialization and response handling.""" + +import json +import time +from types import SimpleNamespace +from unittest.mock import MagicMock + +from azure.core import MatchConditions +from azure.core.credentials import AccessToken +from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient, models + + +SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000" +RESOURCE_ID = ( + f"/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/rg/providers/" + "Microsoft.CognitiveServices/accounts/acct/costControls/monthly-budget" +) + +THRESHOLDS = [ + models.CostControlThreshold(type="percentage", value=80, action="alert"), + models.CostControlThreshold(type="absolute", value=100, action="block"), +] +RULE = models.CostControlRule( + name="project-budget", + counter_key=[models.CostControlDimension(type="project")], + unit="usd", + amount=125, + period="month", + recurring=True, + match=models.CostControlMatch( + project_ids=[ + "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.CognitiveServices/accounts/acct/projects/project" + ] + ), + thresholds=THRESHOLDS, +) +COST_CONTROL = models.CostControl(properties=models.CostControlProperties(display_name="Monthly budget", rules=[RULE])) +COST_CONTROL_RESPONSE = { + "id": RESOURCE_ID, + "name": "monthly-budget", + "type": "Microsoft.CognitiveServices/accounts/costControls", + "etag": '"body-etag"', + "properties": { + "displayName": "Monthly budget", + "rules": [ + { + "name": "project-budget", + "counterKey": [{"type": "project"}], + "unit": "usd", + "amount": 125, + "period": "month", + "recurring": True, + "match": { + "projectIds": [ + "/subscriptions/sub/resourceGroups/rg/providers/" + "Microsoft.CognitiveServices/accounts/acct/projects/project" + ] + }, + "thresholds": [ + {"type": "percentage", "value": 80, "action": "alert"}, + {"type": "absolute", "value": 100, "action": "block"}, + ], + } + ], + }, +} + + +class _FakeCredential: + def get_token(self, *scopes, **kwargs): # pylint: disable=unused-argument + return AccessToken("fake-token", int(time.time()) + 3600) + + +class _FakeHttpResponse: + def __init__(self, request, status_code, body=None, headers=None): + self.request = request + self.status_code = status_code + self._body = body + self.headers = headers or {} + self.reason = "reason" + self.content_type = "application/json" + + @property + def content(self): + return json.dumps(self._body).encode("utf-8") if self._body is not None else b"" + + def text(self, *args, **kwargs): # pylint: disable=unused-argument + return self.content.decode("utf-8") + + def json(self): + return self._body + + def read(self, *args, **kwargs): # pylint: disable=unused-argument + return self.content + + def iter_bytes(self, *args, **kwargs): # pylint: disable=unused-argument + return iter([self.content]) + + def iter_raw(self, *args, **kwargs): # pylint: disable=unused-argument + return iter([self.content]) + + +def _make_client(status_code=200, body=None, headers=None): + client = CognitiveServicesManagementClient( + credential=_FakeCredential(), + subscription_id=SUBSCRIPTION_ID, + ) + + def send(request, **kwargs): # pylint: disable=unused-argument + response = _FakeHttpResponse(request, status_code, body, headers) + return SimpleNamespace(http_request=request, http_response=response, context={}) + + client._client._pipeline.run = MagicMock(side_effect=send) # pylint: disable=protected-access + return client + + +def _request(client): + return client._client._pipeline.run.call_args.args[0] # pylint: disable=protected-access + + +def _json_body(request): + content = request.content + if isinstance(content, bytes): + content = content.decode("utf-8") + return json.loads(content) + + +def test_create_serializes_thresholds_and_if_none_match(): + client = _make_client(201, COST_CONTROL_RESPONSE, {"ETag": '"response-etag"'}) + + result = client.cost_controls.create_or_update( + "rg", + "acct", + "monthly-budget", + COST_CONTROL, + etag="*", + match_condition=MatchConditions.IfMissing, + ) + + request = _request(client) + body = _json_body(request) + assert request.method == "PUT" + assert request.headers["If-None-Match"] == "*" + assert body["properties"]["rules"][0]["thresholds"] == [ + {"type": "percentage", "value": 80, "action": "alert"}, + {"type": "absolute", "value": 100, "action": "block"}, + ] + assert body["properties"]["rules"][0]["match"]["projectIds"] + assert result.properties.rules[0].thresholds[1].action == "block" + + +def test_get_deserializes_cost_control_and_etag_header(): + client = _make_client(200, COST_CONTROL_RESPONSE, {"ETag": '"response-etag"'}) + + result, response_headers = client.cost_controls.get( + "rg", + "acct", + "monthly-budget", + cls=lambda _, model, headers: (model, headers), + ) + + request = _request(client) + assert request.method == "GET" + assert request.url.endswith("/costControls/monthly-budget?api-version=2026-09-15-preview") + assert result.etag == '"body-etag"' + assert response_headers["ETag"] == '"response-etag"' + + +def test_update_sends_if_match_and_replacement_rules(): + client = _make_client(200, COST_CONTROL_RESPONSE, {"ETag": '"updated-etag"'}) + patch = models.CostControlPatch(properties=models.CostControlPatchProperties(rules=[RULE])) + + client.cost_controls.update( + "rg", + "acct", + "monthly-budget", + patch, + etag='"body-etag"', + match_condition=MatchConditions.IfNotModified, + ) + + request = _request(client) + assert request.method == "PATCH" + assert request.headers["If-Match"] == '"body-etag"' + assert _json_body(request)["properties"]["rules"][0]["name"] == "project-budget" + + +def test_list_deserializes_cost_controls(): + client = _make_client(200, {"value": [COST_CONTROL_RESPONSE], "nextLink": None}) + + result = list(client.cost_controls.list("rg", "acct")) + + request = _request(client) + assert request.method == "GET" + assert request.url.endswith("/costControls?api-version=2026-09-15-preview") + assert [cost_control.name for cost_control in result] == ["monthly-budget"] + + +def test_delete_sends_if_match(): + client = _make_client(204) + + result = client.cost_controls.delete( + "rg", + "acct", + "monthly-budget", + etag='"body-etag"', + match_condition=MatchConditions.IfNotModified, + ) + + request = _request(client) + assert result is None + assert request.method == "DELETE" + assert request.headers["If-Match"] == '"body-etag"' + + +def test_account_update_serializes_explicit_null_cost_control_connections(): + client = _make_client( + 200, + { + "id": "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.CognitiveServices/accounts/acct", + "name": "acct", + "type": "Microsoft.CognitiveServices/accounts", + "location": "eastus", + "properties": {"costControlConnections": None}, + }, + ) + + client.accounts.begin_update( + "rg", + "acct", + {"properties": {"costControlConnections": None}}, + polling=False, + ) + + request = _request(client) + assert request.method == "PATCH" + assert _json_body(request)["properties"]["costControlConnections"] is None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py new file mode 100644 index 000000000000..7d3c767082bd --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py @@ -0,0 +1,251 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Async unit tests for Cost Control request serialization and response handling.""" + +import json +import time +from types import SimpleNamespace +from unittest.mock import AsyncMock + +import pytest + +from azure.core import MatchConditions +from azure.core.credentials import AccessToken +from azure.mgmt.cognitiveservices import models +from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient + + +SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000" +RESOURCE_ID = ( + f"/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/rg/providers/" + "Microsoft.CognitiveServices/accounts/acct/costControls/monthly-budget" +) + +RULE = models.CostControlRule( + name="project-budget", + counter_key=[models.CostControlDimension(type="project")], + unit="usd", + amount=125, + period="month", + recurring=True, + match=models.CostControlMatch( + project_ids=[ + "/subscriptions/sub/resourceGroups/rg/providers/" + "Microsoft.CognitiveServices/accounts/acct/projects/project" + ] + ), + thresholds=[ + models.CostControlThreshold(type="percentage", value=80, action="alert"), + models.CostControlThreshold(type="absolute", value=100, action="block"), + ], +) +COST_CONTROL = models.CostControl(properties=models.CostControlProperties(display_name="Monthly budget", rules=[RULE])) +COST_CONTROL_RESPONSE = { + "id": RESOURCE_ID, + "name": "monthly-budget", + "type": "Microsoft.CognitiveServices/accounts/costControls", + "etag": '"body-etag"', + "properties": { + "displayName": "Monthly budget", + "rules": [ + { + "name": "project-budget", + "counterKey": [{"type": "project"}], + "unit": "usd", + "amount": 125, + "period": "month", + "recurring": True, + "match": { + "projectIds": [ + "/subscriptions/sub/resourceGroups/rg/providers/" + "Microsoft.CognitiveServices/accounts/acct/projects/project" + ] + }, + "thresholds": [ + {"type": "percentage", "value": 80, "action": "alert"}, + {"type": "absolute", "value": 100, "action": "block"}, + ], + } + ], + }, +} + + +class _FakeAsyncCredential: + async def get_token(self, *scopes, **kwargs): # pylint: disable=unused-argument + return AccessToken("fake-token", int(time.time()) + 3600) + + +class _FakeAsyncHttpResponse: + def __init__(self, request, status_code, body=None, headers=None): + self.request = request + self.status_code = status_code + self._body = body + self.headers = headers or {} + self.reason = "reason" + self.content_type = "application/json" + + @property + def content(self): + return json.dumps(self._body).encode("utf-8") if self._body is not None else b"" + + def text(self, *args, **kwargs): # pylint: disable=unused-argument + return self.content.decode("utf-8") + + def json(self): + return self._body + + async def read(self, *args, **kwargs): # pylint: disable=unused-argument + return self.content + + def iter_bytes(self, *args, **kwargs): # pylint: disable=unused-argument + return iter([self.content]) + + def iter_raw(self, *args, **kwargs): # pylint: disable=unused-argument + return iter([self.content]) + + +def _make_client(status_code=200, body=None, headers=None): + client = CognitiveServicesManagementClient( + credential=_FakeAsyncCredential(), + subscription_id=SUBSCRIPTION_ID, + ) + + def send(request, **kwargs): # pylint: disable=unused-argument + response = _FakeAsyncHttpResponse(request, status_code, body, headers) + return SimpleNamespace(http_request=request, http_response=response, context={}) + + client._client._pipeline.run = AsyncMock(side_effect=send) # pylint: disable=protected-access + return client + + +def _request(client): + return client._client._pipeline.run.call_args.args[0] # pylint: disable=protected-access + + +def _json_body(request): + content = request.content + if isinstance(content, bytes): + content = content.decode("utf-8") + return json.loads(content) + + +@pytest.mark.asyncio +async def test_create_serializes_thresholds_and_if_none_match(): + client = _make_client(201, COST_CONTROL_RESPONSE, {"ETag": '"response-etag"'}) + + result = await client.cost_controls.create_or_update( + "rg", + "acct", + "monthly-budget", + COST_CONTROL, + etag="*", + match_condition=MatchConditions.IfMissing, + ) + + request = _request(client) + body = _json_body(request) + assert request.method == "PUT" + assert request.headers["If-None-Match"] == "*" + assert body["properties"]["rules"][0]["thresholds"] == [ + {"type": "percentage", "value": 80, "action": "alert"}, + {"type": "absolute", "value": 100, "action": "block"}, + ] + assert body["properties"]["rules"][0]["match"]["projectIds"] + assert result.properties.rules[0].thresholds[1].action == "block" + + +@pytest.mark.asyncio +async def test_get_deserializes_cost_control_and_etag_header(): + client = _make_client(200, COST_CONTROL_RESPONSE, {"ETag": '"response-etag"'}) + + result, response_headers = await client.cost_controls.get( + "rg", + "acct", + "monthly-budget", + cls=lambda _, model, headers: (model, headers), + ) + + request = _request(client) + assert request.method == "GET" + assert request.url.endswith("/costControls/monthly-budget?api-version=2026-09-15-preview") + assert result.etag == '"body-etag"' + assert response_headers["ETag"] == '"response-etag"' + + +@pytest.mark.asyncio +async def test_update_sends_if_match_and_replacement_rules(): + client = _make_client(200, COST_CONTROL_RESPONSE, {"ETag": '"updated-etag"'}) + patch = models.CostControlPatch(properties=models.CostControlPatchProperties(rules=[RULE])) + + await client.cost_controls.update( + "rg", + "acct", + "monthly-budget", + patch, + etag='"body-etag"', + match_condition=MatchConditions.IfNotModified, + ) + + request = _request(client) + assert request.method == "PATCH" + assert request.headers["If-Match"] == '"body-etag"' + assert _json_body(request)["properties"]["rules"][0]["name"] == "project-budget" + + +@pytest.mark.asyncio +async def test_list_deserializes_cost_controls(): + client = _make_client(200, {"value": [COST_CONTROL_RESPONSE], "nextLink": None}) + + result = [cost_control async for cost_control in client.cost_controls.list("rg", "acct")] + + request = _request(client) + assert request.method == "GET" + assert request.url.endswith("/costControls?api-version=2026-09-15-preview") + assert [cost_control.name for cost_control in result] == ["monthly-budget"] + + +@pytest.mark.asyncio +async def test_delete_sends_if_match(): + client = _make_client(204) + + result = await client.cost_controls.delete( + "rg", + "acct", + "monthly-budget", + etag='"body-etag"', + match_condition=MatchConditions.IfNotModified, + ) + + request = _request(client) + assert result is None + assert request.method == "DELETE" + assert request.headers["If-Match"] == '"body-etag"' + + +@pytest.mark.asyncio +async def test_account_update_serializes_explicit_null_cost_control_connections(): + client = _make_client( + 200, + { + "id": "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.CognitiveServices/accounts/acct", + "name": "acct", + "type": "Microsoft.CognitiveServices/accounts", + "location": "eastus", + "properties": {"costControlConnections": None}, + }, + ) + + await client.accounts.begin_update( + "rg", + "acct", + {"properties": {"costControlConnections": None}}, + polling=False, + ) + + request = _request(client) + assert request.method == "PATCH" + assert _json_body(request)["properties"]["costControlConnections"] is None From 10bf7c7a76949c4449ae391f091624772d903c7b Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:48:09 -0700 Subject: [PATCH 11/35] Sync eng/common directory with azure-sdk-tools for PR 17315 (#49639) * Sync eng/common directory with azure-sdk-tools repository for Tools PR 17315 * Sync eng/common directory with azure-sdk-tools repository for Tools PR 17315 * Sync eng/common directory with azure-sdk-tools repository for Tools PR 17315 --------- Co-authored-by: azure-sdk --- .../pipelines/templates/jobs/eval-shard.yml | 3 - eng/common/scripts/eval/README.md | 33 ++++++++--- eng/common/scripts/eval/build-eval-summary.ts | 2 +- eng/common/scripts/eval/lib/shard-results.ts | 15 +++-- .../scripts/eval/publisher/CHANGELOG.md | 7 +++ .../eval/publisher/Publish-EvalResults.ps1 | 31 ++++++++-- .../scripts/eval/publisher/package.json | 2 +- .../eval/publisher/test/publisher.test.ts | 56 ++++++++++--------- .../scripts/eval/test/shard-results.test.ts | 45 ++++++++++++++- 9 files changed, 142 insertions(+), 52 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/eval-shard.yml b/eng/common/pipelines/templates/jobs/eval-shard.yml index cb54e75584e8..569f7d4fdfe5 100644 --- a/eng/common/pipelines/templates/jobs/eval-shard.yml +++ b/eng/common/pipelines/templates/jobs/eval-shard.yml @@ -77,9 +77,6 @@ jobs: npmrcPath: $(Build.SourcesDirectory)/.npmrc registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-tools/npm/registry/ - - script: npm install --global npm@11.11.1 --userconfig $(Build.SourcesDirectory)/.npmrc - displayName: 'Use npm 11.11.1' - # Installs vally-cli + its pinned copilot-sdk executor into node_modules. - script: npm ci --userconfig $(Build.SourcesDirectory)/.npmrc displayName: 'Install Vally CLI + copilot-sdk (pinned)' diff --git a/eng/common/scripts/eval/README.md b/eng/common/scripts/eval/README.md index d760c556bbc7..75d7beabb268 100644 --- a/eng/common/scripts/eval/README.md +++ b/eng/common/scripts/eval/README.md @@ -17,13 +17,16 @@ templates. Shards now retain the newest invocation's raw JSONL, JUnit and a completion marker via [shard-results](lib/shard-results.ts), including failed evaluations. -Summary checks the full Prepare matrix and selects each expected shard's highest -attempt once for Markdown, the Tests tab and bundling. Missing, interrupted or +Summary checks the full Prepare matrix and selects the artifact matching each +shard's latest timeline attempt once for Markdown, the Tests tab and bundling. Missing, interrupted or corrupt results remain incomplete; later failed attempts never fall back to older successful artifacts. A separate step reads the current-build timeline with `System.AccessToken` and three bounded transient retries, saving the latest attempt evidence beside the summary. Rendering reads that file and needs no token or network. -Unverified or ambiguous attempts cannot authorize publication. The legacy JUnit-only +If that exact attempt has no artifact, older JUnit is not copied or counted. +Missing or invalid timeline evidence also excludes unverified diagnostics and blocks publication. +Matching latest-attempt JUnit remains available when its result data is incomplete. +The legacy JUnit-only summary remains supported. No historical build download or reconstruction is involved. The bundler accepts exactly one already-selected attempt per expected shard; it does not repeat Summary's selection or accept an ambiguous list of attempts. @@ -105,8 +108,11 @@ compressed-size cap is checked afterward. Full ZIP decoding remains in contract tests rather than reopening the archive in production. JSONL is decoded once and parsed directly as text, with byte limits on both source and serialized records. -Uploads use `--auth-mode login --overwrite false --if-none-match '*'` with the **same +Uploads use `--auth-mode login --overwrite false --if-none-match=*` with the **same saved ZIP**; Azure CLI owns transport retries, without another script/task retry loop. +The condition is one argument so Linux does not expand a standalone `*` into file names. +`--no-progress` keeps CLI progress out of captured command results. JSON is parsed +from stdout only; captured native stderr is never mixed into JSON or echoed. Request/socket timeouts and the task deadline bound execution. Existing archives must match metadata, owner, checksum and size. Changed content needs a new Summary attempt, not an overwrite. The publisher never deletes archives; the dashboard's separate identity stays read-only. @@ -140,14 +146,23 @@ With **Node 24.14.1+ and pnpm 12.6.0**, run `pnpm --ignore-workspace install --pm-on-fail=ignore --frozen-lockfile --prod --ignore-scripts` and `pnpm --ignore-workspace --pm-on-fail=ignore test` from `publisher`, then `node --experimental-strip-types --test` from this directory. -Publisher tests require **PowerShell 7.4+ and -Pester 5**; pipeline upload uses the agent's authenticated Azure CLI. The existing -common-tests PR pipeline runs all shared/archive Node tests and discovers the tagged -PowerShell suite under `eng/common-tests/eval`; failures fail the CI job. +These shared Node tests do not need Tools-owned CI files, PowerShell tests or +the consuming repository's redirect settings. A consumer-copy regression runs +them without Tools files or Git history, with absent and different redirect templates. + +In Tools, run `Invoke-Pester -Path eng/common-tests/eval/Publish-EvalResults.Tests.ps1 -CI` +from the repository root for the **PowerShell 7.4+ / Pester 5 / Azure CLI** tests. That Tools-only +suite also checks the Tools CI wiring and network policy. The existing common-tests +PR pipeline runs both the shared/archive Node tests and this tagged PowerShell suite; +failures fail the CI job. Other repositories do not need to copy this Tools test setup. +Pipeline upload uses the agent's authenticated Azure CLI. CI restores only the locked archive dependency, not the Vally evaluator. Regression coverage includes the actual HTTP cmdlet against loopback, invalid collision metadata, upload-before-notification ordering and publication without local status files. +One integration test also runs the real Azure CLI against a localhost-only Blob +fixture with synthetic credentials and an isolated CLI profile. It verifies one +successful upload does not trigger a fallback read. No production storage is used. Construction regressions exercise the exact entry/trial boundaries, aggregate expanded bytes, final compressed bytes, required inputs and UTF-8 JSONL limits. The loopback fixture selects the first Node application when CI has multiple Node @@ -159,6 +174,8 @@ separate from local checks and should use an already approved evaluation run. The task logs the stored Blob name and notification outcome. Failures include a bounded operation/error code, never raw Azure responses, tokens or result contents. +CLI failures include the exit code and a fixed known storage error code, when +available. If the fallback read also fails, the original upload code is retained. Token acquisition failures require checking the service connection; Blob 403 requires checking its data-role scope; network failures require checking approved egress. Preserve the original archive for conflicts, and diff --git a/eng/common/scripts/eval/build-eval-summary.ts b/eng/common/scripts/eval/build-eval-summary.ts index fb738b8f554a..43f7ef682b41 100644 --- a/eng/common/scripts/eval/build-eval-summary.ts +++ b/eng/common/scripts/eval/build-eval-summary.ts @@ -375,7 +375,7 @@ async function main(argv) { jobAttempts = JSON.parse(fs.readFileSync(options.attemptsFile, "utf8")); } catch { - console.warn("##vso[task.logissue type=warning]Latest shard attempts could not be verified; Summary will retain diagnostics but refuse publication."); + console.warn("##vso[task.logissue type=warning]Latest shard attempts could not be verified; Summary will remain incomplete and refuse publication."); } } selection = selectSummaryResults({ resultsRoot: options.resultsRoot, diff --git a/eng/common/scripts/eval/lib/shard-results.ts b/eng/common/scripts/eval/lib/shard-results.ts index c38925562c4d..8160e51f221b 100644 --- a/eng/common/scripts/eval/lib/shard-results.ts +++ b/eng/common/scripts/eval/lib/shard-results.ts @@ -184,6 +184,7 @@ export function selectSummaryResults({ resultsRoot, selectedRoot, expectedShards } emptyDirectory(selectedRoot); const expected = new Set(expectedShards); + const timeline = jobAttempts?.schemaVersion === 1 && jobAttempts.valid === true ? jobAttempts.attempts : null; const selected = new Map(); const seen = new Set(); for (const entry of fs.readdirSync(resultsRoot, { withFileTypes: true })) { @@ -195,8 +196,8 @@ export function selectSummaryResults({ resultsRoot, selectedRoot, expectedShards const identity = `${match[1]}:${attempt}`; if (seen.has(identity)) throw new Error(`Duplicate artifact attempt for ${match[1]}.`); seen.add(identity); - const previous = selected.get(match[1]); - if (!previous || previous.attempt < attempt) { + // Artifact availability cannot override the authoritative timeline attempt. + if (timeline?.[match[1]]?.attempt === attempt) { selected.set(match[1], { shard: match[1], attempt, directory: entry.name }); } } @@ -204,7 +205,10 @@ export function selectSummaryResults({ resultsRoot, selectedRoot, expectedShards for (const shard of expectedShards) { const selectedAttempt = selected.get(shard); if (!selectedAttempt) { - status.push({ shard, attempt: null, complete: false, reason: "No artifact was published." }); + const attempt = timeline?.[shard]?.attempt; + const verified = Number.isSafeInteger(attempt) && attempt > 0; + status.push({ shard, attempt: verified ? attempt : null, complete: false, + reason: verified ? "The latest timeline attempt has no matching artifact." : "The latest timeline attempt could not be verified." }); continue; } const directory = path.join(resultsRoot, selectedAttempt.directory); @@ -221,10 +225,9 @@ export function selectSummaryResults({ resultsRoot, selectedRoot, expectedShards } if (!complete && metadata.complete === false) reason = "The latest shard attempt did not produce a complete invocation."; } catch { /* Retain available JUnit below, but do not adopt an incomplete artifact for upload. */ } - if (jobAttempts?.valid !== true || jobAttempts.schemaVersion !== 1 || - jobAttempts.attempts?.[shard]?.attempt !== selectedAttempt.attempt || jobAttempts.attempts[shard].complete !== true) { + if (timeline[shard].complete !== true) { complete = false; - reason = "The latest timeline job attempt has no matching complete artifact, or its status could not be verified."; + reason = "The latest timeline job attempt is not complete."; } // The Tests tab and Markdown use the SAME selected attempts as the bundle. // Old-layout JUnit remains diagnostic; old artifacts are never upload-ready. diff --git a/eng/common/scripts/eval/publisher/CHANGELOG.md b/eng/common/scripts/eval/publisher/CHANGELOG.md index 60fbc50525a8..3bf724917e3a 100644 --- a/eng/common/scripts/eval/publisher/CHANGELOG.md +++ b/eng/common/scripts/eval/publisher/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +- Exclude older JUnit from summaries and selected test files when it does not match the latest verified timeline attempt; keep missing results incomplete. +- Keep shared publisher tests independent of Tools-only CI/Pester/redirect files, while retaining those checks in Tools and testing consumer copies. +- Pass the create-only wildcard as one `--if-none-match=*` argument so Linux cannot expand it into working-directory file names. +- Disable Azure CLI upload progress and parse only stdout so native stderr cannot corrupt a successful JSON result. +- Preserve safe upload/fallback exit codes and known storage error codes without logging CLI response bodies, tokens or request details. +- Exercise the actual Azure CLI against a localhost-only storage fixture, with a bounded startup deadline, synthetic parser diagnostics and no Azure credentials or model evaluations. +- Align entrypoint tests with the existing GitHub App migration instead of expecting the removed PAT variable group. - Retain one complete, latest-attempt evaluation archive per build in Blob storage. - Use authenticated Azure CLI publication instead of a custom Node Azure SDK transport. - Read the storage account from pipeline-owned configuration and keep publishing policy in YAML. diff --git a/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 b/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 index a68588d08c44..3964c687edf8 100644 --- a/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 +++ b/eng/common/scripts/eval/publisher/Publish-EvalResults.ps1 @@ -14,16 +14,33 @@ $ErrorActionPreference = 'Stop' function Invoke-AzJson([string[]] $Arguments) { # Capture all CLI output, especially tokens and errors; never echo raw Azure responses. $output = az @Arguments --only-show-errors --output json 2>&1 - if ($LASTEXITCODE -ne 0) { throw 'Azure CLI operation failed.' } + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0) { + $code = 'cli_failed' + # Only fixed error codes may leave this boundary, never CLI messages or request data. + $match = [regex]::Match(($output -join "`n"), '(?:\(|ErrorCode:\s*)(AuthorizationPermissionMismatch|AuthorizationFailure|AuthenticationFailed|BlobNotFound|ContainerNotFound|BlobAlreadyExists|ConditionNotMet|InvalidAuthenticationInfo|InvalidHeaderValue|InvalidMetadata|ResourceNotFound)(?:\)|\s|$)') + if ($match.Success) { $code = $match.Groups[1].Value } + $failure = [InvalidOperationException]::new('Azure CLI operation failed.') + $failure.Data['CliFailure'] = "exit=$exitCode, code=$code" + throw $failure + } # ConvertFrom-Json auto-converts ISO strings into dates on some PowerShell versions. # Keep Blob metadata strings exact, including their required UTC Z suffix. - $document = [System.Text.Json.JsonDocument]::Parse($output -join "`n") + # Native stderr is captured as ErrorRecord objects; progress/warnings are not JSON. + $stdout = @($output | Where-Object { $_ -isnot [System.Management.Automation.ErrorRecord] }) -join "`n" + try { $document = [System.Text.Json.JsonDocument]::Parse($stdout) } + catch { + $failure = [InvalidOperationException]::new('Azure CLI returned invalid JSON.') + $failure.Data['CliFailure'] = 'exit=0, code=invalid_cli_json' + throw $failure + } try { return $document.RootElement.Clone() } finally { $document.Dispose() } } $operation = 'validate_inputs' $failureCode = 'invalid_bundle' $stored = $false +$uploadFailure = $null try { $BundlePath = [System.IO.Path]::GetFullPath($BundlePath) $archive = Get-Item -LiteralPath $BundlePath @@ -65,12 +82,14 @@ try { $failureCode = 'publication_failed' $duplicate = $false try { - # CLI owns transport retries. Never overwrite, rebuild the ZIP, or create a container. + # CLI owns transport retries. Keep the wildcard in one option=value argument + # so native argument expansion on Linux cannot turn it into local file names. Invoke-AzJson -Arguments (@('storage', 'blob', 'upload') + $storage + @('--file', $BundlePath, - '--type', 'block', '--overwrite', 'false', '--if-none-match', '*', '--content-type', 'application/zip', + '--type', 'block', '--overwrite', 'false', '--if-none-match=*', '--no-progress', '--content-type', 'application/zip', '--metadata', 'schema=1', "sha256=$hash", "publisher=$owner", "storedat=$storedAt", '--timeout', '30', '--socket-timeout', '30')) | Out-Null } catch { # Also covers a lost success response: adopt only the same already-stored archive. + $uploadFailure = $_.Exception.Data['CliFailure'] $operation = 'verify_existing_blob' $saved = Invoke-AzJson -Arguments (@('storage', 'blob', 'show') + $storage + @('--timeout', '30')) $failureCode = 'submission_conflict' @@ -130,6 +149,8 @@ try { if ($stored) { Write-Warning 'Archive stored; dashboard refresh failed. Reload/startup/daily reconciliation can recover it.' } else { - throw "Evaluation publication failed: $operation ($failureCode). No raw Azure response was logged." + $detail = @($(if ($uploadFailure) { "Upload: $uploadFailure." }), + $(if ($_.Exception.Data['CliFailure']) { "Current operation: $($_.Exception.Data['CliFailure'])." })) -join ' ' + throw "Evaluation publication failed: $operation ($failureCode). $detail No raw Azure response was logged." } } \ No newline at end of file diff --git a/eng/common/scripts/eval/publisher/package.json b/eng/common/scripts/eval/publisher/package.json index 0a5e158ddac6..2b06a64ec4c6 100644 --- a/eng/common/scripts/eval/publisher/package.json +++ b/eng/common/scripts/eval/publisher/package.json @@ -9,7 +9,7 @@ "node": ">=24.14.1" }, "scripts": { - "test": "node --experimental-strip-types --test test/*.test.ts && pwsh -NoProfile -Command \"Invoke-Pester -Path ../../../../common-tests/eval/Publish-EvalResults.Tests.ps1 -CI\"" + "test": "node --experimental-strip-types --test test/*.test.ts" }, "dependencies": { "fflate": "0.8.3" diff --git a/eng/common/scripts/eval/publisher/test/publisher.test.ts b/eng/common/scripts/eval/publisher/test/publisher.test.ts index 1b6d2cba2436..8497bb00a448 100644 --- a/eng/common/scripts/eval/publisher/test/publisher.test.ts +++ b/eng/common/scripts/eval/publisher/test/publisher.test.ts @@ -2,9 +2,9 @@ import assert from "node:assert/strict"; import { spawnSync } from "node:child_process"; import { randomBytes } from "node:crypto"; -import { mkdtemp, mkdir, readFile, rm, truncate, writeFile } from "node:fs/promises"; +import { cp, mkdtemp, mkdir, readFile, realpath, rm, truncate, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; -import { join, resolve } from "node:path"; +import { join, resolve, sep } from "node:path"; import { pathToFileURL } from "node:url"; import { test } from "node:test"; import { runInNewContext } from "node:vm"; @@ -271,25 +271,32 @@ test("the archive package pins Node 24/pnpm and one portable SHA512-locked depen assert.doesNotMatch(lock, /https?:|tarball:|sha1-|packageManagerDependencies/); }); -test("PR CI runs every lightweight Node suite and discovers tagged publisher PowerShell tests", async () => { - const root = resolve(import.meta.dirname, "../../../../.."); - const ci = await readFile(join(root, "common-tests/ci.yml"), "utf8"); - assert.match(ci, /TargetDirectory: eng\/common-tests/); - assert.match(ci, /TargetTags: UnitTest,IntegrationTest/); - assert.match(ci, /CustomTestSteps:[\s\S]*config.Filter.Tag = @\('UnitTest', 'IntegrationTest'\)/); - assert.match(ci, /if \(\$result.FailedCount -gt 0\) \{ throw/); - assert.match(ci, /node --experimental-strip-types --test test\/\*\.test\.ts publisher\/test\/\*\.test\.ts/); - assert.match(ci, /version: 24\.x/); - assert.match(ci, /npm install --prefix.*pnpm@12\.6\.0/); - assert.match(ci, /pnpm\/bin\/pnpm\.mjs.*--dir publisher --ignore-workspace install --pm-on-fail=ignore --frozen-lockfile --prod --ignore-scripts/); - assert.match(ci, /NPM_CONFIG_USERCONFIG: \$\(Agent.TempDirectory\)\/eval-unit-tests\.npmrc/); - assert.doesNotMatch(ci, /vally eval|azureSubscription:|npm ci/); - const pester = await readFile(join(root, "common-tests/eval/Publish-EvalResults.Tests.ps1"), "utf8"); - assert.match(pester, /Describe 'Azure CLI evaluation publication' -Tag 'UnitTest'/); - assert.match(pester, /Microsoft.PowerShell.Utility\\Invoke-WebRequest/); - assert.match(pester, /server\.listen\(0,'127\.0\.0\.1'/); - const publisher = JSON.parse(await readFile(resolve(import.meta.dirname, "../package.json"), "utf8")); - assert.match(publisher.scripts.test, /common-tests\/eval\/Publish-EvalResults.Tests.ps1/); +test("shared publisher tests run without Tools-only files", async t => { + const f = await fixture(t), consumer = join(f.root, "consumer"), scripts = resolve(import.meta.dirname, "../.."); + const copiedScripts = join(consumer, "eng/common/scripts/eval"), publisher = join(copiedScripts, "publisher"); + await cp(scripts, copiedScripts, { recursive: true, filter: source => !source.split(sep).includes("node_modules") }); + await cp(resolve(scripts, "../../pipelines"), join(consumer, "eng/common/pipelines"), { recursive: true }); + // Copy only the already-restored archive dependency; no install, Git history or service is needed. + await cp(await realpath(resolve(import.meta.dirname, "../node_modules/fflate")), join(publisher, "node_modules/fflate"), { recursive: true }); + for (const path of [".git", "eng/common-tests/ci.yml", "eng/common-tests/eval/Publish-EvalResults.Tests.ps1"]) { + await assert.rejects(readFile(join(consumer, path)), { code: "ENOENT" }); + } + const command = JSON.parse(await readFile(join(publisher, "package.json"), "utf8")).scripts.test; + assert.equal(command, "node --experimental-strip-types --test test/*.test.ts"); + for (const mode of ["without a redirect template", "with a consumer-owned redirect template"]) await t.test(mode, async () => { + if (mode.startsWith("with a")) { + const redirect = join(consumer, "eng/pipelines/templates/stages/1es-redirect.yml"); + await mkdir(resolve(redirect, ".."), { recursive: true }); + await writeFile(redirect, "parameters:\n- name: UseOfficial\n type: boolean\n default: true\n"); + } + const environment = { ...process.env }; delete environment.NODE_TEST_CONTEXT; + const args = command.split(" ").slice(1); + // Exclude this copy-and-run regression itself, not any archive or pipeline checks. + args.splice(args.indexOf("--test") + 1, 0, "--test-skip-pattern=shared publisher tests run without Tools-only files"); + const child = spawnSync(process.execPath, args, { cwd: publisher, env: environment, encoding: "utf8", + timeout: 120_000, maxBuffer: 2 * 1024 * 1024 }); + assert.ifError(child.error); assert.equal(child.status, 0, child.stderr + child.stdout); + }); }); test("pipeline separates token-bearing attempt verification from rendering and uploads before the score gate", async () => { @@ -353,11 +360,8 @@ test("one checkbox gates trusted-run egress; owner configuration additionally ga for (const id of ["8255", "9999"]) assert.equal(evaluate(networkGate, { ...base, "System.DefinitionId": id }), true, "Definition IDs are archive identity, not shared policy"); }); -test("redirect retains Default Deny/CFS and shared publication defaults stay off", async () => { +test("shared publication defaults stay off", async () => { const root = resolve(import.meta.dirname, "../../../.."); - const redirect = await readFile(join(root, "../pipelines/templates/stages/1es-redirect.yml"), "utf8"); - assert.match(redirect, /networkIsolationPolicy: DefaultDeny, CFSClean, CFSClean2, CFSClean3, AzureStorage/); - assert.match(redirect, /parameters.AllowAzureStorage.*parameters.Use1ESOfficial.*System.TeamProject.*PullRequest.*refs\/pull\//); for (const path of ["templates/steps/eval-publish-results.yml", "templates/jobs/eval-summarize.yml", "templates/stages/archetype-eval.yml"]) { assert.match(await readFile(join(root, "pipelines", path), "utf8"), /name: publishDashboardResults\s+type: boolean\s+default: false/); } @@ -370,7 +374,7 @@ for (const tier of ["workflow", "skill", "live"]) test(`${tier} forwards only th assert.doesNotMatch(content, /eval-dashboard\.yml|EvalDashboardPublicationEnabled|System.DefinitionId|autoPublishDashboardResults|allowAzureStorageNetworkAccess/); const inputs = content.slice(content.indexOf("\nparameters:\n"), content.indexOf("\nvariables:\n")); assert.deepEqual([...inputs.matchAll(/- name: (\w+)/g)].map(match => match[1]), ["publishDashboardResults"]); - assert.match(content, /group: AzSDK_Eval_Variable_group/); assert.match(content, new RegExp(`TestType: ${tier === "live" ? "live" : "mock"}`)); + assert.doesNotMatch(content, /group: AzSDK_Eval_Variable_group/); assert.match(content, new RegExp(`TestType: ${tier === "live" ? "live" : "mock"}`)); if (tier === "live") { assert.match(content, /UseAzSdkAuthentication: true/); assert.match(content, /failOnFailedTests: true/); } if (tier === "skill") assert.match(content, /vallyRoot: \.github\/skills/); }); \ No newline at end of file diff --git a/eng/common/scripts/eval/test/shard-results.test.ts b/eng/common/scripts/eval/test/shard-results.test.ts index 38bca140a85a..68fb908b085b 100644 --- a/eng/common/scripts/eval/test/shard-results.test.ts +++ b/eng/common/scripts/eval/test/shard-results.test.ts @@ -273,6 +273,8 @@ test("attempt selection is numeric and includes the newest directory even when i const root = setup(t); artifact(root, "area_a", 9); fs.mkdirSync(path.join(root, "download", "eval-result-area_a-10")); + fs.writeFileSync(path.join(root, "job-attempts.json"), JSON.stringify({ schemaVersion: 1, valid: true, + attempts: { area_a: { attempt: 10, complete: true } } })); const { child, result, index } = runSummary(root, ["area_a"]); assert.equal(child.status, 1); assert.equal(result.shards[0].attempt, 10); @@ -308,7 +310,8 @@ test("bad completion metadata cannot hide available diagnostic JUnit", (t) => { const directory = path.join(root, `case-${index}`); const output = artifact(directory, "area_a", 1); fs.writeFileSync(path.join(output, "shard.json"), marker); - const selection = selectSummaryResults({ resultsRoot: path.join(directory, "download"), selectedRoot: path.join(directory, "selected"), expectedShards: ["area_a"] }); + const selection = selectSummaryResults({ resultsRoot: path.join(directory, "download"), selectedRoot: path.join(directory, "selected"), + expectedShards: ["area_a"], jobAttempts: readJson(path.join(directory, "job-attempts.json")) }); assert.equal(selection.complete, false); assert.deepEqual(fs.readdirSync(path.join(directory, "selected", "eval-result-area_a-1", "junit")), ["0.junit.xml"]); } @@ -337,6 +340,8 @@ test("legacy-layout JUnit is diagnostic only, and never causes fallback to an ol const latest = path.join(root, "download", "eval-result-area_a-2"); fs.mkdirSync(latest); fs.writeFileSync(path.join(latest, "eval-results.junit.xml"), ''); + fs.writeFileSync(path.join(root, "job-attempts.json"), JSON.stringify({ schemaVersion: 1, valid: true, + attempts: { area_a: { attempt: 2, complete: true } } })); const { child, result, index, markdown } = runSummary(root, ["area_a"]); assert.equal(child.status, 1); assert.equal(result.complete, false); @@ -389,7 +394,9 @@ test("summary cannot publish when timeline evidence is unavailable, invalid or c }); assert.equal(child.status, 1); assert.match(child.stdout, /EvalSummaryComplete\]false/); assert.equal(readJson(path.join(directory, "download", "shard-index.json")).complete, false); - assert.equal(readJson(path.join(directory, "summary", "eval-summary.json")).totals.scenarios, 1); + assert.equal(readJson(path.join(directory, "summary", "eval-summary.json")).totals.scenarios, 0); + assert.deepEqual(fs.readdirSync(path.join(directory, "selected")), []); + assert.deepEqual(readJson(path.join(directory, "download", "shard-index.json")).attempts, []); assert.match(fs.readFileSync(output, "utf8"), /timeline/); assert.equal(fs.existsSync(path.join(directory, "summary", "job-attempts.json")), false, "Rendering never fabricates timeline evidence"); } @@ -494,9 +501,43 @@ test("newer failed attempt with no artifact cannot adopt an older complete artif { schemaVersion: 1, valid: false, attempts: {} }].entries()) { const selected = selectSummaryResults({ resultsRoot: path.join(root, "download"), selectedRoot: path.join(root, `selection-${index}`), expectedShards: ["a"], jobAttempts }); assert.equal(selected.complete, false); assert.match(selected.status[0].reason, /timeline/); + const matchingAttempt = jobAttempts?.valid === true && jobAttempts.attempts.a?.attempt === 1; + assert.equal(selected.shardInput.attempts.length, matchingAttempt ? 1 : 0); + assert.equal(fs.existsSync(path.join(root, `selection-${index}`, "eval-result-a-1", "junit", "0.junit.xml")), matchingAttempt); } }); +test("missing latest results contribute no older JUnit to Markdown, counts or selected test files", t => { + const root = setup(t); artifact(root, "a", 1); + const evidence = { schemaVersion: 1, valid: true, attempts: { a: { attempt: 2, complete: true } } }; + fs.writeFileSync(path.join(root, "job-attempts.json"), JSON.stringify(evidence)); + const { child, markdown, result, index } = runSummary(root, ["a"]); + assert.equal(child.status, 1); + assert.match(child.stdout, /EvalSummaryComplete\]false/); + assert.equal(result.complete, false); assert.equal(index.complete, false); + assert.equal(result.shards[0].attempt, 2); assert.match(result.shards[0].reason, /no matching artifact/); + assert.deepEqual(result.totals, { scenarios: 0, failed: 0, skipped: 0 }); + assert.deepEqual(index.attempts, []); + assert.deepEqual(fs.readdirSync(path.join(root, "selected")), []); + assert.doesNotMatch(markdown, /source-a-1|results — PASSED/); + assert.match(markdown, /results — INCOMPLETE/); +}); + +test("only the timeline-matching attempt is selected, even when newer unverified artifacts exist", t => { + const root = setup(t); artifact(root, "a", 1); artifact(root, "a", 2, { failed: true }); artifact(root, "a", 3); + fs.writeFileSync(path.join(root, "job-attempts.json"), JSON.stringify({ schemaVersion: 1, valid: true, + attempts: { a: { attempt: 2, complete: true } } })); + const { child, markdown, result, index } = runSummary(root, ["a"]); + assert.equal(child.status, 0, child.stderr); + assert.equal(result.complete, true); assert.equal(index.complete, true); + assert.equal(result.shards[0].attempt, 2); + assert.deepEqual(result.totals, { scenarios: 1, failed: 1, skipped: 0 }); + assert.deepEqual(fs.readdirSync(path.join(root, "selected")), ["eval-result-a-2"]); + assert.deepEqual(index.attempts, [{ shard: "a", attempt: 2, directory: "eval-result-a-2" }]); + assert.match(markdown, /results — FAILED/); + assert.doesNotMatch(markdown, /source-a-1|source-a-3/); +}); + test("timeline reads retry transient failures only, with a fixed three-attempt budget", async () => { const waits = []; let calls = 0; const result = await readShardAttempts(timelineEnv, { wait: async value => waits.push(value), fetchImpl: async (url, options) => { From c95a09e1466cfaa69aafd1dc2a0808e2240edc21 Mon Sep 17 00:00:00 2001 From: Kashif Khan <361477+kashifkhan@users.noreply.github.com> Date: Wed, 21 Oct 2026 12:50:31 -0500 Subject: [PATCH 12/35] [Identity] Drop Python 3.9 From Identity, add Python 3.15 (#49638) * update pyproject.toml * fix * remove py39 for broker * update readme --- sdk/identity/azure-identity-broker/pyproject.toml | 4 ++-- sdk/identity/azure-identity/README.md | 2 +- sdk/identity/azure-identity/pyproject.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/identity/azure-identity-broker/pyproject.toml b/sdk/identity/azure-identity-broker/pyproject.toml index dbaae86e8a22..6b9e1954a186 100644 --- a/sdk/identity/azure-identity-broker/pyproject.toml +++ b/sdk/identity/azure-identity-broker/pyproject.toml @@ -9,19 +9,19 @@ authors = [ ] description = "Microsoft Azure Identity Broker plugin for Python" keywords = ["azure", "azure sdk"] -requires-python = ">=3.9" +requires-python = ">=3.10" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] dependencies = [ "azure-identity<2.0.0,>=1.18.0", diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 5f8c52926170..98b7f4a21d3b 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -21,7 +21,7 @@ pip install azure-identity ### Prerequisites - An [Azure subscription](https://azure.microsoft.com/free/python) -- Python 3.9 or a recent version of Python 3 (this library doesn't support end-of-life versions) +- Python 3.10 or a recent version of Python 3 (this library doesn't support end-of-life versions) ### Use with AI tools diff --git a/sdk/identity/azure-identity/pyproject.toml b/sdk/identity/azure-identity/pyproject.toml index d7ada033bb7d..4585f4b9221a 100644 --- a/sdk/identity/azure-identity/pyproject.toml +++ b/sdk/identity/azure-identity/pyproject.toml @@ -9,19 +9,19 @@ authors = [ ] description = "Microsoft Azure Identity Library for Python" keywords = ["azure", "azure sdk"] -requires-python = ">=3.9" +requires-python = ">=3.10" license = "MIT" classifiers = [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] dependencies = [ "azure-core>=1.31.0", From 0632920198e40a90d3cda07aad012cafac43c010 Mon Sep 17 00:00:00 2001 From: Pranjal Patel Date: Wed, 21 Oct 2026 12:18:26 -0700 Subject: [PATCH 13/35] chore(servicebus): update SDK team code owners (#49641) * chore(servicebus): add team members as SDK code owners Add Karen Alfaro Salazar, Pranjal Patel, and Eldert Grootenboer to the Service Bus SDK-specific CODEOWNERS entry, preserving existing owners. Update the comment to describe team ownership. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d795106f-3b57-4103-96c1-fdfe03a8651a * chore(servicebus): align team ownership metadata Follow caf71fcd6554aedd44686c05228cbfdaa910bdbd by keeping Service Bus folder ownership and ServiceOwners metadata aligned with SDK ownership. Eldert is already present in the broader entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d795106f-3b57-4103-96c1-fdfe03a8651a * chore(servicebus): remove Karen from ownership update Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d795106f-3b57-4103-96c1-fdfe03a8651a --------- Co-authored-by: Pranjal Patel Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d795106f-3b57-4103-96c1-fdfe03a8651a --- .github/CODEOWNERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index de168fce4e40..3626b8d139d1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -752,10 +752,10 @@ # ServiceOwners: @antcp @AzureAppServiceCLI # PRLabel: %Service Bus -/sdk/servicebus/ @EldertGrootenboer @skarri-microsoft @j7nw4r @meetamitbhatia +/sdk/servicebus/ @EldertGrootenboer @skarri-microsoft @j7nw4r @meetamitbhatia @pranz1996 # ServiceLabel: %Service Bus -# ServiceOwners: @EldertGrootenboer @skarri-microsoft @j7nw4r @meetamitbhatia +# ServiceOwners: @EldertGrootenboer @skarri-microsoft @j7nw4r @meetamitbhatia @pranz1996 # PRLabel: %Service Fabric /sdk/servicefabric/ @QingChenmsft @samedder @@ -864,5 +864,5 @@ # Add Johnathan Walker as code owner for Event Hubs SDK /sdk/eventhub/azure-eventhub/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 -# Add Johnathan Walker as code owner for Service Bus SDK -/sdk/servicebus/azure-servicebus/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 \ No newline at end of file +# Service Bus SDK team code owners +/sdk/servicebus/azure-servicebus/* @j7nw4r @meetamitbhatia @SwayGom @sagar0207 @pranz1996 @EldertGrootenboer \ No newline at end of file From 2bc20ab2f047781a3a3a34bb6ee7fc8f1c23cdb5 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 21 Oct 2026 12:26:59 -0700 Subject: [PATCH 14/35] upgrade certifi related (#49628) * Update certifi and dependency tooling pins Require certifi 2026.10.19 and update pip to 26.2.2, uv to 0.13.4, and cibuildwheel to 4.3.2. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Raise shared CI test and tooling interpreters to Python 3.11 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Remove certifi and cibuildwheel version constraints Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 2 +- common/smoketest/requirements_async.txt | 2 +- eng/apiview_reqs.txt | 2 +- eng/ci_tools.txt | 4 ++-- eng/pipelines/autorest_checks.yml | 2 +- eng/pipelines/templates/jobs/regression.yml | 4 ++-- eng/pipelines/templates/jobs/run-cli-tests.yml | 2 +- eng/pipelines/templates/jobs/smoke.tests.yml | 12 ++++++------ eng/pipelines/templates/stages/platform-matrix.json | 6 +++--- .../templates/stages/python-analyze-weekly.yml | 4 ++-- eng/pipelines/templates/steps/install-uv.yml | 2 +- eng/pipelines/templates/steps/run_apistub.yml | 4 ++-- eng/pipelines/templates/steps/run_bandit.yml | 2 +- eng/pipelines/templates/steps/run_black.yml | 2 +- eng/pipelines/templates/steps/run_mypy.yml | 2 +- eng/pipelines/templates/steps/run_pylint.yml | 2 +- eng/pipelines/templates/steps/run_pyright.yml | 2 +- .../templates/steps/seed-virtualenv-wheels.yml | 2 +- eng/pipelines/templates/steps/smoke-test-steps.yml | 2 +- eng/pipelines/templates/steps/update_snippet.yml | 2 +- eng/pipelines/templates/variables/globals.yml | 2 +- eng/regression_test_tools.txt | 2 +- eng/regression_tools.txt | 2 +- eng/tools/azure-sdk-tools/pyproject.toml | 2 +- 24 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 42ee6d667220..47834f0d3e8c 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Python uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: - python-version: '3.10' + python-version: '3.11' cache: 'pip' - name: Create and activate virtual environment diff --git a/common/smoketest/requirements_async.txt b/common/smoketest/requirements_async.txt index 6abb7be0f0d5..3a90515a8b7e 100644 --- a/common/smoketest/requirements_async.txt +++ b/common/smoketest/requirements_async.txt @@ -1,3 +1,3 @@ aiohttp==3.14.3 packaging==24.2 -pip==26.2.1 +pip==26.2.2 diff --git a/eng/apiview_reqs.txt b/eng/apiview_reqs.txt index 2fb4c47ac25f..2c99481d712c 100644 --- a/eng/apiview_reqs.txt +++ b/eng/apiview_reqs.txt @@ -16,4 +16,4 @@ tomlkit==0.13.2 typing_extensions==4.15.0 wrapt==1.17.2 apiview-stub-generator==0.3.31 -pip==24.0 +pip==26.2.2 diff --git a/eng/ci_tools.txt b/eng/ci_tools.txt index a946695d1882..1b8c5e85b47b 100644 --- a/eng/ci_tools.txt +++ b/eng/ci_tools.txt @@ -7,10 +7,10 @@ pathlib2==2.3.7.post1 doc-warden==0.7.2 beautifulsoup4==4.13.3 pkginfo==1.12.1.2 -pip==24.0 +pip==26.2.2 typing-extensions==4.12.2 pyproject-api==1.8.0 -cibuildwheel==2.23.3 +cibuildwheel importlib-metadata==8.5.0 build==1.2.2.post1 diff --git a/eng/pipelines/autorest_checks.yml b/eng/pipelines/autorest_checks.yml index 5a445378f63f..90913fea0bff 100644 --- a/eng/pipelines/autorest_checks.yml +++ b/eng/pipelines/autorest_checks.yml @@ -15,7 +15,7 @@ pr: variables: NodeVersion: '18.x' - PythonVersion: '3.10' + PythonVersion: '3.11' auto_rest_clone_url: 'https://github.com/Azure/autorest.python.git' source_path_azure_core: 'sdk/core/azure-core' source_path_azure_mgmt_core: 'sdk/core/azure-mgmt-core' diff --git a/eng/pipelines/templates/jobs/regression.yml b/eng/pipelines/templates/jobs/regression.yml index 1fbb02160174..1a196224e6bd 100644 --- a/eng/pipelines/templates/jobs/regression.yml +++ b/eng/pipelines/templates/jobs/regression.yml @@ -82,9 +82,9 @@ jobs: BuildTargetingString: ${{ parameters.BuildTargetingString }} - task: UsePythonVersion@0 - displayName: 'Use Python 3.10' + displayName: 'Use Python 3.11' inputs: - versionSpec: '3.10' + versionSpec: '3.11' - template: /eng/pipelines/templates/steps/use-venv.yml diff --git a/eng/pipelines/templates/jobs/run-cli-tests.yml b/eng/pipelines/templates/jobs/run-cli-tests.yml index 13eefb53f8e0..0378e8342cd7 100644 --- a/eng/pipelines/templates/jobs/run-cli-tests.yml +++ b/eng/pipelines/templates/jobs/run-cli-tests.yml @@ -19,7 +19,7 @@ parameters: default: [] - name: PythonVersion type: string - default: "3.10" + default: "3.11" - name: TargetModules type: string default: "appservice botservice cloud network azure-cli-core azure-cli-telemetry" diff --git a/eng/pipelines/templates/jobs/smoke.tests.yml b/eng/pipelines/templates/jobs/smoke.tests.yml index 6e8a877d61d2..dbe409a7b9e4 100644 --- a/eng/pipelines/templates/jobs/smoke.tests.yml +++ b/eng/pipelines/templates/jobs/smoke.tests.yml @@ -44,8 +44,8 @@ jobs: condition: and(succeeded(), eq(dependencies.smoke_test_eligibility.outputs['output_eligibility.RunSmokeTests'], true)) strategy: matrix: - Python_310_Linux (AzureCloud): - PythonVersion: '3.10' + Python_311_Linux (AzureCloud): + PythonVersion: '3.11' PythonArchitecture: 'x64' pool: @@ -78,8 +78,8 @@ jobs: condition: and(succeeded(), eq(dependencies.smoke_test_eligibility.outputs['output_eligibility.RunSmokeTests'], true)) strategy: matrix: - Python_310_Windows (AzureCloud): - PythonVersion: '3.10' + Python_311_Windows (AzureCloud): + PythonVersion: '3.11' PythonArchitecture: 'x64' pool: @@ -109,8 +109,8 @@ jobs: condition: and(succeeded(), eq(dependencies.smoke_test_eligibility.outputs['output_eligibility.RunSmokeTests'], true)) strategy: matrix: - Python_310_Mac (AzureCloud): - PythonVersion: '3.10' + Python_311_Mac (AzureCloud): + PythonVersion: '3.11' PythonArchitecture: 'arm64' pool: diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 17d0ea54f584..28e4f4c147e5 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -9,7 +9,7 @@ "ubuntu-24.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" }, "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, - "PythonVersion": [ "3.10", "3.12" ], + "PythonVersion": [ "3.11", "3.12" ], "CoverageArg": "--disablecov", "TestSamples": "false" }, @@ -27,10 +27,10 @@ }, { "CoverageConfig": { - "ubuntu2404_310_coverage": { + "ubuntu2404_311_coverage": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL", - "PythonVersion": "3.10", + "PythonVersion": "3.11", "CoverageArg": "", "TestSamples": "false" } diff --git a/eng/pipelines/templates/stages/python-analyze-weekly.yml b/eng/pipelines/templates/stages/python-analyze-weekly.yml index ed318e3a67db..b175e80a89aa 100644 --- a/eng/pipelines/templates/stages/python-analyze-weekly.yml +++ b/eng/pipelines/templates/stages/python-analyze-weekly.yml @@ -36,9 +36,9 @@ stages: steps: - task: UsePythonVersion@0 - displayName: 'Use Python 3.10' + displayName: 'Use Python 3.11' inputs: - versionSpec: '3.10' + versionSpec: '3.11' # Authenticate pip to the configured Azure DevOps feed before installs. - template: /eng/pipelines/templates/steps/auth-dev-feed.yml diff --git a/eng/pipelines/templates/steps/install-uv.yml b/eng/pipelines/templates/steps/install-uv.yml index 9ae9b10c6a2d..d974fb610728 100644 --- a/eng/pipelines/templates/steps/install-uv.yml +++ b/eng/pipelines/templates/steps/install-uv.yml @@ -3,7 +3,7 @@ steps: $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true $indexUrl = if ($env:PIP_INDEX_URL) { $env:PIP_INDEX_URL } else { 'https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/' } - python -m pip install uv==0.11.6 --index-url $indexUrl + python -m pip install uv==0.13.4 --index-url $indexUrl # prepend the path to the installed uv to the PATH so that it can be used in subsequent steps without needing to know the exact path or relying # the global python instance being prepended on the PATH diff --git a/eng/pipelines/templates/steps/run_apistub.yml b/eng/pipelines/templates/steps/run_apistub.yml index eb61c18726b2..4fbbc7c04ff7 100644 --- a/eng/pipelines/templates/steps/run_apistub.yml +++ b/eng/pipelines/templates/steps/run_apistub.yml @@ -6,9 +6,9 @@ parameters: # Please use `$(TargetingString)` to refer to the python packages glob string. This variable is set from resolve-package-targeting.yml. steps: - task: UsePythonVersion@0 - displayName: 'Use Python 3.10' + displayName: 'Use Python 3.11' inputs: - versionSpec: '3.10' + versionSpec: '3.11' condition: and(succeededOrFailed(), ne(variables['Skip.ApiStubGen'],'true')) - template: /eng/pipelines/templates/steps/use-venv.yml diff --git a/eng/pipelines/templates/steps/run_bandit.yml b/eng/pipelines/templates/steps/run_bandit.yml index 8212ff3b5da8..d808e4add5a6 100644 --- a/eng/pipelines/templates/steps/run_bandit.yml +++ b/eng/pipelines/templates/steps/run_bandit.yml @@ -6,7 +6,7 @@ parameters: # Please use `$(TargetingString)` to refer to the python packages glob string. This variable is set from resolve-package-targeting.yml. steps: - # this step should run on python 3.10. + # this step should run on python 3.11. # a previous step should have installed eng/ci_tools.txt to active venv - task: PythonScript@0 displayName: 'Run Bandit' diff --git a/eng/pipelines/templates/steps/run_black.yml b/eng/pipelines/templates/steps/run_black.yml index 39874f6610eb..703b8dcf61a6 100644 --- a/eng/pipelines/templates/steps/run_black.yml +++ b/eng/pipelines/templates/steps/run_black.yml @@ -4,7 +4,7 @@ parameters: AdditionalTestArgs: '' steps: - # this step should run on python 3.10. + # this step should run on python 3.11. # a previous step should have installed eng/ci_tools.txt to active venv - task: PythonScript@0 displayName: 'Run Black' diff --git a/eng/pipelines/templates/steps/run_mypy.yml b/eng/pipelines/templates/steps/run_mypy.yml index 7d1490a99364..019e45ca4550 100644 --- a/eng/pipelines/templates/steps/run_mypy.yml +++ b/eng/pipelines/templates/steps/run_mypy.yml @@ -6,7 +6,7 @@ parameters: # Please use `$(TargetingString)` to refer to the python packages glob string. This variable is set from resolve-package-targeting.yml. steps: - # this step should run on python 3.10. + # this step should run on python 3.11. # a previous step should have installed eng/ci_tools.txt to active venv - task: PythonScript@0 displayName: 'Run MyPy' diff --git a/eng/pipelines/templates/steps/run_pylint.yml b/eng/pipelines/templates/steps/run_pylint.yml index 571d6a1b35c9..b208188e930d 100644 --- a/eng/pipelines/templates/steps/run_pylint.yml +++ b/eng/pipelines/templates/steps/run_pylint.yml @@ -5,7 +5,7 @@ parameters: # Please use `$(TargetingString)` to refer to the python packages glob string. This variable is set from resolve-package-targeting.yml. steps: - # this step should run on python 3.10. + # this step should run on python 3.11. # a previous step should have installed eng/ci_tools.txt to active venv - task: PythonScript@0 displayName: 'Run Pylint' diff --git a/eng/pipelines/templates/steps/run_pyright.yml b/eng/pipelines/templates/steps/run_pyright.yml index 83b233b1049d..41cc461dd215 100644 --- a/eng/pipelines/templates/steps/run_pyright.yml +++ b/eng/pipelines/templates/steps/run_pyright.yml @@ -6,7 +6,7 @@ parameters: # Please use `$(TargetingString)` to refer to the python packages glob string. This variable is set from resolve-package-targeting.yml. steps: - # this step should run on python 3.10. + # this step should run on python 3.11. # a previous step should have installed eng/ci_tools.txt to active venv - task: PythonScript@0 displayName: 'Run Pyright' diff --git a/eng/pipelines/templates/steps/seed-virtualenv-wheels.yml b/eng/pipelines/templates/steps/seed-virtualenv-wheels.yml index 6aefa40ad4a5..5771c5b515f5 100644 --- a/eng/pipelines/templates/steps/seed-virtualenv-wheels.yml +++ b/eng/pipelines/templates/steps/seed-virtualenv-wheels.yml @@ -1,7 +1,7 @@ parameters: WHEEL_VERSION: '0.37.0' SETUPTOOLS_VERSION: '59.6.0' - PIP_VERSION: '20.3.3' + PIP_VERSION: '26.2.2' steps: - pwsh: | diff --git a/eng/pipelines/templates/steps/smoke-test-steps.yml b/eng/pipelines/templates/steps/smoke-test-steps.yml index 437fae9a617b..8d7cb18e63eb 100644 --- a/eng/pipelines/templates/steps/smoke-test-steps.yml +++ b/eng/pipelines/templates/steps/smoke-test-steps.yml @@ -23,7 +23,7 @@ steps: DevFeedName: ${{ parameters.DevFeedName }} - script: | - python -m pip install pip==20.0.2 + python -m pip install pip==26.2.2 pip --version displayName: pip --version diff --git a/eng/pipelines/templates/steps/update_snippet.yml b/eng/pipelines/templates/steps/update_snippet.yml index d55c442dd0d8..b92adc012a81 100644 --- a/eng/pipelines/templates/steps/update_snippet.yml +++ b/eng/pipelines/templates/steps/update_snippet.yml @@ -3,7 +3,7 @@ parameters: AdditionalTestArgs: '' steps: - # this step should run on python 3.10. + # this step should run on python 3.11. # a previous step should have installed eng/ci_tools.txt to active venv - task: PythonScript@0 displayName: 'Update Snippets' diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml index 58f4749d6c65..c68a53f2c2ac 100644 --- a/eng/pipelines/templates/variables/globals.yml +++ b/eng/pipelines/templates/variables/globals.yml @@ -1,5 +1,5 @@ variables: - PythonVersion: '3.10' + PythonVersion: '3.11' skipComponentGovernanceDetection: true AzureSDKCondaChannel: https://azuresdkconda.blob.core.windows.net/channel1/ Package.EnableSBOMSigning: true diff --git a/eng/regression_test_tools.txt b/eng/regression_test_tools.txt index 54f86e20e56f..7a4efbd273f4 100644 --- a/eng/regression_test_tools.txt +++ b/eng/regression_test_tools.txt @@ -1,4 +1,4 @@ -pip==20.2 +pip==26.2.2 # requirements leveraged by ci for testing pytest==7.3.1 diff --git a/eng/regression_tools.txt b/eng/regression_tools.txt index 04862f23660b..4d89ea638f41 100644 --- a/eng/regression_tools.txt +++ b/eng/regression_tools.txt @@ -8,7 +8,7 @@ pathlib2==2.3.5 doc-warden==0.7.2 beautifulsoup4==4.9.1 pkginfo==1.5.0.1 -pip==20.3.3 +pip==26.2.2 typing-extensions<=4.6.3 # locking packages defined as deps from azure-sdk-tools diff --git a/eng/tools/azure-sdk-tools/pyproject.toml b/eng/tools/azure-sdk-tools/pyproject.toml index 0846df8df1b7..4c28b330e884 100644 --- a/eng/tools/azure-sdk-tools/pyproject.toml +++ b/eng/tools/azure-sdk-tools/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "setuptools", "pyparsing", "certifi", - "cibuildwheel==2.23.3", + "cibuildwheel", "pkginfo", "build", "packaging", From 88b1ffb06abda3d35ab24a7f9d0f0f3f28b9cbbc Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:31:26 -0700 Subject: [PATCH 15/35] Sync .github/workflows directory with azure-sdk-tools for PR 17346 (#49643) * Remove unsafe PR-source build instructions from event processor workflow * Isolate Azure authentication to newly opened issue processing * Use least-privilege permissions per job --------- Co-authored-by: Chidozie Ononiwu --- .github/workflows/event-processor.yml | 68 +++++++++++++-------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 16370e2edabb..ab576a2a1c5b 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -17,30 +17,24 @@ on: permissions: {} jobs: - # This event requires the Azure CLI to get the LABEL_SERVICE_API_KEY from the vault. - # Because the azure/login step adds time costly pre/post Az CLI commands to any every job - # it's used in, split this into its own job so only the event that needs the Az CLI pays - # the cost. + # Only newly opened issues need Azure login and secrets from Key Vault. event-handler-with-azure: + if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} permissions: issues: write - pull-requests: write # For OIDC auth id-token: write - contents: read name: Handle ${{ github.event_name }} ${{ github.event.action }} event with azure login runs-on: ubuntu-latest steps: - name: 'Az CLI login' uses: azure/login@7ddb5af1ef8758cf1353cf3b42f940aee27ba21c # v3.0.2 - if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} with: client-id: e4cb9fd5-0875-4ca1-bc43-56196f5dfb8f tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 allow-no-subscriptions: true - name: 'Run Azure CLI commands' - if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} run: | LABEL_SERVICE_API_KEY=$(az keyvault secret show \ --vault-name issue-labeler \ @@ -60,10 +54,6 @@ jobs: echo "::add-mask::$APP_CONFIG_ENDPOINT" echo "APP_CONFIG_ENDPOINT=$APP_CONFIG_ENDPOINT" >> "$GITHUB_ENV" - # To run github-event-processor built from source, for testing purposes, uncomment everything - # in between the Start/End-Build From Source comments and comment everything in between the - # Start/End-Install comments - # Start-Install - name: Install GitHub Event Processor run: > dotnet tool install @@ -72,28 +62,6 @@ jobs: --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash - # End-Install - - # Testing checkout of sources from the Azure/azure-sdk-tools repository - # The ref: is the SHA from the pull request in that repository or the - # refs/pull//merge for the latest on any given PR. If the repository - # is a fork eg. /azure-sdk-tools then the repository down below will - # need to point to that fork - # Start-Build - # - name: Checkout tools repo for GitHub Event Processor sources - # uses: actions/checkout@v3 - # with: - # repository: Azure/azure-sdk-tools - # path: azure-sdk-tools - # ref: /merge> or - - # - name: Build and install GitHubEventProcessor from sources - # run: | - # dotnet pack - # dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor - # shell: bash - # working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor - # End-Build - name: Process Action Event run: | @@ -112,3 +80,35 @@ jobs: with: name: event path: ${{ github.event_path }} + + event-handler: + if: ${{ !(github.event_name == 'issues' && github.event.action == 'opened') }} + permissions: + issues: write + # PR events can dismiss approvals after untrusted changes. + pull-requests: write + name: Handle ${{ github.event_name }} ${{ github.event.action }} event + runs-on: ubuntu-latest + steps: + - name: Install GitHub Event Processor + run: > + dotnet tool install + Azure.Sdk.Tools.GitHubEventProcessor + --version 1.0.0-dev.20260403.1 + --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json + --global + shell: bash + + - name: Process Action Event + run: | + github-event-processor ${{ github.event_name }} ${{ github.event_path }} + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Archive github event data + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: always() + with: + name: event + path: ${{ github.event_path }} From f8eec28aaf1cfdc6ee88ee29841a420de055f41f Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 21 Oct 2026 14:56:04 -0700 Subject: [PATCH 16/35] Fix scheduled test weekend eligibility (#49642) Replace unsupported Azure Pipelines weekday formatting with a shared PowerShell eligibility check using pipeline start time in UTC. Preserve scheduled-run guards and add regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- doc/eng_sys_checks.md | 2 + .../templates/stages/archetype-sdk-tests.yml | 4 +- .../python-analyze-weekly-standalone.yml | 4 +- .../stages/python-analyze-weekly.yml | 28 ++++++ .../tests/test_weekly_analyze_pipeline.py | 99 +++++++++++++++++++ 5 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 eng/tools/azure-sdk-tools/tests/test_weekly_analyze_pipeline.py diff --git a/doc/eng_sys_checks.md b/doc/eng_sys_checks.md index 85454719a670..70b186c5845a 100644 --- a/doc/eng_sys_checks.md +++ b/doc/eng_sys_checks.md @@ -587,6 +587,8 @@ python scripts/devops_tasks/verify_autorest.py --service_directory diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 3eeebbd99369..bd9fe0efa3d2 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -168,11 +168,11 @@ extends: ServiceConnection: ${{ coalesce(cloud.value.ServiceConnection, lower(format('azure-sdk-tests-{0}', cloud.key))) }} SubscriptionConfigurationFilePaths: ${{ cloud.value.SubscriptionConfigurationFilePaths }} - # Analyze-weekly runs only on scheduled runs that start on a weekend (Sat/Sun, UTC). + # The shared template checks whether the scheduled run started on a weekend (UTC). - ${{ if eq(variables['Build.Reason'], 'Schedule') }}: - template: /eng/pipelines/templates/stages/python-analyze-weekly.yml parameters: BuildTargetingString: ${{ package }} ServiceDirectory: ${{ parameters.ServiceDirectory }} JobName: ${{ parameters.JobName }} - Condition: and(succeeded(), in(format('{0:ddd}', pipeline.startTime), 'Sat', 'Sun')) + Condition: succeeded() diff --git a/eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml b/eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml index 42b6c09b0e31..025db8c26d2b 100644 --- a/eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml +++ b/eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml @@ -13,10 +13,10 @@ extends: template: /eng/pipelines/templates/stages/1es-redirect.yml parameters: stages: - # Analyze-weekly runs only on scheduled runs that start on a weekend (Sat/Sun, UTC). + # The shared template checks whether the scheduled run started on a weekend (UTC). - template: /eng/pipelines/templates/stages/python-analyze-weekly.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} BuildTargetingString: ${{ parameters.BuildTargetingString }} JobName: ${{ parameters.JobName }} - Condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule'), in(format('{0:ddd}', pipeline.startTime), 'Sat', 'Sun')) \ No newline at end of file + Condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule')) \ No newline at end of file diff --git a/eng/pipelines/templates/stages/python-analyze-weekly.yml b/eng/pipelines/templates/stages/python-analyze-weekly.yml index b175e80a89aa..0c22cb732330 100644 --- a/eng/pipelines/templates/stages/python-analyze-weekly.yml +++ b/eng/pipelines/templates/stages/python-analyze-weekly.yml @@ -26,7 +26,35 @@ stages: dependsOn: [] condition: ${{ parameters.Condition }} jobs: + - job: CheckWeekend + displayName: 'Check weekend eligibility' + pool: + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + variables: + PipelineStartTime: $[ format('{0:yyyy-MM-ddTHH:mm:ssK}', pipeline.startTime) ] + steps: + - checkout: none + # Azure Pipelines format() does not support day-of-week specifiers. + - pwsh: | + $startTime = [DateTimeOffset]::ParseExact( + $env:PIPELINE_START_TIME, + 'yyyy-MM-ddTHH:mm:ssK', + [Globalization.CultureInfo]::InvariantCulture + ) + $isWeekend = $startTime.UtcDateTime.DayOfWeek -in @( + [DayOfWeek]::Saturday, [DayOfWeek]::Sunday + ) + Write-Host "##vso[task.setvariable variable=IsWeekend;isOutput=true]$isWeekend" + name: eligibility + displayName: 'Check pipeline start day in UTC' + env: + PIPELINE_START_TIME: $(PipelineStartTime) + - job: 'Analyze' + dependsOn: CheckWeekend + condition: and(succeeded(), eq(dependencies.CheckWeekend.outputs['eligibility.IsWeekend'], 'True')) timeoutInMinutes: 90 pool: diff --git a/eng/tools/azure-sdk-tools/tests/test_weekly_analyze_pipeline.py b/eng/tools/azure-sdk-tools/tests/test_weekly_analyze_pipeline.py new file mode 100644 index 000000000000..d2dc98cbb876 --- /dev/null +++ b/eng/tools/azure-sdk-tools/tests/test_weekly_analyze_pipeline.py @@ -0,0 +1,99 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +import os +from pathlib import Path +import shutil +import subprocess + +import pytest +import yaml + + +TEMPLATES = Path(__file__).resolve().parents[4] / "eng" / "pipelines" / "templates" / "stages" + + +def load_template(name): + return yaml.safe_load((TEMPLATES / name).read_text()) + + +@pytest.fixture +def eligibility_step(): + stage = load_template("python-analyze-weekly.yml")["stages"][0] + check, analyze = stage["jobs"] + assert check["job"] == "CheckWeekend" + assert check["variables"]["PipelineStartTime"] == "$[ format('{0:yyyy-MM-ddTHH:mm:ssK}', pipeline.startTime) ]" + assert check["steps"][0] == {"checkout": "none"} + assert analyze["dependsOn"] == check["job"] + step = check["steps"][1] + assert step["env"]["PIPELINE_START_TIME"] == "$(PipelineStartTime)" + assert analyze["condition"] == ( + "and(succeeded(), eq(dependencies.CheckWeekend.outputs['" + step["name"] + ".IsWeekend'], 'True'))" + ) + return step + + +@pytest.mark.parametrize( + "timestamp,expected", + [ + ("2026-10-12T00:00:00Z", False), + ("2026-10-13T12:00:00Z", False), + ("2026-10-14T12:00:00Z", False), + ("2026-10-15T12:00:00Z", False), + ("2026-10-16T23:59:59Z", False), + ("2026-10-17T00:00:00Z", True), + ("2026-10-18T23:59:59Z", True), + ("2026-10-19T00:00:00Z", False), + ("2026-10-16T17:00:00-07:00", True), + ("2026-10-19T01:00:00+02:00", True), + ("2026-10-18T17:00:00-07:00", False), + ("2026-10-17T01:00:00+02:00", False), + ("2028-02-29T00:00:00Z", False), + ("2027-01-02T00:00:00Z", True), + ("", None), + ("invalid", None), + ], +) +def test_weekend_eligibility_uses_pipeline_start_time(eligibility_step, timestamp, expected): + powershell = shutil.which("pwsh") + if not powershell: + pytest.skip("PowerShell is required to execute pipeline scripts") + result = subprocess.run( + [ + powershell, + "-NoProfile", + "-NonInteractive", + "-Command", + "$ErrorActionPreference = 'Stop'\n" + eligibility_step["pwsh"], + ], + env={**os.environ, "PIPELINE_START_TIME": timestamp}, + capture_output=True, + text=True, + timeout=30, + check=False, + ) + if expected is None: + assert result.returncode != 0 + assert "variable=IsWeekend" not in result.stdout + else: + assert result.returncode == 0, result.stderr + assert f"##vso[task.setvariable variable=IsWeekend;isOutput=true]{expected}" in result.stdout + + +def test_callers_preserve_scheduled_run_guards(): + archetype = load_template("archetype-sdk-tests.yml") + packages = next(iter(archetype["extends"]["parameters"]["stages"][0].values())) + weekly = packages[1]["${{ if eq(variables['Build.Reason'], 'Schedule') }}"][0] + assert weekly["template"].endswith("/python-analyze-weekly.yml") + assert weekly["parameters"]["Condition"] == "succeeded()" + + standalone = load_template("python-analyze-weekly-standalone.yml") + weekly = standalone["extends"]["parameters"]["stages"][0] + assert weekly["template"].endswith("/python-analyze-weekly.yml") + assert weekly["parameters"]["Condition"] == "and(succeeded(), eq(variables['Build.Reason'], 'Schedule'))" + + for name in ("archetype-sdk-tests.yml", "python-analyze-weekly-standalone.yml", "python-analyze-weekly.yml"): + assert "{0:ddd}" not in (TEMPLATES / name).read_text() From ac6589fe38a6c33629aaba686fbf1a18a49f622b Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 18:00:47 -0700 Subject: [PATCH 17/35] [AutoPR azure-mgmt-aigateway]-generated-from-SDK Generation - Python-6948523 (#49457) * Configurations: 'specification/apimanagement/resource-manager/Microsoft.ApiManagement/AIGateway/tspconfig.yaml', and CommitSHA: '2335fe5db98171e7a78d08e712920b1869c536ce' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6938914 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Configurations: 'specification/apimanagement/resource-manager/Microsoft.ApiManagement/AIGateway/tspconfig.yaml', and CommitSHA: 'ac7c51b32205afe231bdb539db0c3550172ea639' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6948523 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: azure-sdk --- .../azure-mgmt-aigateway/CHANGELOG.md | 7 + .../azure-mgmt-aigateway/LICENSE | 21 + .../azure-mgmt-aigateway/MANIFEST.in | 7 + .../azure-mgmt-aigateway/README.md | 61 + .../azure-mgmt-aigateway/_metadata.json | 11 + sdk/apimanagement/azure-mgmt-aigateway/api.md | 749 ++++++ .../azure-mgmt-aigateway/api.metadata.yml | 4 + .../apiview-properties.json | 44 + .../azure-mgmt-aigateway/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/aigateway/__init__.py | 32 + .../azure/mgmt/aigateway/_client.py | 145 ++ .../azure/mgmt/aigateway/_configuration.py | 82 + .../azure/mgmt/aigateway/_patch.py | 20 + .../azure/mgmt/aigateway/_utils/__init__.py | 6 + .../azure/mgmt/aigateway/_utils/model_base.py | 1787 ++++++++++++++ .../mgmt/aigateway/_utils/serialization.py | 2179 +++++++++++++++++ .../azure/mgmt/aigateway/_utils/utils.py | 40 + .../azure/mgmt/aigateway/_version.py | 9 + .../azure/mgmt/aigateway/aio/__init__.py | 29 + .../azure/mgmt/aigateway/aio/_client.py | 149 ++ .../mgmt/aigateway/aio/_configuration.py | 82 + .../azure/mgmt/aigateway/aio/_patch.py | 20 + .../mgmt/aigateway/aio/operations/__init__.py | 27 + .../aigateway/aio/operations/_operations.py | 1099 +++++++++ .../mgmt/aigateway/aio/operations/_patch.py | 20 + .../azure/mgmt/aigateway/models/__init__.py | 76 + .../azure/mgmt/aigateway/models/_enums.py | 86 + .../azure/mgmt/aigateway/models/_models.py | 719 ++++++ .../azure/mgmt/aigateway/models/_patch.py | 20 + .../mgmt/aigateway/operations/__init__.py | 27 + .../mgmt/aigateway/operations/_operations.py | 1302 ++++++++++ .../azure/mgmt/aigateway/operations/_patch.py | 20 + .../azure/mgmt/aigateway/py.typed | 1 + .../azure/mgmt/aigateway/types.py | 341 +++ .../azure-mgmt-aigateway/dev_requirements.txt | 5 + .../generated_samples/ai_gateway_create.py | 56 + .../generated_samples/ai_gateway_delete.py | 43 + .../generated_samples/ai_gateway_get.py | 42 + .../ai_gateway_list_by_resource_group.py | 42 + .../ai_gateway_list_by_subscription.py | 40 + .../ai_gateway_list_operations.py | 40 + .../generated_samples/ai_gateway_update.py | 45 + .../generated_tests/conftest.py | 35 + ...ay_mgmt_ai_gateway_resources_operations.py | 123 + ...t_ai_gateway_resources_operations_async.py | 130 + .../test_ai_gateway_mgmt_operations.py | 27 + .../test_ai_gateway_mgmt_operations_async.py | 28 + .../azure-mgmt-aigateway/pyproject.toml | 86 + .../azure-mgmt-aigateway/tsp-location.yaml | 4 + sdk/apimanagement/ci.yml | 2 + 51 files changed, 9972 insertions(+) create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/CHANGELOG.md create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/LICENSE create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/MANIFEST.in create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/README.md create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/_metadata.json create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/api.md create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/api.metadata.yml create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/apiview-properties.json create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_client.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_configuration.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_patch.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/model_base.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/serialization.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/utils.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_version.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_client.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_configuration.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_patch.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_patch.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_enums.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_models.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_patch.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/__init__.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_patch.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/py.typed create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/types.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/dev_requirements.txt create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_create.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_delete.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_get.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_resource_group.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_subscription.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_update.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_tests/conftest.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations_async.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations_async.py create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/pyproject.toml create mode 100644 sdk/apimanagement/azure-mgmt-aigateway/tsp-location.yaml diff --git a/sdk/apimanagement/azure-mgmt-aigateway/CHANGELOG.md b/sdk/apimanagement/azure-mgmt-aigateway/CHANGELOG.md new file mode 100644 index 000000000000..260da637fa5f --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0b1 (2026-10-13) + +### Other Changes + + - Initial version \ No newline at end of file diff --git a/sdk/apimanagement/azure-mgmt-aigateway/LICENSE b/sdk/apimanagement/azure-mgmt-aigateway/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/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/apimanagement/azure-mgmt-aigateway/MANIFEST.in b/sdk/apimanagement/azure-mgmt-aigateway/MANIFEST.in new file mode 100644 index 000000000000..f0dbcb6af2e7 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include azure/mgmt/aigateway/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/apimanagement/azure-mgmt-aigateway/README.md b/sdk/apimanagement/azure-mgmt-aigateway/README.md new file mode 100644 index 000000000000..ca0f6e7d8b0b --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/README.md @@ -0,0 +1,61 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure Aigateway Management Client Library. +This package has been tested with Python 3.10+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + +## _Disclaimer_ + +_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ + +## Getting started + +### Prerequisites + +- Python 3.10+ is required to use this package. +- [Azure subscription](https://azure.microsoft.com/free/) + +### Install the package + +```bash +pip install azure-mgmt-aigateway +pip install azure-identity +``` + +### Authentication + +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` for Azure client secret. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, client can be authenticated by following code: + +```python +from azure.identity import DefaultAzureCredential +from azure.mgmt.aigateway import AIGatewayMgmtClient +import os + +sub_id = os.getenv("AZURE_SUBSCRIPTION_ID") +client = AIGatewayMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id) +``` + +## Examples + +Code samples for this package can be found at: +- [Search Aigateway Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com +- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +## Troubleshooting + +## Next steps + +## Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. diff --git a/sdk/apimanagement/azure-mgmt-aigateway/_metadata.json b/sdk/apimanagement/azure-mgmt-aigateway/_metadata.json new file mode 100644 index 000000000000..e2051eec61f8 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/_metadata.json @@ -0,0 +1,11 @@ +{ + "apiVersion": "2026-09-01-preview", + "apiVersions": { + "Microsoft.ApiManagement": "2026-09-01-preview" + }, + "commit": "ac7c51b32205afe231bdb539db0c3550172ea639", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/apimanagement/resource-manager/Microsoft.ApiManagement/AIGateway", + "emitterVersion": "0.63.9", + "httpClientPythonVersion": "0.38.1" +} \ No newline at end of file diff --git a/sdk/apimanagement/azure-mgmt-aigateway/api.md b/sdk/apimanagement/azure-mgmt-aigateway/api.md new file mode 100644 index 000000000000..8847de88ef0d --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/api.md @@ -0,0 +1,749 @@ +```py +namespace azure.mgmt.aigateway + + class azure.mgmt.aigateway.AIGatewayMgmtClient: implements ContextManager + ai_gateway_resources: AiGatewayResourcesOperations + operations: Operations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.aigateway.aio + + class azure.mgmt.aigateway.aio.AIGatewayMgmtClient: implements AsyncContextManager + ai_gateway_resources: AiGatewayResourcesOperations + operations: Operations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.aigateway.aio.operations + + class azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AiGatewayResource]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AiGatewayResource]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AiGatewayResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + ai_gateway_name: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: AiGatewayUpdateParameters, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[AiGatewayResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: AiGatewayUpdateParameters, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[AiGatewayResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[AiGatewayResource]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + ai_gateway_name: str, + **kwargs: Any + ) -> AiGatewayResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[AiGatewayResource]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[AiGatewayResource]: ... + + + class azure.mgmt.aigateway.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + +namespace azure.mgmt.aigateway.models + + class azure.mgmt.aigateway.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.aigateway.models.AiGatewayBackend(_Model): + subnet: Optional[AiGatewaySubnet] + + @overload + def __init__( + self, + *, + subnet: Optional[AiGatewaySubnet] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.AiGatewayFrontend(_Model): + default_hostname: Optional[str] + + + class azure.mgmt.aigateway.models.AiGatewayProperties(_Model): + backend: Optional[AiGatewayBackend] + frontend: Optional[AiGatewayFrontend] + provisioning_state: Optional[Union[str, AiGatewayProvisioningState]] + + @overload + def __init__( + self, + *, + backend: Optional[AiGatewayBackend] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.AiGatewayProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.aigateway.models.AiGatewayResource(TrackedResource): + e_tag: Optional[str] + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: AiGatewayProperties + sku: Optional[Sku] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: AiGatewayProperties, + sku: Optional[Sku] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.AiGatewaySkuUpdate(_Model): + capacity: Optional[int] + family: Optional[str] + name: Optional[str] + size: Optional[str] + tier: Optional[Union[str, SkuTier]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + family: Optional[str] = ..., + name: Optional[str] = ..., + size: Optional[str] = ..., + tier: Optional[Union[str, SkuTier]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.AiGatewaySubnet(_Model): + id: str + + @overload + def __init__( + self, + *, + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.AiGatewayUpdateParameters(_Model): + identity: Optional[ManagedServiceIdentity] + sku: Optional[AiGatewaySkuUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + sku: Optional[AiGatewaySkuUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.aigateway.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.aigateway.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.aigateway.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.aigateway.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.aigateway.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.aigateway.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.aigateway.models.Sku(_Model): + capacity: Optional[int] + family: Optional[str] + name: str + size: Optional[str] + tier: Optional[Union[str, SkuTier]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + family: Optional[str] = ..., + name: str, + size: Optional[str] = ..., + tier: Optional[Union[str, SkuTier]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASIC = "Basic" + FREE = "Free" + PREMIUM = "Premium" + STANDARD = "Standard" + + + class azure.mgmt.aigateway.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.aigateway.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + +namespace azure.mgmt.aigateway.operations + + class azure.mgmt.aigateway.operations.AiGatewayResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AiGatewayResource]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AiGatewayResource]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AiGatewayResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + ai_gateway_name: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: AiGatewayUpdateParameters, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[AiGatewayResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: AiGatewayUpdateParameters, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[AiGatewayResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[AiGatewayResource]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + ai_gateway_name: str, + **kwargs: Any + ) -> AiGatewayResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[AiGatewayResource]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[AiGatewayResource]: ... + + + class azure.mgmt.aigateway.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + +namespace azure.mgmt.aigateway.types + + class azure.mgmt.aigateway.types.AiGatewayBackend(TypedDict, total=False): + key "subnet": ForwardRef('AiGatewaySubnet', module='types') + subnet: AiGatewaySubnet + + + class azure.mgmt.aigateway.types.AiGatewayFrontend(TypedDict, total=False): + key "defaultHostname": str + defaultHostname: str + + + class azure.mgmt.aigateway.types.AiGatewayProperties(TypedDict, total=False): + key "backend": ForwardRef('AiGatewayBackend', module='types') + key "frontend": ForwardRef('AiGatewayFrontend', module='types') + key "provisioningState": Union[str, AiGatewayProvisioningState] + backend: AiGatewayBackend + frontend: AiGatewayFrontend + provisioningState: Union[str, AiGatewayProvisioningState] + + + class azure.mgmt.aigateway.types.AiGatewayResource(TrackedResource): + key "eTag": str + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": Required[AiGatewayProperties] + key "sku": ForwardRef('Sku', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + eTag: str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: AiGatewayProperties + sku: Sku + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.aigateway.types.AiGatewaySkuUpdate(TypedDict, total=False): + key "capacity": int + key "family": str + key "name": str + key "size": str + key "tier": Union[str, SkuTier] + capacity: int + family: str + name: str + size: str + tier: Union[str, SkuTier] + + + class azure.mgmt.aigateway.types.AiGatewaySubnet(TypedDict, total=False): + key "id": Required[str] + id: str + + + class azure.mgmt.aigateway.types.AiGatewayUpdateParameters(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "sku": ForwardRef('AiGatewaySkuUpdate', module='types') + identity: ManagedServiceIdentity + sku: AiGatewaySkuUpdate + tags: dict[str, str] + + + class azure.mgmt.aigateway.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principalId: str + tenantId: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.aigateway.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.aigateway.types.Sku(TypedDict, total=False): + key "capacity": int + key "family": str + key "name": Required[str] + key "size": str + key "tier": Union[str, SkuTier] + capacity: int + family: str + name: str + size: str + tier: Union[str, SkuTier] + + + class azure.mgmt.aigateway.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.aigateway.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.aigateway.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + clientId: str + principalId: str + + +``` \ No newline at end of file diff --git a/sdk/apimanagement/azure-mgmt-aigateway/api.metadata.yml b/sdk/apimanagement/azure-mgmt-aigateway/api.metadata.yml new file mode 100644 index 000000000000..f388ad3256da --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/api.metadata.yml @@ -0,0 +1,4 @@ +apiMdSha256: 3f191f01d95a62e37271e642f1b2795814d324be2bc258fa5a2c5f5abcdcc772 +packageVersion: 1.0.0b1 +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/apimanagement/azure-mgmt-aigateway/apiview-properties.json b/sdk/apimanagement/azure-mgmt-aigateway/apiview-properties.json new file mode 100644 index 000000000000..603b00bf6244 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/apiview-properties.json @@ -0,0 +1,44 @@ +{ + "CrossLanguagePackageId": "Microsoft.ApiManagement", + "CrossLanguageDefinitionId": { + "azure.mgmt.aigateway.models.AiGatewayBackend": "Microsoft.ApiManagement.AiGatewayBackend", + "azure.mgmt.aigateway.models.AiGatewayFrontend": "Microsoft.ApiManagement.AiGatewayFrontend", + "azure.mgmt.aigateway.models.AiGatewayProperties": "Microsoft.ApiManagement.AiGatewayProperties", + "azure.mgmt.aigateway.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.aigateway.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.aigateway.models.AiGatewayResource": "Microsoft.ApiManagement.AiGatewayResource", + "azure.mgmt.aigateway.models.AiGatewaySkuUpdate": "Microsoft.ApiManagement.AiGatewaySkuUpdate", + "azure.mgmt.aigateway.models.AiGatewaySubnet": "Microsoft.ApiManagement.AiGatewaySubnet", + "azure.mgmt.aigateway.models.AiGatewayUpdateParameters": "Microsoft.ApiManagement.AiGatewayUpdateParameters", + "azure.mgmt.aigateway.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.aigateway.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.aigateway.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.aigateway.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.aigateway.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.aigateway.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.aigateway.models.Sku": "Azure.ResourceManager.CommonTypes.Sku", + "azure.mgmt.aigateway.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.aigateway.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.aigateway.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.aigateway.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.aigateway.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.aigateway.models.AiGatewayProvisioningState": "Microsoft.ApiManagement.AiGatewayProvisioningState", + "azure.mgmt.aigateway.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "azure.mgmt.aigateway.models.SkuTier": "Azure.ResourceManager.CommonTypes.SkuTier", + "azure.mgmt.aigateway.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", + "azure.mgmt.aigateway.aio.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", + "azure.mgmt.aigateway.operations.AiGatewayResourcesOperations.get": "Microsoft.ApiManagement.AiGatewayResources.get", + "azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations.get": "Microsoft.ApiManagement.AiGatewayResources.get", + "azure.mgmt.aigateway.operations.AiGatewayResourcesOperations.begin_create_or_update": "Microsoft.ApiManagement.AiGatewayResources.createOrUpdate", + "azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations.begin_create_or_update": "Microsoft.ApiManagement.AiGatewayResources.createOrUpdate", + "azure.mgmt.aigateway.operations.AiGatewayResourcesOperations.begin_update": "Microsoft.ApiManagement.AiGatewayResources.update", + "azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations.begin_update": "Microsoft.ApiManagement.AiGatewayResources.update", + "azure.mgmt.aigateway.operations.AiGatewayResourcesOperations.begin_delete": "Microsoft.ApiManagement.AiGatewayResources.delete", + "azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations.begin_delete": "Microsoft.ApiManagement.AiGatewayResources.delete", + "azure.mgmt.aigateway.operations.AiGatewayResourcesOperations.list_by_resource_group": "Microsoft.ApiManagement.AiGatewayResources.listByResourceGroup", + "azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations.list_by_resource_group": "Microsoft.ApiManagement.AiGatewayResources.listByResourceGroup", + "azure.mgmt.aigateway.operations.AiGatewayResourcesOperations.list_by_subscription": "Microsoft.ApiManagement.AiGatewayResources.listBySubscription", + "azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations.list_by_subscription": "Microsoft.ApiManagement.AiGatewayResources.listBySubscription" + }, + "CrossLanguageVersion": "ff69301aef93" +} \ No newline at end of file diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/__init__.py new file mode 100644 index 000000000000..dd06b0a57dcf --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import AIGatewayMgmtClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AIGatewayMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_client.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_client.py new file mode 100644 index 000000000000..0e0362ca1cf2 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_client.py @@ -0,0 +1,145 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from ._configuration import AIGatewayMgmtClientConfiguration +from ._utils.serialization import Deserializer, Serializer +from .operations import AiGatewayResourcesOperations, Operations + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class AIGatewayMgmtClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """AIGatewayMgmtClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.aigateway.operations.Operations + :ivar ai_gateway_resources: AiGatewayResourcesOperations operations + :vartype ai_gateway_resources: azure.mgmt.aigateway.operations.AiGatewayResourcesOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = AIGatewayMgmtClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.ai_gateway_resources = AiGatewayResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_configuration.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_configuration.py new file mode 100644 index 000000000000..21d052d68f2b --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_configuration.py @@ -0,0 +1,82 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class AIGatewayMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for AIGatewayMgmtClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2026-09-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-aigateway/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_patch.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/model_base.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/model_base.py new file mode 100644 index 000000000000..35d5fc024978 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/model_base.py @@ -0,0 +1,1787 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on the mapping's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on the mapping's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: a set-like object providing a view on the mapping's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if the dictionary is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from the dictionary. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Update the dictionary from a mapping or an iterable of key-value pairs. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + dict_to_pass.update(self._init_from_xml(args[0])) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) + super().__init__(dict_to_pass) + + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) + wrapped_element = _create_xml_element( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _set_xml_attribute(wrapped_element, k, v, prop_meta) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/serialization.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/serialization.py new file mode 100644 index 000000000000..ae08f9d89f74 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/serialization.py @@ -0,0 +1,2179 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized |= target_obj.additional_properties + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(list[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/utils.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/utils.py new file mode 100644 index 000000000000..cbaa624660e4 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_utils/utils.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core import MatchConditions + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_version.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_version.py new file mode 100644 index 000000000000..be71c81bd282 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/__init__.py new file mode 100644 index 000000000000..9fa12d0a95ce --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import AIGatewayMgmtClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AIGatewayMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_client.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_client.py new file mode 100644 index 000000000000..6d2940ce4b88 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_client.py @@ -0,0 +1,149 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from .._utils.serialization import Deserializer, Serializer +from ._configuration import AIGatewayMgmtClientConfiguration +from .operations import AiGatewayResourcesOperations, Operations + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class AIGatewayMgmtClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """AIGatewayMgmtClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.aigateway.aio.operations.Operations + :ivar ai_gateway_resources: AiGatewayResourcesOperations operations + :vartype ai_gateway_resources: azure.mgmt.aigateway.aio.operations.AiGatewayResourcesOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = AIGatewayMgmtClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.ai_gateway_resources = AiGatewayResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_configuration.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_configuration.py new file mode 100644 index 000000000000..8d6e86a6ea66 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_configuration.py @@ -0,0 +1,82 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class AIGatewayMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for AIGatewayMgmtClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2026-09-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-aigateway/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_patch.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/__init__.py new file mode 100644 index 000000000000..1e2c4331ddb7 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AiGatewayResourcesOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "AiGatewayResourcesOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_operations.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_operations.py new file mode 100644 index 000000000000..0a376bfd0f4b --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_operations.py @@ -0,0 +1,1099 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import AsyncPipelineClient, MatchConditions +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceModifiedError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ...operations._operations import ( + build_ai_gateway_resources_create_or_update_request, + build_ai_gateway_resources_delete_request, + build_ai_gateway_resources_get_request, + build_ai_gateway_resources_list_by_resource_group_request, + build_ai_gateway_resources_list_by_subscription_request, + build_ai_gateway_resources_update_request, + build_operations_list_request, +) +from .._configuration import AIGatewayMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.aigateway.aio.AIGatewayMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIGatewayMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.aigateway.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AiGatewayResourcesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.aigateway.aio.AIGatewayMgmtClient`'s + :attr:`ai_gateway_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIGatewayMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, ai_gateway_name: str, **kwargs: Any) -> _models.AiGatewayResource: + """Get a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :return: AiGatewayResource. The AiGatewayResource is compatible with MutableMapping + :rtype: ~azure.mgmt.aigateway.models.AiGatewayResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AiGatewayResource] = kwargs.pop("cls", None) + + _request = build_ai_gateway_resources_get_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AiGatewayResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: Union[_models.AiGatewayResource, _types.AiGatewayResource, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_gateway_resources_create_or_update_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: _models.AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.aigateway.models.AiGatewayResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: _types.AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.aigateway.types.AiGatewayResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: Union[_models.AiGatewayResource, _types.AiGatewayResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Is either a AiGatewayResource type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.aigateway.models.AiGatewayResource or + ~azure.mgmt.aigateway.types.AiGatewayResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AiGatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AiGatewayResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AiGatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AiGatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: Union[_models.AiGatewayUpdateParameters, _types.AiGatewayUpdateParameters, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_gateway_resources_update_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: _models.AiGatewayUpdateParameters, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.aigateway.models.AiGatewayUpdateParameters + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: _types.AiGatewayUpdateParameters, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.aigateway.types.AiGatewayUpdateParameters + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: Union[_models.AiGatewayUpdateParameters, _types.AiGatewayUpdateParameters, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Is either a AiGatewayUpdateParameters + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.aigateway.models.AiGatewayUpdateParameters or + ~azure.mgmt.aigateway.types.AiGatewayUpdateParameters or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AiGatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + properties=properties, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AiGatewayResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AiGatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AiGatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + ai_gateway_name: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ai_gateway_resources_delete_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + ai_gateway_name: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.AiGatewayResource"]: + """List AiGatewayResource resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AiGatewayResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AiGatewayResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_gateway_resources_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AiGatewayResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.AiGatewayResource"]: + """List AiGatewayResource resources by subscription ID. + + :return: An iterator like instance of AiGatewayResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AiGatewayResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_gateway_resources_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AiGatewayResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_patch.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/__init__.py new file mode 100644 index 000000000000..8293fe58d11d --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/__init__.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AiGatewayBackend, + AiGatewayFrontend, + AiGatewayProperties, + AiGatewayResource, + AiGatewaySkuUpdate, + AiGatewaySubnet, + AiGatewayUpdateParameters, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ManagedServiceIdentity, + Operation, + OperationDisplay, + Resource, + Sku, + SystemData, + TrackedResource, + UserAssignedIdentity, +) + +from ._enums import ( # type: ignore + ActionType, + AiGatewayProvisioningState, + CreatedByType, + ManagedServiceIdentityType, + Origin, + SkuTier, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AiGatewayBackend", + "AiGatewayFrontend", + "AiGatewayProperties", + "AiGatewayResource", + "AiGatewaySkuUpdate", + "AiGatewaySubnet", + "AiGatewayUpdateParameters", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "ManagedServiceIdentity", + "Operation", + "OperationDisplay", + "Resource", + "Sku", + "SystemData", + "TrackedResource", + "UserAssignedIdentity", + "ActionType", + "AiGatewayProvisioningState", + "CreatedByType", + "ManagedServiceIdentityType", + "Origin", + "SkuTier", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_enums.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_enums.py new file mode 100644 index 000000000000..a97c3ba773e9 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_enums.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal + only APIs. + """ + + INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class AiGatewayProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of an AI Gateway resource.""" + + SUCCEEDED = "Succeeded" + """The resource is ready.""" + FAILED = "Failed" + """The resource operation failed.""" + CANCELED = "Canceled" + """The resource operation was canceled.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". + """ + + USER = "user" + """Indicates the operation is initiated by a user.""" + SYSTEM = "system" + """Indicates the operation is initiated by a system.""" + USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" + + +class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. + """ + + FREE = "Free" + """The Free service tier.""" + BASIC = "Basic" + """The Basic service tier.""" + STANDARD = "Standard" + """The Standard service tier.""" + PREMIUM = "Premium" + """The Premium service tier.""" diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_models.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_models.py new file mode 100644 index 000000000000..252c94f75fde --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_models.py @@ -0,0 +1,719 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class AiGatewayBackend(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Backend networking configuration of an AI Gateway. + + :ivar subnet: Subnet through which the AI Gateway reaches backends. + :vartype subnet: ~azure.mgmt.aigateway.models.AiGatewaySubnet + """ + + subnet: Optional["_models.AiGatewaySubnet"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Subnet through which the AI Gateway reaches backends.""" + + @overload + def __init__( + self, + *, + subnet: Optional["_models.AiGatewaySubnet"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AiGatewayFrontend(_Model): + """Frontend configuration of an AI Gateway. + + :ivar default_hostname: Default hostname used to invoke the AI Gateway. + :vartype default_hostname: str + """ + + default_hostname: Optional[str] = rest_field(name="defaultHostname", visibility=["read"]) + """Default hostname used to invoke the AI Gateway.""" + + +class AiGatewayProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of an AI Gateway. + + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.aigateway.models.AiGatewayProvisioningState + :ivar frontend: Frontend configuration of the AI Gateway. + :vartype frontend: ~azure.mgmt.aigateway.models.AiGatewayFrontend + :ivar backend: Backend networking configuration. Can only be set when the AI Gateway is + created. + :vartype backend: ~azure.mgmt.aigateway.models.AiGatewayBackend + """ + + provisioning_state: Optional[Union[str, "_models.AiGatewayProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + frontend: Optional["_models.AiGatewayFrontend"] = rest_field(visibility=["read"]) + """Frontend configuration of the AI Gateway.""" + backend: Optional["_models.AiGatewayBackend"] = rest_field(visibility=["read", "create"]) + """Backend networking configuration. Can only be set when the AI Gateway is created.""" + + @overload + def __init__( + self, + *, + backend: Optional["_models.AiGatewayBackend"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.aigateway.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.aigateway.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AiGatewayResource(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """An AI Gateway resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.aigateway.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. Required. + :vartype properties: ~azure.mgmt.aigateway.models.AiGatewayProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.aigateway.models.ManagedServiceIdentity + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: ~azure.mgmt.aigateway.models.Sku + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: "_models.AiGatewayProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource-specific properties for this resource. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU (Stock Keeping Unit) assigned to this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.AiGatewayProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + sku: Optional["_models.Sku"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AiGatewaySkuUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """SKU fields to update on an AI Gateway. + + :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. + :vartype name: str + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :vartype tier: str or ~azure.mgmt.aigateway.models.SkuTier + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the SKU. Ex - P3. It is typically a letter+number code.""" + tier: Optional[Union[str, "_models.SkuTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", + and \"Premium\".""" + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[Union[str, "_models.SkuTier"]] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AiGatewaySubnet(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Subnet used by an AI Gateway. + + :ivar id: Resource identifier of the subnet. The subnet must be delegated to + Microsoft.App/environments and be in the same region as the AI Gateway. Required. + :vartype id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource identifier of the subnet. The subnet must be delegated to Microsoft.App/environments + and be in the same region as the AI Gateway. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AiGatewayUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Parameters for updating an AI Gateway. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.aigateway.models.ManagedServiceIdentity + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: ~azure.mgmt.aigateway.models.AiGatewaySkuUpdate + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + sku: Optional["_models.AiGatewaySkuUpdate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU (Stock Keeping Unit) assigned to this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + sku: Optional["_models.AiGatewaySkuUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.aigateway.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.aigateway.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.aigateway.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.aigateway.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.aigateway.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.aigateway.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.aigateway.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.aigateway.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for an operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class Sku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The resource model definition representing SKU. + + :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. + :vartype name: str + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :vartype tier: str or ~azure.mgmt.aigateway.models.SkuTier + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the SKU. Ex - P3. It is typically a letter+number code. Required.""" + tier: Optional[Union[str, "_models.SkuTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", + and \"Premium\".""" + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + @overload + def __init__( + self, + *, + name: str, + tier: Optional[Union[str, "_models.SkuTier"]] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.aigateway.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.aigateway.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_patch.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/models/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/__init__.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/__init__.py new file mode 100644 index 000000000000..1e2c4331ddb7 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AiGatewayResourcesOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "AiGatewayResourcesOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_operations.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_operations.py new file mode 100644 index 000000000000..abd5f092deb1 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_operations.py @@ -0,0 +1,1302 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import MatchConditions, PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceModifiedError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models, types as _types +from .._configuration import AIGatewayMgmtClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._utils.utils import prep_if_match, prep_if_none_match + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.ApiManagement/operations" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_gateway_resources_get_request( + resource_group_name: str, ai_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/aigateways/{aiGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiGatewayName": _SERIALIZER.url("ai_gateway_name", ai_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_gateway_resources_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, ai_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/aigateways/{aiGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiGatewayName": _SERIALIZER.url("ai_gateway_name", ai_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_gateway_resources_update_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_gateway_name: str, + subscription_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/aigateways/{aiGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiGatewayName": _SERIALIZER.url("ai_gateway_name", ai_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_gateway_resources_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_gateway_name: str, + subscription_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/aigateways/{aiGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiGatewayName": _SERIALIZER.url("ai_gateway_name", ai_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_gateway_resources_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/aigateways" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_gateway_resources_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/aigateways" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.aigateway.AIGatewayMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIGatewayMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.aigateway.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AiGatewayResourcesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.aigateway.AIGatewayMgmtClient`'s + :attr:`ai_gateway_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIGatewayMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, ai_gateway_name: str, **kwargs: Any) -> _models.AiGatewayResource: + """Get a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :return: AiGatewayResource. The AiGatewayResource is compatible with MutableMapping + :rtype: ~azure.mgmt.aigateway.models.AiGatewayResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AiGatewayResource] = kwargs.pop("cls", None) + + _request = build_ai_gateway_resources_get_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AiGatewayResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: Union[_models.AiGatewayResource, _types.AiGatewayResource, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_gateway_resources_create_or_update_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: _models.AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.aigateway.models.AiGatewayResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: _types.AiGatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.aigateway.types.AiGatewayResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ai_gateway_name: str, + resource: Union[_models.AiGatewayResource, _types.AiGatewayResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Create a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param resource: Resource create parameters. Is either a AiGatewayResource type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.aigateway.models.AiGatewayResource or + ~azure.mgmt.aigateway.types.AiGatewayResource or IO[bytes] + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AiGatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AiGatewayResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AiGatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AiGatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: Union[_models.AiGatewayUpdateParameters, _types.AiGatewayUpdateParameters, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_gateway_resources_update_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: _models.AiGatewayUpdateParameters, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.aigateway.models.AiGatewayUpdateParameters + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: _types.AiGatewayUpdateParameters, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.aigateway.types.AiGatewayUpdateParameters + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + ai_gateway_name: str, + properties: Union[_models.AiGatewayUpdateParameters, _types.AiGatewayUpdateParameters, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[_models.AiGatewayResource]: + """Update a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :param properties: The resource properties to be updated. Is either a AiGatewayUpdateParameters + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.aigateway.models.AiGatewayUpdateParameters or + ~azure.mgmt.aigateway.types.AiGatewayUpdateParameters or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AiGatewayResource. The AiGatewayResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AiGatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + properties=properties, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AiGatewayResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AiGatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AiGatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + ai_gateway_name: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ai_gateway_resources_delete_request( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + ai_gateway_name: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a AiGatewayResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_gateway_name: The name of the AiGatewayResource. Required. + :type ai_gateway_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ai_gateway_name=ai_gateway_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.AiGatewayResource"]: + """List AiGatewayResource resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AiGatewayResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AiGatewayResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_gateway_resources_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AiGatewayResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.AiGatewayResource"]: + """List AiGatewayResource resources by subscription ID. + + :return: An iterator like instance of AiGatewayResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.aigateway.models.AiGatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AiGatewayResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_gateway_resources_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AiGatewayResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_patch.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/operations/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/py.typed b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/types.py b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/types.py new file mode 100644 index 000000000000..68a2667b3169 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/azure/mgmt/aigateway/types.py @@ -0,0 +1,341 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import AiGatewayProvisioningState, CreatedByType, ManagedServiceIdentityType, SkuTier + + +class AiGatewayBackend(TypedDict, total=False): + """Backend networking configuration of an AI Gateway. + + :ivar subnet: Subnet through which the AI Gateway reaches backends. + :vartype subnet: "AiGatewaySubnet" + """ + + subnet: "AiGatewaySubnet" + """Subnet through which the AI Gateway reaches backends.""" + + +class AiGatewayFrontend(TypedDict, total=False): + """Frontend configuration of an AI Gateway. + + :ivar defaultHostname: Default hostname used to invoke the AI Gateway. + :vartype defaultHostname: str + """ + + defaultHostname: str + """Default hostname used to invoke the AI Gateway.""" + + +class AiGatewayProperties(TypedDict, total=False): + """Properties of an AI Gateway. + + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioningState: Union[str, "AiGatewayProvisioningState"] + :ivar frontend: Frontend configuration of the AI Gateway. + :vartype frontend: "AiGatewayFrontend" + :ivar backend: Backend networking configuration. Can only be set when the AI Gateway is + created. + :vartype backend: "AiGatewayBackend" + """ + + provisioningState: Union[str, "AiGatewayProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + frontend: "AiGatewayFrontend" + """Frontend configuration of the AI Gateway.""" + backend: "AiGatewayBackend" + """Backend networking configuration. Can only be set when the AI Gateway is created.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class AiGatewayResource(TrackedResource): + """An AI Gateway resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. Required. + :vartype properties: "AiGatewayProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: "Sku" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: Required["AiGatewayProperties"] + """The resource-specific properties for this resource. Required.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + sku: "Sku" + """The SKU (Stock Keeping Unit) assigned to this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class AiGatewaySkuUpdate(TypedDict, total=False): + """SKU fields to update on an AI Gateway. + + :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. + :vartype name: str + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :vartype tier: Union[str, "SkuTier"] + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: str + """The name of the SKU. Ex - P3. It is typically a letter+number code.""" + tier: Union[str, "SkuTier"] + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", + and \"Premium\".""" + size: str + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: str + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: int + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + +class AiGatewaySubnet(TypedDict, total=False): + """Subnet used by an AI Gateway. + + :ivar id: Resource identifier of the subnet. The subnet must be delegated to + Microsoft.App/environments and be in the same region as the AI Gateway. Required. + :vartype id: str + """ + + id: Required[str] + """Resource identifier of the subnet. The subnet must be delegated to Microsoft.App/environments + and be in the same region as the AI Gateway. Required.""" + + +class AiGatewayUpdateParameters(TypedDict, total=False): + """Parameters for updating an AI Gateway. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: "AiGatewaySkuUpdate" + """ + + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + sku: "AiGatewaySkuUpdate" + """The SKU (Stock Keeping Unit) assigned to this resource.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class Sku(TypedDict, total=False): + """The resource model definition representing SKU. + + :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. + :vartype name: str + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :vartype tier: Union[str, "SkuTier"] + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: Required[str] + """The name of the SKU. Ex - P3. It is typically a letter+number code. Required.""" + tier: Union[str, "SkuTier"] + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", + and \"Premium\".""" + size: str + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: str + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: int + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" diff --git a/sdk/apimanagement/azure-mgmt-aigateway/dev_requirements.txt b/sdk/apimanagement/azure-mgmt-aigateway/dev_requirements.txt new file mode 100644 index 000000000000..ece056fe0984 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/dev_requirements.txt @@ -0,0 +1,5 @@ +-e ../../../eng/tools/azure-sdk-tools +../../core/azure-core +../../identity/azure-identity +../../core/azure-mgmt-core +aiohttp \ No newline at end of file diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_create.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_create.py new file mode 100644 index 000000000000..a800a3401d55 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_create.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.ai_gateway_resources.begin_create_or_update( + resource_group_name="example-rg", + ai_gateway_name="example-gateway", + resource={ + "identity": {"type": "SystemAssigned"}, + "location": "westus2", + "properties": { + "backend": { + "subnet": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/example-vnet/subnets/example-subnet" + } + } + }, + "sku": {"name": "AIGateway"}, + "tags": {"environment": "development"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-09-01-preview/AiGatewayCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_delete.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_delete.py new file mode 100644 index 000000000000..0485b2be6c30 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_delete.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.ai_gateway_resources.begin_delete( + resource_group_name="example-rg", + ai_gateway_name="example-gateway", + etag="*", + match_condition=~azure.core.MatchConditions, + ).result() + + +# x-ms-original-file: 2026-09-01-preview/AiGatewayDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_get.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_get.py new file mode 100644 index 000000000000..f0e117448a05 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.ai_gateway_resources.get( + resource_group_name="example-rg", + ai_gateway_name="example-gateway", + ) + print(response) + + +# x-ms-original-file: 2026-09-01-preview/AiGatewayGet.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_resource_group.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_resource_group.py new file mode 100644 index 000000000000..ba5ee3eb352b --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_resource_group.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.ai_gateway_resources.list_by_resource_group( + resource_group_name="example-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/AiGatewayListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_subscription.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_subscription.py new file mode 100644 index 000000000000..69a88c66d41a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_by_subscription.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.ai_gateway_resources.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/AiGatewayListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_operations.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_operations.py new file mode 100644 index 000000000000..56591a2401c2 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_list_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_list_operations.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/AIGatewayListOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_update.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_update.py new file mode 100644 index 000000000000..3a49d8107c3b --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_samples/ai_gateway_update.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.aigateway import AIGatewayMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-aigateway +# USAGE + python ai_gateway_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AIGatewayMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.ai_gateway_resources.begin_update( + resource_group_name="example-rg", + ai_gateway_name="example-gateway", + properties={"sku": {"name": "AIGateway"}, "tags": {"environment": "production"}}, + etag="*", + match_condition=~azure.core.MatchConditions, + ).result() + print(response) + + +# x-ms-original-file: 2026-09-01-preview/AiGatewayUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/conftest.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/conftest.py new file mode 100644 index 000000000000..b0b8af0c69f2 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + aigatewaymgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + aigatewaymgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + aigatewaymgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + aigatewaymgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aigatewaymgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aigatewaymgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aigatewaymgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aigatewaymgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations.py new file mode 100644 index 000000000000..b51baf9c3bb5 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.aigateway import AIGatewayMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIGatewayMgmtAiGatewayResourcesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AIGatewayMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ai_gateway_resources_get(self, resource_group): + response = self.client.ai_gateway_resources.get( + resource_group_name=resource_group.name, + ai_gateway_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ai_gateway_resources_begin_create_or_update(self, resource_group): + response = self.client.ai_gateway_resources.begin_create_or_update( + resource_group_name=resource_group.name, + ai_gateway_name="str", + resource={ + "location": "str", + "properties": { + "backend": {"subnet": {"id": "str"}}, + "frontend": {"defaultHostname": "str"}, + "provisioningState": "str", + }, + "eTag": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ai_gateway_resources_begin_update(self, resource_group): + response = self.client.ai_gateway_resources.begin_update( + resource_group_name=resource_group.name, + ai_gateway_name="str", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "sku": {"capacity": 0, "family": "str", "name": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + etag="str", + match_condition=~azure.core.MatchConditions, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ai_gateway_resources_begin_delete(self, resource_group): + response = self.client.ai_gateway_resources.begin_delete( + resource_group_name=resource_group.name, + ai_gateway_name="str", + etag="str", + match_condition=~azure.core.MatchConditions, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ai_gateway_resources_list_by_resource_group(self, resource_group): + response = self.client.ai_gateway_resources.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ai_gateway_resources_list_by_subscription(self, resource_group): + response = self.client.ai_gateway_resources.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations_async.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations_async.py new file mode 100644 index 000000000000..d4fbaceab7a8 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_ai_gateway_resources_operations_async.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.aigateway.aio import AIGatewayMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIGatewayMgmtAiGatewayResourcesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AIGatewayMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ai_gateway_resources_get(self, resource_group): + response = await self.client.ai_gateway_resources.get( + resource_group_name=resource_group.name, + ai_gateway_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ai_gateway_resources_begin_create_or_update(self, resource_group): + response = await ( + await self.client.ai_gateway_resources.begin_create_or_update( + resource_group_name=resource_group.name, + ai_gateway_name="str", + resource={ + "location": "str", + "properties": { + "backend": {"subnet": {"id": "str"}}, + "frontend": {"defaultHostname": "str"}, + "provisioningState": "str", + }, + "eTag": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ai_gateway_resources_begin_update(self, resource_group): + response = await ( + await self.client.ai_gateway_resources.begin_update( + resource_group_name=resource_group.name, + ai_gateway_name="str", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "sku": {"capacity": 0, "family": "str", "name": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + etag="str", + match_condition=~azure.core.MatchConditions, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ai_gateway_resources_begin_delete(self, resource_group): + response = await ( + await self.client.ai_gateway_resources.begin_delete( + resource_group_name=resource_group.name, + ai_gateway_name="str", + etag="str", + match_condition=~azure.core.MatchConditions, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ai_gateway_resources_list_by_resource_group(self, resource_group): + response = self.client.ai_gateway_resources.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ai_gateway_resources_list_by_subscription(self, resource_group): + response = self.client.ai_gateway_resources.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations.py new file mode 100644 index 000000000000..b0fc395fcb52 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.aigateway import AIGatewayMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIGatewayMgmtOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AIGatewayMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations_async.py b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations_async.py new file mode 100644 index 000000000000..413950de8e75 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/generated_tests/test_ai_gateway_mgmt_operations_async.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.aigateway.aio import AIGatewayMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIGatewayMgmtOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AIGatewayMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/apimanagement/azure-mgmt-aigateway/pyproject.toml b/sdk/apimanagement/azure-mgmt-aigateway/pyproject.toml new file mode 100644 index 000000000000..911f94d0894e --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/pyproject.toml @@ -0,0 +1,86 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-aigateway" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Aigateway Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.aigateway._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + +[tool.azure-sdk-build] +breaking = false +pyright = false +mypy = false + +[packaging] +package_name = "azure-mgmt-aigateway" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Aigateway Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "AIGatewayMgmtClient" diff --git a/sdk/apimanagement/azure-mgmt-aigateway/tsp-location.yaml b/sdk/apimanagement/azure-mgmt-aigateway/tsp-location.yaml new file mode 100644 index 000000000000..447a2d5f26dd --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-aigateway/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/apimanagement/resource-manager/Microsoft.ApiManagement/AIGateway +commit: ac7c51b32205afe231bdb539db0c3550172ea639 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/apimanagement/ci.yml b/sdk/apimanagement/ci.yml index d9c3a235e891..132425210250 100644 --- a/sdk/apimanagement/ci.yml +++ b/sdk/apimanagement/ci.yml @@ -30,3 +30,5 @@ extends: Artifacts: - name: azure-mgmt-apimanagement safeName: azuremgmtapimanagement + - name: azure-mgmt-aigateway + safeName: azuremgmtaigateway \ No newline at end of file From 508b925acb9ed496e36c37ad6d97949af170dc86 Mon Sep 17 00:00:00 2001 From: Salma El-Shafey <76866105+salma-elshafey@users.noreply.github.com> Date: Thu, 22 Oct 2026 09:31:07 +0300 Subject: [PATCH 18/35] Add shared Decision model support for Foundry evaluators (#49486) * add support for evaluation with decision models v0 * ignore noul word * run black * Add bounded Decision execution policy and retained request receipts Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Retain native Decision status metadata only after validation Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Preserve Decision failure metadata in batch evaluation rows Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Translate explicit read timeouts for the default async requests transport Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Simplify Decision execution controls and map measured usage into standard rows Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Parse shared Decision responses and count composite failure usage once Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Avoid serializing uncapped Decision state question pairs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Recognize asset quality composites in evaluation metadata Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Remove obsolete Decision execution policy guard Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Carry overall Decision deadline into native transport Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Default Decision evaluations to a 120-second overall timeout Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Enforce secure Decision endpoints and close owned credentials Validate Decision endpoint URLs before authentication and transport, allowing HTTP only for genuine loopback endpoints. Close default-provider owned credentials and environment resources across success, failure and cancellation while preserving caller ownership. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Make credential cancellation tests portable to Python 3.10 Assert cancellation by exception type without depending on asyncio.run preserving its message. Retain RuntimeError messages and all credential and environment cleanup assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Address Decision evaluator review feedback Require explicit caller-owned authentication, validate probability sums, stop cancellable response reads, and preserve result accounting and metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Describe unreleased Decision support as feature capabilities Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Include verified Decision deployment error code Expose only the verified DeploymentNotFound code while retaining generic errors for all other provider content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Add Decision execution telemetry and preserve failure diagnostics Bind context-aware execution logging and optional metrics, preserve validated shared and independent execution metadata, and accept precision-aware probability rounding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Simplify Decision execution and surface provider error codes Consolidate execution tracking into the model runner and expose bounded provider error codes without response messages or details. Simplify test setup while preserving coverage and recognize genuine localhost connection timeouts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Fix Decision serialization test under INFO logging Assert only evidence-bearing request serializations so execution telemetry does not affect the request-count invariant. Enable INFO logging explicitly to cover the CI failure mode. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Preserve Prompty usage on post-inference skips Use existing result formatting to retain measured usage, model metadata, and response properties for skipped model responses while leaving pre-inference skips unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e * Preserve Decision error accounting across turns and numeric failures * fix(evaluation): reconcile decision usage and reject numeric overflow Align split-conversation properties with measured aggregate usage and common model attribution without changing final-turn diagnostics or per-turn provenance. Reuse the existing failure accounting contract. Return typed user errors for oversized numeric execution settings and omit malformed probability metadata without aborting batch summaries. Cover public conversion, skips, mixed models, configuration and failures. * fix(evaluation): preserve native results and cancellation metadata Retain known turn usage when an asyncio task is cancelled while propagating the original cancellation. Reject unsafe retained native answer diagnostics without dropping measured usage. Keep initialization failures primary during cleanup. Distinguish explicit zero grades from absent or invalid ranged grades. * Validate complete text scores in explicit ranges * Handle oversized integer scores as validation errors * Make cancellation assertions compatible with Python 3.10 --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ahmad Qardahji Co-authored-by: amah Co-authored-by: bonanza89 Copilot-Session: e564c5c8-480e-48e7-a9e0-44450f774b5e --- .../azure-ai-evaluation/CHANGELOG.md | 27 + .../azure/ai/evaluation/_constants.py | 19 + .../_batch_run/_run_submitter_client.py | 56 +- .../ai/evaluation/_evaluate/_evaluate.py | 28 + .../_evaluators/_common/__init__.py | 11 + .../_evaluators/_common/_base_eval.py | 14 +- .../_evaluators/_common/_base_model_eval.py | 506 ++++ .../_evaluators/_common/_base_prompty_eval.py | 344 +-- .../_evaluators/_common/_decision_strategy.py | 248 ++ .../_evaluators/_common/_model_runners.py | 778 +++++++ .../_evaluators/_common/_prompty_strategy.py | 165 ++ .../azure/ai/evaluation/_exceptions.py | 6 +- .../_legacy/_common/_async_token_provider.py | 32 +- .../unittests/test_async_token_provider.py | 299 +++ .../test_decision_batch_persistence.py | 664 ++++++ .../test_decision_conversation_failure.py | 338 +++ .../test_decision_default_transport.py | 481 ++++ .../unittests/test_decision_model_support.py | 2041 +++++++++++++++++ .../tests/unittests/test_prompty_strategy.py | 373 +++ sdk/evaluation/cspell.yaml | 3 + 20 files changed, 6098 insertions(+), 335 deletions(-) create mode 100644 sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_model_eval.py create mode 100644 sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_decision_strategy.py create mode 100644 sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_model_runners.py create mode 100644 sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_prompty_strategy.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/test_async_token_provider.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_batch_persistence.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_conversation_failure.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_default_transport.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_model_support.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/test_prompty_strategy.py diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index f4c288cdbded..db64a8f93f67 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -2,10 +2,37 @@ ## 1.18.10 (Unreleased) +### Features Added + +- Added shared model runners and evaluation strategies for asset evaluators using Decision models in Microsoft Foundry, including Output Quality and Tool Use Quality aggregate and member metrics. +- Decision authentication uses an explicit `api_key` or caller-owned credential with a callable `get_token`. Reuse a synchronous `azure.identity.DefaultAzureCredential` for synchronous or batch calls and close it afterward; async credentials require the same caller-managed event loop. API keys take precedence; Prompty authentication is unchanged. +- Decision score probabilities use precision-aware sum validation: hundredth-precision values allow `0.005` rounding error per level plus `1e-12`; other values use an absolute `0.001` tolerance. Invalid distributions raise a system-classified `EvaluationException`; probabilities are not normalized. +- Decision results expose known final-response usage, model, and provenance on completed, skipped, and failed evaluations, counting shared requests once and summing split-turn usage. Usage excludes earlier retry attempts. +- Decision requests provide context-aware per-attempt and terminal execution observations with optional OpenTelemetry metrics. Validated shared and independent execution summaries and their distinct usage scopes are preserved in failed-row metadata. +- Decision HTTP errors include the provider's nested `error.code` when it starts with an ASCII letter and contains only letters, digits, dots, underscores, or hyphens, up to 128 characters. This is provider-controlled diagnostic text, not a guarantee that the code is free of sensitive data. Messages, details, and raw response bodies are not exposed. +- Decision native async HTTP supports overall deadlines and cancellation during response body reads. TLS uses Python/OpenSSL trust settings such as `SSL_CERT_FILE`, not `REQUESTS_CA_BUNDLE`; shared Prompty transport behavior is unchanged. + +### Breaking Changes + ### Bugs Fixed +- Retained known earlier-turn Decision usage and model metadata when an asynchronous split evaluation is cancelled directly, while preserving `CancelledError` and existing callback cancellation behavior. +- Rejected non-JSON-safe native answer provenance with typed errors that retain known usage, without validating unused scores on applicability skips. +- Accepted explicit numeric zero in zero-inclusive shared Prompty score ranges while keeping missing, invalid and boolean grades on the typed error path. Missing-score fallbacks cannot manufacture a ranged grade. +- Validated complete signed, decimal, and exponent scores in shared Prompty text fallbacks with explicit score ranges, preventing out-of-range values from becoming passing scores through single-digit parsing. +- Classified oversized integer scores in explicit Prompty score ranges as invalid scores, preserving the configured error target in strict and legacy parsing. +- Preserved the primary initialization error or cancellation when legacy token-provider cleanup also fails. +- Preserved known Decision usage when a later split conversation turn fails, without assigning mixed-model usage to one model or treating the failed turn's execution summary as a conversation summary. +- Reconciled successful split-conversation properties with aggregate Decision usage and common model identity, omitting single-request execution summaries while preserving final-turn diagnostics and original per-turn data. +- Kept numeric-overflow validation failures on the typed Decision error path so known usage and provenance survive failed-row conversion. +- Classified oversized numeric execution settings as user configuration errors and safely omitted invalid probability metadata without interrupting batch error and usage summaries. +- Preserved measured token usage, model metadata, and response properties when the shared Prompty strategy parses a post-inference skipped result. Pre-inference skips still make no model request. - Hardened local Prompty image resolution so only relative files within the Prompty directory are inlined, with opened-file validation to prevent path changes from redirecting reads and without exposing the local directory in fallback logs. +### Other Changes + +- Decision-only execution controls supplied to a chat evaluator are rejected explicitly; they do not configure chat timeout, retry or cancellation behavior. + ## 1.18.9 (2026-10-12) ### Bugs Fixed diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py index 3a379c29c8d7..b551805ee23b 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py @@ -136,6 +136,23 @@ class _EvaluatorMetricMapping: "tool_call_success": ["tool_call_success"], "tool_selection": ["tool_selection"], "tool_output_utilization": ["tool_output_utilization"], + "output_quality": [ + "output_quality", + "fluency", + "coherence", + "intent_resolution", + "task_adherence", + "groundedness", + "task_completion", + ], + "tool_use_quality": [ + "tool_use_quality", + "tool_call_accuracy", + "tool_call_success", + "tool_input_accuracy", + "tool_output_utilization", + "tool_selection", + ], "task_navigation_efficiency": ["task_navigation_efficiency"], "text_similarity": ["similarity"], "string_check": ["string_check"], @@ -161,6 +178,7 @@ class _EvaluatorMetricMapping: "IndirectAttackEvaluator": "indirect_attack", "IntentResolutionEvaluator": "intent_resolution", "MeteorScoreEvaluator": "meteor_score", + "OutputQualityEvaluator": "output_quality", "ProtectedMaterialEvaluator": "protected_material", "QAEvaluator": "qa", "RelevanceEvaluator": "relevance", @@ -173,6 +191,7 @@ class _EvaluatorMetricMapping: "TaskAdherenceEvaluator": "task_adherence", "TaskCompletionEvaluator": "task_completion", "ToolCallAccuracyEvaluator": "tool_call_accuracy", + "ToolUseQualityEvaluator": "tool_use_quality", "UngroundedAttributesEvaluator": "ungrounded_attributes", "ViolenceEvaluator": "violence", } diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py index 6ec1a67568b6..debf679e61db 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py @@ -21,6 +21,8 @@ from ..._legacy._common._thread_pool_executor_with_context import ThreadPoolExecutorWithContext from ..._evaluate._utils import _has_aggregator from ..._constants import Prefixes, PF_BATCH_TIMEOUT_SEC +from ..._exceptions import EvaluationException +from ..._evaluators._common._model_runners import _is_finite_number, validated_execution from .._utils import get_int_env_var as get_int @@ -28,6 +30,45 @@ MISSING_VALUE: Final[int] = sys.maxsize +def _decision_error_metadata(exception: EvaluationException) -> Dict[str, Any]: + """Keep known usage and validated provenance, preserving the producer's distinct usage scopes.""" + properties: Dict[str, Any] = {} + semantic_properties = exception.properties or {} + for key in ("prompt_tokens", "completion_tokens", "total_tokens"): + value = semantic_properties.get(key) + if isinstance(value, int) and not isinstance(value, bool) and value >= 0: + properties[key] = value + model = semantic_properties.get("model") + if isinstance(model, str) and model.strip(): + properties["model"] = model + native = semantic_properties.get("decision_model") + if isinstance(native, dict): + provenance = { + key: native[key] + for key in ("deployment", "model", "rubric_hash", "status_rubric_hash", "reason_type") + if isinstance(native.get(key), str) + } + for key in ("status_completion_probability", "status_probability_threshold"): + value = native.get(key) + if _is_finite_number(value) and 0 <= value <= 1: + provenance[key] = value + for key, accepted in ( + ("backend", ("foundry_decision", "system_one")), + ("protocol", ("shared_sdk", "system_one")), + ("result_usage_scope", ("reported_attempts_only", "final_response_only", "reported_turns_only")), + ): + value = native.get(key) + if isinstance(value, str) and value in accepted: + provenance[key] = value + if isinstance(native.get("usage_available"), bool): + provenance["usage_available"] = native["usage_available"] + execution = validated_execution(native.get("execution")) + if execution is not None: + provenance["execution"] = execution + properties["decision_model"] = provenance + return {"code": exception.category.value, "blame": exception.blame.value, "properties": properties} + + class RunSubmitterClient: def __init__(self, *, raise_on_errors: bool = False, config: Optional[BatchEngineConfig] = None) -> None: if config: @@ -154,12 +195,20 @@ def get_run_summary(self, client_run: BatchClientRun) -> Dict[str, Any]: # Collect per-line error messages for failed lines per_line_errors: Dict[int, str] = {} + per_line_error_metadata: Dict[int, Dict[str, Any]] = {} if run.result and run.result.details: for detail in run.result.details: if detail.error and detail.error.exception: per_line_errors[detail.index] = str(detail.error.exception) - - return { + exception = detail.error.exception + if ( + isinstance(exception, EvaluationException) + and isinstance(exception.properties, dict) + and isinstance(exception.properties.get("decision_model"), dict) + ): + per_line_error_metadata[detail.index] = _decision_error_metadata(exception) + + summary = { "status": run.status.value, "duration": str(run.duration), "completed_lines": total_lines - failed_lines, @@ -177,6 +226,9 @@ def get_run_summary(self, client_run: BatchClientRun) -> Dict[str, Any]: else None ), } + if per_line_error_metadata: + summary["per_line_error_metadata"] = per_line_error_metadata + return summary @staticmethod def _get_run(run: BatchClientRun) -> Run: diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate.py index 70e9bcccd701..d432380653e9 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate.py @@ -3301,6 +3301,8 @@ def _add_error_summaries( for criteria that failed during evaluation, ensuring proper error reporting. When per-line errors are available, only the error for the current row is used; rows that succeeded are not stamped with another row's error. + Decision-only per-line metadata preserves known usage/provenance in ``properties`` and the + existing ``sample`` schema, without treating failed attempts as completed scoring results. :param run_output_results: List to append error result objects to :type run_output_results: List[Dict[str, Any]] @@ -3357,6 +3359,7 @@ def _add_error_summaries( # Use per-line error if available, otherwise fall back to batch-level error per_line_errors = criteria_summary.get("per_line_errors", {}) per_line_error_msg = per_line_errors.get(row_idx, None) + decision_error_metadata = criteria_summary.get("per_line_error_metadata", {}).get(row_idx) if per_line_error_msg is not None: # This row has a specific error @@ -3364,6 +3367,9 @@ def _add_error_summaries( "code": criteria_summary.get("error_code"), "message": per_line_error_msg, } + if decision_error_metadata is not None: + error_info["code"] = decision_error_metadata["code"] + error_info["blame"] = decision_error_metadata["blame"] elif per_line_errors: # Per-line errors exist but not for this row — this row succeeded, skip error stamping continue @@ -3378,6 +3384,12 @@ def _add_error_summaries( metrics = testing_criteria_metadata.get(criteria_name, {}).get("metrics", []) criteria_type = testing_criteria_metadata.get(criteria_name, {}).get("type", "azure_ai_evaluator") + if decision_error_metadata is not None: + evaluator_name = testing_criteria_metadata.get(criteria_name, {}).get("evaluator_name") + if isinstance(evaluator_name, str): + primary_metric = evaluator_name.removeprefix("builtin.") + metrics = sorted(metrics, key=lambda metric: metric != primary_metric) + decision_usage_added = False for metric in metrics: if not _should_add_error_summary(run_output_results, criteria_name, metric): @@ -3395,6 +3407,22 @@ def _add_error_summaries( "status": "error", "sample": sample, } + if decision_error_metadata is not None: + properties = decision_error_metadata["properties"] + error_result["properties"] = properties + # One failed evaluator invocation may produce several metric errors, but only one billed usage. + error_result["sample"] = {"error": error_info} + usage = { + key: properties[key] + for key in ("prompt_tokens", "completion_tokens", "total_tokens") + if key in properties + } + if not decision_usage_added: + if usage: + error_result["sample"]["usage"] = usage + if "model" in properties: + error_result["sample"]["model"] = properties["model"] + decision_usage_added = True run_output_results.append(error_result) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/__init__.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/__init__.py index 2b5182f09d18..ed5605e44e22 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/__init__.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/__init__.py @@ -3,15 +3,26 @@ # --------------------------------------------------------- from ._base_eval import EvaluatorBase +from ._base_model_eval import ModelEvaluatorBase from ._base_prompty_eval import PromptyEvaluatorBase from ._base_rai_svc_eval import RaiServiceEvaluatorBase from ._base_multi_eval import MultiEvaluatorBase from ._conversation_input import hoist_messages_to_conversation +from ._model_runners import DecisionModelRunner, PromptyModelRunner +from ._decision_strategy import BinaryScoring, DecisionEvaluationStrategy, LikertScoring +from ._prompty_strategy import PromptyEvaluationStrategy __all__ = [ "EvaluatorBase", + "ModelEvaluatorBase", "PromptyEvaluatorBase", "RaiServiceEvaluatorBase", "MultiEvaluatorBase", "hoist_messages_to_conversation", + "DecisionModelRunner", + "PromptyModelRunner", + "DecisionEvaluationStrategy", + "PromptyEvaluationStrategy", + "BinaryScoring", + "LikertScoring", ] diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py index df46ac6424bd..db3feaa8613d 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +import asyncio import inspect import logging from abc import ABC, abstractmethod @@ -609,6 +610,13 @@ def _extract_tool_names_and_params_from_response(self, response) -> List[Tuple[s return tool_name_param_pairs + def _on_evaluation_error( + self, + error: Union[EvaluationException, asyncio.CancelledError], + per_turn_results: List[DoEvalResult[T_EvalValue]], + ) -> None: + """Allow a model-backed evaluator to retain completed-turn metadata on a later failure.""" + async def _real_call(self, **kwargs) -> Union[DoEvalResult[T_EvalValue], AggregateResult[T_EvalValue]]: """The asynchronous call where real end-to-end evaluation logic is performed. @@ -626,7 +634,11 @@ async def _real_call(self, **kwargs) -> Union[DoEvalResult[T_EvalValue], Aggrega per_turn_results = [] # Evaluate all inputs. for eval_input in eval_input_list: - result = await self._do_eval(eval_input) + try: + result = await self._do_eval(eval_input) + except (EvaluationException, asyncio.CancelledError) as error: + self._on_evaluation_error(error, per_turn_results) + raise # logic to determine threshold pass/fail # if it wasn't computed in _do_eval try: diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_model_eval.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_model_eval.py new file mode 100644 index 000000000000..76730b2ee8b0 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_model_eval.py @@ -0,0 +1,506 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +import asyncio +import math +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union + +from azure.core.credentials import TokenCredential +from azure.ai.evaluation._constants import EVALUATION_PASS_FAIL_MAPPING +from azure.ai.evaluation._exceptions import EvaluationException, ErrorBlame, ErrorCategory, ErrorTarget +from . import EvaluatorBase +from ._model_runners import ( + DecisionModelRunner, + PromptyModelRunner, + _is_finite_number, + is_decision_model_config, +) + +T = TypeVar("T") + + +def not_applicable_result(result_key: str, reason: str, threshold: float) -> Dict[str, Any]: + return { + result_key: None, + f"{result_key}_score": None, + f"{result_key}_passed": None, + f"{result_key}_result": "not_applicable", + f"{result_key}_reason": f"Not applicable: {reason}", + f"{result_key}_status": "skipped", + f"{result_key}_threshold": threshold, + f"{result_key}_properties": None, + } + + +class ModelEvaluatorBase(EvaluatorBase[T]): + """Base class for evaluators whose judgement comes from a model. + + The base selects one model runner at construction from ``model_config`` and holds the helpers shared by + model-backed evaluators. A configuration tagged ``type="decision"`` selects a decision model runner, which + only evaluators that set ``_supports_decision_models`` accept; any other configuration selects the Prompty + runner and exposes its flow as ``_flow``. Interpreting a model's answer remains the evaluator's job. + + Decision requires an explicit API key or a credential with a callable ``get_token``. For Entra authentication, + pass and reuse a synchronous ``azure.identity.DefaultAzureCredential`` as ``credential=`` for synchronous + and batch calls, closing it after all evaluations complete. Async credentials require the same caller-managed + event loop for all uses. The SDK never closes caller credentials. Prompty authentication is unchanged. + + :param result_key: The key to use for the result of the evaluation. + :type result_key: str + :param prompty_file: The prompt path, required only for a Prompty runner. + :type prompty_file: Optional[str] + :param model_config: The model configuration to use for evaluation. + :type model_config: dict + :keyword is_reasoning_model: This parameter is in preview. If True, updates the config parameters in prompty + file based on reasoning models. Defaults to False. + :type is_reasoning_model: bool + :keyword timeout: Optional overall Decision time limit, including authentication and retries. Defaults to + 120 seconds for Decision; an explicit value retains the existing evaluator timeout cap. + The remaining budget also limits native transport connect/read timeouts. Awaiting is cancelled at the + deadline and the native async transport stops response body reads. Synchronous credential calls cannot be + forcibly interrupted and may delay synchronous return. + :paramtype timeout: Optional[float] + :keyword timeout_seconds: Optional Decision connect/read timeout. + :paramtype timeout_seconds: Optional[float] + :keyword max_retries: Optional Decision retry limit, defaults to 3. + :paramtype max_retries: Optional[int] + :keyword cancellation_requested: Optional Decision cancellation callback, polled during authentication, + requests and retry waits. Cancelling stops awaiting synchronous credential calls, not their worker threads. + :paramtype cancellation_requested: Optional[Callable[[], bool]] + :keyword max_request_bytes: Optional limit on the compact UTF-8 serialized Decision request. + :paramtype max_request_bytes: Optional[int] + :keyword max_state_question_bytes: Optional limit on the largest individual state/question pair. + :paramtype max_state_question_bytes: Optional[int] + :keyword max_response_bytes: Optional response acceptance limit before JSON parsing, not a streaming bound. + :paramtype max_response_bytes: Optional[int] + """ + + _LLM_CALL_TIMEOUT = 600 + _DEFAULT_OPEN_API_VERSION = "2024-02-15-preview" + + _supports_decision_models = False + """Whether this evaluator can be configured with a decision model.""" + _binary_decision = False + """Whether decision answers become a binary score, which permits ``probability_threshold``.""" + + def __init__( + self, + *, + result_key: str, + prompty_file: Optional[str] = None, + model_config: dict, + eval_last_turn: bool = False, + threshold: int = 3, + credential: Optional[TokenCredential] = None, + timeout: Optional[float] = None, + timeout_seconds: Optional[float] = None, + max_retries: Optional[int] = None, + cancellation_requested: Optional[Callable[[], bool]] = None, + max_request_bytes: Optional[int] = None, + max_state_question_bytes: Optional[int] = None, + max_response_bytes: Optional[int] = None, + _higher_is_better: bool = False, + **kwargs, + ) -> None: + self._result_key = result_key + self._is_reasoning_model = kwargs.get("is_reasoning_model", False) + self._prompty_file = prompty_file + self._threshold = threshold + self._higher_is_better = _higher_is_better + super().__init__(eval_last_turn=eval_last_turn, threshold=threshold, _higher_is_better=_higher_is_better) + + subclass_name = self.__class__.__name__ + execution_options: Dict[str, Any] = { + "timeout_seconds": timeout_seconds, + "max_retries": max_retries, + "cancellation_requested": cancellation_requested, + "max_request_bytes": max_request_bytes, + "max_state_question_bytes": max_state_question_bytes, + "max_response_bytes": max_response_bytes, + } + if is_decision_model_config(model_config): + if not self._supports_decision_models: + raise EvaluationException( + message=f"{subclass_name} does not support decision models.", + internal_message=f"{subclass_name} does not support decision models.", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=ErrorTarget.EVALUATE, + ) + if timeout is not None: + if not _is_finite_number(timeout) or timeout <= 0: + raise EvaluationException( + message="'timeout' must be a positive finite number.", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=ErrorTarget.EVALUATE, + ) + self._LLM_CALL_TIMEOUT = min(self._LLM_CALL_TIMEOUT, timeout) + else: + self._LLM_CALL_TIMEOUT = min(self._LLM_CALL_TIMEOUT, 120) + self._model_runner: Union[DecisionModelRunner, PromptyModelRunner] = DecisionModelRunner( + model_config, + credential, + binary=self._binary_decision, + evaluator_name=subclass_name, + **{name: value for name, value in execution_options.items() if value is not None}, + ) + else: + if timeout is not None or any(value is not None for value in execution_options.values()): + raise EvaluationException( + message="Decision execution controls are only supported by decision model evaluators.", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=ErrorTarget.EVALUATE, + ) + if not prompty_file: + raise EvaluationException( + message="A prompty_file is required for a chat model evaluator.", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.MISSING_FIELD, + target=ErrorTarget.EVALUATE, + ) + self._model_runner = PromptyModelRunner( + model_config=model_config, + prompty_file=prompty_file, + credential=credential, + is_reasoning_model=self._is_reasoning_model, + evaluator_name=subclass_name, + api_version=self._DEFAULT_OPEN_API_VERSION, + ) + + @property + def _prompty_model_runner(self) -> PromptyModelRunner: + runner = self._model_runner + if not isinstance(runner, PromptyModelRunner): + raise RuntimeError("This evaluator is not configured with a Prompty model.") + return runner + + @property + def _flow(self) -> Any: + runner = self._model_runner + if not isinstance(runner, PromptyModelRunner): + raise AttributeError("A decision model evaluator does not have a Prompty flow.") + return runner.flow + + @_flow.setter + def _flow(self, flow: Any) -> None: + self._prompty_model_runner.flow = flow + + @property + def _uses_decision_model(self) -> bool: + return isinstance(self._model_runner, DecisionModelRunner) + + @property + def _decision_model_runner(self) -> DecisionModelRunner: + runner = self._model_runner + if not isinstance(runner, DecisionModelRunner): + raise RuntimeError("This evaluator is not configured with a decision model.") + return runner + + def _aggregate_results(self, per_turn_results: List[Dict[str, T]]) -> Dict[str, Any]: + """Aggregate scores normally, but sum independently known Decision usage across turns. + + A single shared model is promoted for attribution. Mixed or missing model identities remain per-turn + rather than attributing all usage to the last model. Root properties use the same usage and model, + without a single-request execution summary; other diagnostics retain their final-turn semantics. + Prompty aggregation is unchanged. + """ + aggregated: Dict[str, Any] = super()._aggregate_results(per_turn_results) + if not self._uses_decision_model: + return aggregated + metrics = {metric for turn in per_turn_results for metric in turn} + for metric in metrics: + if metric.endswith(("_prompt_tokens", "_completion_tokens", "_total_tokens")): + values = (turn.get(metric) for turn in per_turn_results) + known = [ + value for value in values if isinstance(value, int) and not isinstance(value, bool) and value >= 0 + ] + if known: + aggregated[metric] = sum(known) + else: + aggregated.pop(metric, None) + elif metric.endswith("_model"): + models = [turn.get(metric) for turn in per_turn_results] + if ( + models + and isinstance(models[0], str) + and models[0].strip() + and all(model == models[0] for model in models) + ): + aggregated[metric] = models[0] + else: + aggregated.pop(metric, None) + properties_key = f"{self._result_key}_properties" + properties = aggregated.get(properties_key) + if len(per_turn_results) > 1 and isinstance(properties, dict): + usage = self._known_turn_usage( + aggregated, ("prompt_tokens", "completion_tokens", "total_tokens"), prefix=f"{self._result_key}_" + ) + aggregated[properties_key] = self._reconcile_decision_properties( + properties, usage, aggregated.get(f"{self._result_key}_model") + ) + return aggregated + + def _on_evaluation_error( + self, error: Union[EvaluationException, asyncio.CancelledError], per_turn_results: List[Dict[str, T]] + ) -> None: + """Preserve known Decision turn usage without changing the failure or Prompty behavior. + + Only the request-owning result's usage is accumulated. A failed turn's execution summary cannot + describe all these turns, so it is omitted and the wider usage scope is explicit. + """ + if not self._uses_decision_model or not per_turn_results: + return + fields = ("prompt_tokens", "completion_tokens", "total_tokens") + contributions = [] + for result in per_turn_results: + usage = self._known_turn_usage(result, fields, prefix=f"{self._result_key}_") + if usage: + contributions.append((usage, result.get(f"{self._result_key}_model"))) + if not contributions: + return + error_properties = getattr(error, "properties", None) + properties = dict(error_properties) if isinstance(error_properties, dict) else {} + failing_usage = self._known_turn_usage(properties, fields) + if failing_usage: + contributions.append((failing_usage, properties.get("model"))) + usage = {} + for field in fields: + known = [item[field] for item, _ in contributions if field in item] + if known: + usage[field] = sum(known) + models = [model for _, model in contributions] + common_model = models[0] if isinstance(models[0], str) and models[0].strip() else None + if not all(model == common_model for model in models): + common_model = None + setattr(error, "properties", self._reconcile_decision_properties(properties, usage, common_model)) + + @staticmethod + def _reconcile_decision_properties( + properties: Dict[str, Any], usage: Dict[str, int], model: Optional[str] + ) -> Dict[str, Any]: + reconciled = dict(properties) + for field in ("prompt_tokens", "completion_tokens", "total_tokens"): + if field in usage: + reconciled[field] = usage[field] + else: + reconciled.pop(field, None) + if isinstance(model, str) and model.strip(): + reconciled["model"] = model + else: + reconciled.pop("model", None) + native = reconciled.get("decision_model") + native = dict(native) if isinstance(native, dict) else {} + native.pop("execution", None) + if "model" in reconciled: + native["model"] = reconciled["model"] + else: + native.pop("model", None) + native["usage_available"] = bool(usage) + native["result_usage_scope"] = "reported_turns_only" + reconciled["decision_model"] = native + return reconciled + + @staticmethod + def _known_turn_usage(values: Dict[str, Any], fields: tuple, *, prefix: str = "") -> Dict[str, int]: + """Keep each known count independently; missing totals are not inferred from partial counts.""" + return { + field: values[prefix + field] + for field in fields + if isinstance(values.get(prefix + field), int) + and not isinstance(values[prefix + field], bool) + and values[prefix + field] >= 0 + } + + def _get_binary_result(self, score: float) -> str: + """Get the binary result based on the score. + + :param score: The score to evaluate. + :type score: float + :return: The binary result. + :rtype: str + """ + if math.isnan(score): + return "unknown" + if self._higher_is_better: + if score >= self._threshold: + return EVALUATION_PASS_FAIL_MAPPING[True] + else: + return EVALUATION_PASS_FAIL_MAPPING[False] + else: + if score <= self._threshold: + return EVALUATION_PASS_FAIL_MAPPING[True] + else: + return EVALUATION_PASS_FAIL_MAPPING[False] + + @staticmethod + def _get_token_metadata(prompty_output: Dict) -> Dict: + """Extract token usage and model metadata from the prompty output dict. + + :param prompty_output: The raw output dictionary from the prompty flow. + :type prompty_output: Dict + :return: A dictionary with token counts, finish reason, model, and sample I/O. + :rtype: Dict + """ + return { + "prompt_tokens": prompty_output.get("input_token_count", 0), + "completion_tokens": prompty_output.get("output_token_count", 0), + "total_tokens": prompty_output.get("total_token_count", 0), + "finish_reason": prompty_output.get("finish_reason", ""), + "model": prompty_output.get("model_id", ""), + "sample_input": prompty_output.get("sample_input", ""), + "sample_output": prompty_output.get("sample_output", ""), + } + + @staticmethod + def _get_built_in_tool_definition(tool_name: str): + """Get the definition for the built-in tool.""" + try: + from ..._converters._models import _BUILT_IN_DESCRIPTIONS, _BUILT_IN_PARAMS + + if tool_name in _BUILT_IN_DESCRIPTIONS: + return { + "type": tool_name, + "description": _BUILT_IN_DESCRIPTIONS[tool_name], + "name": tool_name, + "parameters": _BUILT_IN_PARAMS.get(tool_name, {}), + } + except ImportError: + pass + return None + + def _get_needed_built_in_tool_definitions(self, tool_calls: List[Dict]) -> List[Dict]: + """Extract tool definitions needed for the given built-in tool calls.""" + needed_definitions = [] + for tool_call in tool_calls: + if isinstance(tool_call, dict): + tool_type = tool_call.get("type") + + # Only support converter format: {type: "tool_call", name: "bing_custom_search", arguments: {...}} + if tool_type == "tool_call": + tool_name = tool_call.get("name") + if tool_name: + definition = self._get_built_in_tool_definition(tool_name) + if definition and definition not in needed_definitions: + needed_definitions.append(definition) + + return needed_definitions + + def _extract_tool_names_from_calls(self, tool_calls: List[Dict]) -> List[str]: + """Extract just the tool names from tool calls, removing parameters.""" + tool_names = [] + for tool_call in tool_calls: + if isinstance(tool_call, dict): + tool_type = tool_call.get("type") + if tool_type == "tool_call": + tool_name = tool_call.get("name") + if tool_name: + tool_names.append(tool_name) + elif tool_call.get("function", {}).get("name"): + # Handle function call format + tool_names.append(tool_call["function"]["name"]) + elif tool_call.get("name"): + # Handle direct name format + tool_names.append(tool_call["name"]) + return tool_names + + def _extract_needed_tool_definitions( + self, tool_calls: List[Dict], tool_definitions: List[Dict], error_target: ErrorTarget + ) -> List[Dict]: + """Extract the tool definitions that are needed for the provided tool calls. + + :param tool_calls: The tool calls that need definitions + :type tool_calls: List[Dict] + :param tool_definitions: User-provided tool definitions + :type tool_definitions: List[Dict] + :param error_target: The evaluator-specific error target for exceptions + :type error_target: ErrorTarget + :return: List of needed tool definitions + :rtype: List[Dict] + :raises EvaluationException: If validation fails + """ + needed_tool_definitions = [] + + # Add all user-provided tool definitions + needed_tool_definitions.extend(tool_definitions) + + # Add the needed built-in tool definitions (if they are called) + built_in_definitions = self._get_needed_built_in_tool_definitions(tool_calls) + needed_tool_definitions.extend(built_in_definitions) + + # An OpenAPI tool is a collection of functions. When an OpenAPI tool + # definition exposes its nested functions, expand it into those functions + # so tool calls referencing a nested function name can be matched. If an + # OpenAPI tool definition has no nested functions, keep the OpenAPI tool + # definition as is for backward compatibility. + tool_definitions_expanded = [] + for tool in needed_tool_definitions: + openapi_functions = tool.get("functions") if tool.get("type") == "openapi" else None + if openapi_functions: + tool_definitions_expanded.extend(openapi_functions) + else: + tool_definitions_expanded.append(tool) + + # Validate that all tool calls have corresponding definitions + for tool_call in tool_calls: + if isinstance(tool_call, dict): + tool_type = tool_call.get("type") + + if tool_type == "tool_call": + tool_name = tool_call.get("name") + if tool_name and self._get_built_in_tool_definition(tool_name): + # This is a built-in tool from converter, already handled above + continue + elif tool_name: + # This is a regular function tool from converter + tool_definition_exists = any( + tool.get("name") == tool_name for tool in tool_definitions_expanded + ) + if not tool_definition_exists: + raise EvaluationException( + message=f"Tool definition for {tool_name} not found", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=error_target, + ) + else: + raise EvaluationException( + message=f"Tool call missing name: {tool_call}", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=error_target, + ) + else: + # Unsupported tool format - only converter format is supported + raise EvaluationException( + message=f"Unsupported tool call format. Only converter format is supported: {tool_call}", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=error_target, + ) + else: + # Tool call is not a dictionary + raise EvaluationException( + message=f"Tool call is not a dictionary: {tool_call}", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=error_target, + ) + + return needed_tool_definitions + + def _return_not_applicable_result( + self, error_message: str, threshold: Union[int, float] + ) -> Dict[str, Union[str, float, Dict, None]]: + """Return a result indicating that the tool call is not applicable for evaluation. + + :param error_message: The error message indicating why the evaluation is not applicable. + :type error_message: str + :param threshold: The threshold value for the evaluation. + :type threshold: Union[int, float] + :return: A dictionary containing the result of the evaluation. + :rtype: Dict[str, Union[str, float, None]] + """ + return not_applicable_result(self._result_key, error_message, threshold) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py index b2c5f6bd81d0..253d9ca5154e 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py @@ -2,50 +2,31 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -import json import math -import re -import os -from typing import Dict, Optional, TypeVar, Union, List +from typing import Dict, TypeVar, Union -if os.getenv("AI_EVALS_USE_PF_PROMPTY", "false").lower() == "true": - from promptflow.core._flow import AsyncPrompty -else: - from azure.ai.evaluation._legacy.prompty import AsyncPrompty from typing_extensions import override -from azure.core.credentials import TokenCredential -from azure.ai.evaluation._common.constants import PROMPT_BASED_REASON_EVALUATORS -from azure.ai.evaluation._constants import EVALUATION_PASS_FAIL_MAPPING from azure.ai.evaluation._exceptions import EvaluationException, ErrorBlame, ErrorCategory, ErrorTarget -from ..._common.utils import construct_prompty_model_config, validate_model_config, parse_quality_evaluator_reason_score # The message-preprocessing helpers now live in ``azure.ai.evaluation._common.utils`` (single source of # truth). They are imported here so this module can use them and so callers that historically imported # them from this module keep working. ``_drop_mcp_approval_messages`` / ``_normalize_function_call_types`` # are re-exported only (used indirectly via ``_preprocess_messages``). -from ..._common.utils import ( # pylint: disable=unused-import +from ..._common.utils import ( # noqa: F401 # pylint: disable=unused-import _is_intermediate_response, _drop_mcp_approval_messages, _normalize_function_call_types, _preprocess_messages, ) -from . import EvaluatorBase - -try: - from ..._user_agent import UserAgentSingleton -except ImportError: - - class UserAgentSingleton: - @property - def value(self) -> str: - return "None" - +from ._base_model_eval import ModelEvaluatorBase +from ._prompty_strategy import PromptyEvaluationStrategy +from ._model_runners import AsyncPrompty, UserAgentSingleton # noqa: F401 # pylint: disable=unused-import T = TypeVar("T") -class PromptyEvaluatorBase(EvaluatorBase[T]): +class PromptyEvaluatorBase(ModelEvaluatorBase[T]): """Base class for all evaluators that make use of context as an input. It's also assumed that such evaluators make use of a prompty file, and return their results as a dictionary, with a single key-value pair linking the result name to a float value (unless multi-turn evaluation occurs, in which case the @@ -61,69 +42,13 @@ class PromptyEvaluatorBase(EvaluatorBase[T]): :param ignore_queries: If True, queries will be ignored in conversation evaluations. Default is False. Useful since some evaluators of this format are response-only. :type ignore_queries: bool - :keyword is_reasoning_model: This parameter is in preview. If True, updates the config parameters in prompty file based on reasoning models. Defaults to False. + :keyword is_reasoning_model: This parameter is in preview. If True, updates the config parameters in + prompty file based on reasoning models. Defaults to False. :type is_reasoning_model: bool """ - _LLM_CALL_TIMEOUT = 600 - _DEFAULT_OPEN_API_VERSION = "2024-02-15-preview" - - def __init__( - self, - *, - result_key: str, - prompty_file: str, - model_config: dict, - eval_last_turn: bool = False, - threshold: int = 3, - credential: Optional[TokenCredential] = None, - _higher_is_better: bool = False, - **kwargs, - ) -> None: - self._result_key = result_key - self._is_reasoning_model = kwargs.get("is_reasoning_model", False) - self._prompty_file = prompty_file - self._threshold = threshold - self._higher_is_better = _higher_is_better - super().__init__(eval_last_turn=eval_last_turn, threshold=threshold, _higher_is_better=_higher_is_better) - - subclass_name = self.__class__.__name__ - user_agent = f"{UserAgentSingleton().value} (type=evaluator subtype={subclass_name})" - prompty_model_config = construct_prompty_model_config( - validate_model_config(model_config), - self._DEFAULT_OPEN_API_VERSION, - user_agent, - ) - - self._flow = AsyncPrompty.load( - source=self._prompty_file, - model=prompty_model_config, - token_credential=credential, - is_reasoning_model=self._is_reasoning_model, - ) - - # __call__ not overridden here because child classes have such varied signatures that there's no point - # defining a default here. - def _get_binary_result(self, score: float) -> str: - """Get the binary result based on the score. - - :param score: The score to evaluate. - :type score: float - :return: The binary result. - :rtype: str - """ - if math.isnan(score): - return "unknown" - if self._higher_is_better: - if score >= self._threshold: - return EVALUATION_PASS_FAIL_MAPPING[True] - else: - return EVALUATION_PASS_FAIL_MAPPING[False] - else: - if score <= self._threshold: - return EVALUATION_PASS_FAIL_MAPPING[True] - else: - return EVALUATION_PASS_FAIL_MAPPING[False] + # __init__ and __call__ are inherited: the constructor from ModelEvaluatorBase, and __call__ is not defined + # because child classes have such varied signatures that there's no point defining a default here. @override async def _do_eval(self, eval_input: Dict) -> Dict[str, Union[float, str]]: # type: ignore[override] @@ -158,243 +83,12 @@ async def _do_eval(self, eval_input: Dict) -> Dict[str, Union[float, str]]: # t if isinstance(eval_input.get("query"), list): eval_input["query"] = _preprocess_messages(eval_input["query"]) - # Call the prompty flow to get the evaluation result. - prompty_output_dict = await self._flow(timeout=self._LLM_CALL_TIMEOUT, **eval_input) - - score = math.nan - reason = "" - llm_properties = {} - - if prompty_output_dict: - llm_output = prompty_output_dict.get("llm_output", "") - - # Parse JSON output from LLM - parsed_output = None - if isinstance(llm_output, dict): - parsed_output = llm_output - elif isinstance(llm_output, str): - try: - parsed_output = json.loads(llm_output) - except (json.JSONDecodeError, TypeError): - parsed_output = None - - if parsed_output and isinstance(parsed_output, dict): - # Handle skipped status from LLM - llm_status = parsed_output.get("status", "completed") - if llm_status == "skipped": - skip_reason = parsed_output.get("reason", "") - return self._return_not_applicable_result(skip_reason, self._threshold) - - score = parsed_output.get("score", math.nan) - reason = parsed_output.get("reason", "") - llm_properties = parsed_output.get("properties", {}) or {} - else: - # Fallback: try to parse legacy XML format or extract digit - if isinstance(llm_output, str) and self._result_key in PROMPT_BASED_REASON_EVALUATORS: - score, reason = parse_quality_evaluator_reason_score(llm_output) - elif isinstance(llm_output, str): - match = re.search(r"\d", llm_output) - if match: - score = float(match.group()) - - score = float(score) if score is not None else math.nan - score_result = self._get_binary_result(score) - - llm_properties.update(self._get_token_metadata(prompty_output_dict)) - - return { - self._result_key: score, - f"{self._result_key}_score": score, - f"{self._result_key}_passed": score_result == "pass", - f"{self._result_key}_result": score_result, - f"{self._result_key}_reason": reason, - f"{self._result_key}_status": "completed", - f"{self._result_key}_threshold": self._threshold, - f"{self._result_key}_properties": llm_properties, - } - - raise EvaluationException( - message="Evaluator returned invalid output.", - blame=ErrorBlame.SYSTEM_ERROR, - category=ErrorCategory.FAILED_EXECUTION, - target=ErrorTarget.EVALUATE, - ) - - @staticmethod - def _get_token_metadata(prompty_output: Dict) -> Dict: - """Extract token usage and model metadata from the prompty output dict. - - :param prompty_output: The raw output dictionary from the prompty flow. - :type prompty_output: Dict - :return: A dictionary with token counts, finish reason, model, and sample I/O. - :rtype: Dict - """ - return { - "prompt_tokens": prompty_output.get("input_token_count", 0), - "completion_tokens": prompty_output.get("output_token_count", 0), - "total_tokens": prompty_output.get("total_token_count", 0), - "finish_reason": prompty_output.get("finish_reason", ""), - "model": prompty_output.get("model_id", ""), - "sample_input": prompty_output.get("sample_input", ""), - "sample_output": prompty_output.get("sample_output", ""), - } - - @staticmethod - def _get_built_in_tool_definition(tool_name: str): - """Get the definition for the built-in tool.""" - try: - from ..._converters._models import _BUILT_IN_DESCRIPTIONS, _BUILT_IN_PARAMS - - if tool_name in _BUILT_IN_DESCRIPTIONS: - return { - "type": tool_name, - "description": _BUILT_IN_DESCRIPTIONS[tool_name], - "name": tool_name, - "parameters": _BUILT_IN_PARAMS.get(tool_name, {}), - } - except ImportError: - pass - return None - - def _get_needed_built_in_tool_definitions(self, tool_calls: List[Dict]) -> List[Dict]: - """Extract tool definitions needed for the given built-in tool calls.""" - needed_definitions = [] - for tool_call in tool_calls: - if isinstance(tool_call, dict): - tool_type = tool_call.get("type") - - # Only support converter format: {type: "tool_call", name: "bing_custom_search", arguments: {...}} - if tool_type == "tool_call": - tool_name = tool_call.get("name") - if tool_name: - definition = self._get_built_in_tool_definition(tool_name) - if definition and definition not in needed_definitions: - needed_definitions.append(definition) - - return needed_definitions - - def _extract_tool_names_from_calls(self, tool_calls: List[Dict]) -> List[str]: - """Extract just the tool names from tool calls, removing parameters.""" - tool_names = [] - for tool_call in tool_calls: - if isinstance(tool_call, dict): - tool_type = tool_call.get("type") - if tool_type == "tool_call": - tool_name = tool_call.get("name") - if tool_name: - tool_names.append(tool_name) - elif tool_call.get("function", {}).get("name"): - # Handle function call format - tool_names.append(tool_call["function"]["name"]) - elif tool_call.get("name"): - # Handle direct name format - tool_names.append(tool_call["name"]) - return tool_names - - def _extract_needed_tool_definitions( - self, tool_calls: List[Dict], tool_definitions: List[Dict], error_target: ErrorTarget - ) -> List[Dict]: - """Extract the tool definitions that are needed for the provided tool calls. - - :param tool_calls: The tool calls that need definitions - :type tool_calls: List[Dict] - :param tool_definitions: User-provided tool definitions - :type tool_definitions: List[Dict] - :param error_target: The evaluator-specific error target for exceptions - :type error_target: ErrorTarget - :return: List of needed tool definitions - :rtype: List[Dict] - :raises EvaluationException: If validation fails - """ - needed_tool_definitions = [] - - # Add all user-provided tool definitions - needed_tool_definitions.extend(tool_definitions) - - # Add the needed built-in tool definitions (if they are called) - built_in_definitions = self._get_needed_built_in_tool_definitions(tool_calls) - needed_tool_definitions.extend(built_in_definitions) - - # An OpenAPI tool is a collection of functions. When an OpenAPI tool - # definition exposes its nested functions, expand it into those functions - # so tool calls referencing a nested function name can be matched. If an - # OpenAPI tool definition has no nested functions, keep the OpenAPI tool - # definition as is for backward compatibility. - tool_definitions_expanded = [] - for tool in needed_tool_definitions: - openapi_functions = tool.get("functions") if tool.get("type") == "openapi" else None - if openapi_functions: - tool_definitions_expanded.extend(openapi_functions) - else: - tool_definitions_expanded.append(tool) - - # Validate that all tool calls have corresponding definitions - for tool_call in tool_calls: - if isinstance(tool_call, dict): - tool_type = tool_call.get("type") - - if tool_type == "tool_call": - tool_name = tool_call.get("name") - if tool_name and self._get_built_in_tool_definition(tool_name): - # This is a built-in tool from converter, already handled above - continue - elif tool_name: - # This is a regular function tool from converter - tool_definition_exists = any( - tool.get("name") == tool_name for tool in tool_definitions_expanded - ) - if not tool_definition_exists: - raise EvaluationException( - message=f"Tool definition for {tool_name} not found", - blame=ErrorBlame.USER_ERROR, - category=ErrorCategory.INVALID_VALUE, - target=error_target, - ) - else: - raise EvaluationException( - message=f"Tool call missing name: {tool_call}", - blame=ErrorBlame.USER_ERROR, - category=ErrorCategory.INVALID_VALUE, - target=error_target, - ) - else: - # Unsupported tool format - only converter format is supported - raise EvaluationException( - message=f"Unsupported tool call format. Only converter format is supported: {tool_call}", - blame=ErrorBlame.USER_ERROR, - category=ErrorCategory.INVALID_VALUE, - target=error_target, - ) - else: - # Tool call is not a dictionary - raise EvaluationException( - message=f"Tool call is not a dictionary: {tool_call}", - blame=ErrorBlame.USER_ERROR, - category=ErrorCategory.INVALID_VALUE, - target=error_target, - ) - - return needed_tool_definitions - - def _return_not_applicable_result( - self, error_message: str, threshold: Union[int, float] - ) -> Dict[str, Union[str, float, Dict, None]]: - """Return a result indicating that the tool call is not applicable for evaluation. - - :param error_message: The error message indicating why the evaluation is not applicable. - :type error_message: str - :param threshold: The threshold value for the evaluation. - :type threshold: Union[int, float] - :return: A dictionary containing the result of the evaluation. - :rtype: Dict[str, Union[str, float, None]] - """ - return { - f"{self._result_key}": None, - f"{self._result_key}_score": None, - f"{self._result_key}_passed": None, - f"{self._result_key}_result": "not_applicable", - f"{self._result_key}_reason": f"Not applicable: {error_message}", - f"{self._result_key}_status": "skipped", - f"{self._result_key}_threshold": threshold, - f"{self._result_key}_properties": None, - } + return await PromptyEvaluationStrategy( + self._prompty_model_runner, + result_key=self._result_key, + threshold=self._threshold, + timeout=self._LLM_CALL_TIMEOUT, + strict=False, + missing_score=math.nan, + higher_is_better=self._higher_is_better, + ).evaluate(eval_input) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_decision_strategy.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_decision_strategy.py new file mode 100644 index 000000000000..1f75f1d464a8 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_decision_strategy.py @@ -0,0 +1,248 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Evaluates prepared input with a decision model and returns the final evaluator result. + +An evaluator supplies its questions, scoring policy and error target; this strategy owns the shared mechanics: +status gating, score mapping, provenance and result shape. +""" + +import hashlib +import json +from dataclasses import dataclass +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union + +from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException +from ._base_model_eval import not_applicable_result +from ._model_runners import DecisionModelRunner, validate_noul_answer, validate_score_answer, validated_execution + +STATUS_CUTOFF = 0.5 +T = TypeVar("T") + + +def _checked_value(validate: Callable[..., T], error_target: ErrorTarget, *args: Any) -> T: + try: + return validate(*args) + except (ValueError, OverflowError) as exc: + message = f"The decision model returned an invalid response: {exc}" + raise EvaluationException( + message=message, + internal_message=message, + blame=ErrorBlame.SYSTEM_ERROR, + category=ErrorCategory.FAILED_EXECUTION, + target=error_target, + ) from None + + +def decision_probability( + response: Dict[str, Any], question_id: str, error_target: ErrorTarget = ErrorTarget.EVALUATE +) -> float: + """Read and validate the probability of a binary decision answer.""" + return _checked_value(validate_noul_answer, error_target, response["answers"][question_id]) + + +def decision_distribution( + response: Dict[str, Any], question_id: str, levels: int, error_target: ErrorTarget = ErrorTarget.EVALUATE +) -> List[float]: + """Read and validate the distribution of a scored decision answer.""" + return _checked_value(validate_score_answer, error_target, response["answers"][question_id], levels) + + +def decision_skip_reason( + response: Dict[str, Any], cutoff: float, error_target: ErrorTarget = ErrorTarget.EVALUATE +) -> Optional[str]: + """Apply the evaluator's status cutoff before interpreting a score.""" + probability = decision_probability(response, "status", error_target) + if probability >= cutoff: + return None + return ( + f"Status completion probability {probability:.4f} is below {cutoff:.4f}; " + "evaluation skipped. No model rationale is available." + ) + + +def decision_token_counts(response: Dict[str, Any]) -> Dict[str, Any]: + """Convert decision usage to the common model-output metadata shape.""" + usage = response["usage"] + return { + "input_token_count": usage["input_tokens"], + "output_token_count": usage["output_tokens"], + "total_token_count": usage["input_tokens"] + usage["output_tokens"], + "model_id": response["model"], + } + + +def _label(result_key: str) -> str: + return result_key.replace("_", " ") + + +def _digest(question: Dict[str, Any]) -> str: + return hashlib.sha256(json.dumps(question, sort_keys=True).encode("utf-8")).hexdigest() + + +def _native_answer_provenance(answer: Dict[str, Any]) -> Dict[str, Any]: + try: + json.dumps(answer, allow_nan=False) + except (TypeError, ValueError, OverflowError, RecursionError): + raise ValueError("native answer provenance must contain only JSON-safe values") from None + return dict(answer) + + +@dataclass(frozen=True) +class BinaryScoring: + """Scores 1 when the answer's probability reaches the cutoff, otherwise 0. + + Standalone results pass only at 1, regardless of the evaluator threshold. Composites can reapply their + configured member thresholds, so a binary member scoring 0 can pass when its composite threshold is 0. + """ + + probability_cutoff: float + + def interpret( + self, response: Dict[str, Any], result_key: str, error_target: ErrorTarget + ) -> Tuple[float, str, Dict[str, Any]]: + probability = decision_probability(response, result_key, error_target) + score = float(probability >= self.probability_cutoff) + relation = "at or above" if score else "below" + reason = ( + f"{_label(result_key).capitalize()} probability {probability:.4f} is {relation} " + f"the {self.probability_cutoff:.4f} cutoff." + ) + details = { + "probability_threshold": self.probability_cutoff, + "probabilities": {"false": 1 - probability, "true": probability}, + } + return score, reason, details + + def passes(self, score: float, threshold: float) -> bool: + return score >= 1.0 + + +@dataclass(frozen=True) +class LikertScoring: + """Scores the highest-probability level of a scale starting at ``minimum``; ties select the lowest level.""" + + levels: int + minimum: int = 1 + + def interpret( + self, response: Dict[str, Any], result_key: str, error_target: ErrorTarget + ) -> Tuple[float, str, Dict[str, Any]]: + distribution = decision_distribution(response, result_key, self.levels, error_target) + score = float(max(range(self.levels), key=distribution.__getitem__) + self.minimum) + answer = response["answers"][result_key] + reason = f"Selected {_label(result_key)} level {score:g} from the highest-probability level." + details = { + "probabilities": answer["probabilities"], + "confidence": answer["confidence"], + "native_mean": answer["score"], + "expected_score": sum(level * value for level, value in enumerate(distribution)) + self.minimum, + } + return score, reason, details + + def passes(self, score: float, threshold: float) -> bool: + return score >= threshold + + +class DecisionEvaluationStrategy: + """Interprets Decision answers using the fixed ``STATUS_CUTOFF`` of 0.5 for applicability. + + The evaluator's score threshold does not change the applicability cutoff. + """ + + def __init__( + self, + runner: DecisionModelRunner, + *, + result_key: str, + error_target: ErrorTarget, + questions: Dict[str, Any], + scoring: Union[BinaryScoring, LikertScoring], + threshold: float, + timeout: float, + extra_properties: Optional[Callable[[Dict[str, Any]], Dict[str, Any]]] = None, + ): + self.runner = runner + self.result_key = result_key + self.error_target = error_target + self.questions = questions + self.scoring = scoring + self.threshold = threshold + self.timeout = timeout + self.extra_properties = extra_properties + + async def evaluate(self, eval_input: Dict[str, Any]) -> Dict[str, Any]: + response = await self.runner(state=dict(eval_input), questions=self.questions, timeout=self.timeout) + result = self.parse(response, eval_input) + tokens = decision_token_counts(response) + result.update( + { + f"{self.result_key}_prompt_tokens": tokens["input_token_count"], + f"{self.result_key}_completion_tokens": tokens["output_token_count"], + f"{self.result_key}_total_tokens": tokens["total_token_count"], + f"{self.result_key}_model": tokens["model_id"], + } + ) + return result + + def parse(self, response: Dict[str, Any], eval_input: Dict[str, Any]) -> Dict[str, Any]: + """Interpret a validated response without making a request. + + Known shared-response usage remains in properties. Only the request-owning result emits standard + usage fields, so composites can parse multiple members without counting the same request repeatedly. + """ + key = self.result_key + properties = self.extra_properties(eval_input) if self.extra_properties else {} + properties["decision_model"] = { + "deployment": self.runner.deployment, + "model": response["model"], + "rubric_hash": _digest(self.questions[key]), + "status_rubric_hash": _digest(self.questions["status"]), + "status_probability_threshold": STATUS_CUTOFF, + "reason_type": "templated", + } + execution = validated_execution(response.get("_decision_execution")) + if execution is not None: + properties["decision_model"]["execution"] = execution + tokens = decision_token_counts(response) + properties.update( + prompt_tokens=tokens["input_token_count"], + completion_tokens=tokens["output_token_count"], + total_tokens=tokens["total_token_count"], + model=tokens["model_id"], + ) + try: + skip_reason = decision_skip_reason(response, STATUS_CUTOFF, self.error_target) + properties["decision_model"]["status_completion_probability"] = decision_probability( + response, "status", self.error_target + ) + properties["decision_model"]["native_status_answer"] = _checked_value( + _native_answer_provenance, self.error_target, response["answers"]["status"] + ) + if skip_reason: + result = not_applicable_result(key, skip_reason, self.threshold) + result[f"{key}_properties"] = properties + return result + score, reason, details = self.scoring.interpret(response, key, self.error_target) + native_answer = _checked_value( + _native_answer_provenance, + self.error_target, + {name: value for name, value in response["answers"][key].items() if name != "legend"}, + ) + except EvaluationException as exc: + exc.properties = properties + raise + properties["decision_model"].update(details) + properties["decision_model"]["native_answer"] = native_answer + passed = self.scoring.passes(score, self.threshold) + return { + key: score, + f"{key}_score": score, + f"{key}_passed": passed, + f"{key}_result": "pass" if passed else "fail", + f"{key}_reason": f"{reason} No model rationale is available.", + f"{key}_status": "completed", + f"{key}_threshold": self.threshold, + f"{key}_properties": properties, + } diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_model_runners.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_model_runners.py new file mode 100644 index 000000000000..e2d34742c296 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_model_runners.py @@ -0,0 +1,778 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Model runners execute a prepared request against a model backend. + +A runner owns backend configuration, authentication and transport. It never interprets a model's answer +as an evaluator score; that stays with the evaluator. +""" + +import asyncio +import inspect +import ipaddress +import json +import logging +import math +import os +import re +import time +from typing import Any, Callable, Dict, List, Optional +from urllib.parse import urlsplit + +from azure.core.pipeline.policies import AsyncRedirectPolicy, AsyncRetryPolicy, CustomHookPolicy +from azure.core.pipeline.transport import AioHttpTransport + +from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException +from ..._common.utils import construct_prompty_model_config, validate_model_config +from ..._http_utils import get_async_http_client + +if os.getenv("AI_EVALS_USE_PF_PROMPTY", "false").lower() == "true": + from promptflow.core._flow import AsyncPrompty +else: + from azure.ai.evaluation._legacy.prompty import AsyncPrompty + +try: + from ..._user_agent import UserAgentSingleton +except ImportError: + + class UserAgentSingleton: # type: ignore[no-redef] + @property + def value(self) -> str: + return "None" + + +DECISION_MODEL_TYPE = "decision" +_DECISION_PATH = "/providers/microsoft/v1/systemone" +_DECISION_TOKEN_SCOPE = "https://cognitiveservices.azure.com/.default" +_DECISION_RETRY_STATUS_CODES = [408, 429, 500, 502, 503, 504, 529] +LOGGER = logging.getLogger(__name__) +_PREFIX = "azure.ai.evaluation.decision." +_DECISION_CONFIG_KEYS = { + "type", + "azure_endpoint", + "azure_deployment", + "api_key", + "credential", + "probability_threshold", +} +_DEFAULT_PROBABILITY_THRESHOLD = 0.75 +# The service adds api_version to every resolved model configuration; the decision endpoint does not use it. +_IGNORED_CONFIG_KEYS = {"api_version"} + + +def is_decision_model_config(model_config: Any) -> bool: + """Whether a model configuration explicitly selects a decision model. + + :param model_config: The model configuration passed to an evaluator. + :type model_config: Any + :return: True only for configurations tagged ``type="decision"``. + :rtype: bool + """ + return isinstance(model_config, dict) and model_config.get("type") == DECISION_MODEL_TYPE + + +def _integer(value: Any, maximum: Optional[int] = None) -> bool: + return ( + isinstance(value, int) and not isinstance(value, bool) and 0 <= value and (maximum is None or value <= maximum) + ) + + +def validated_execution(value: Any) -> Optional[Dict[str, Any]]: + """Copy only a complete, strictly typed shared or independent execution summary. + + :param value: The untrusted summary carrier. + :type value: Any + :return: Known validated fields, or None for an invalid carrier. + :rtype: Optional[Dict[str, Any]] + """ + if not isinstance(value, dict): + return None + if "operation_id" in value: + keys = { + "operation_id", + "attempt_count", + "unknown_usage_attempt_count", + "result_usage_scope", + "usage_completeness", + } + if set(value) != keys or not all( + ( + isinstance(value["operation_id"], str) + and re.fullmatch("[0-9a-f]{32}", value["operation_id"]) is not None, + _integer(value["attempt_count"]), + _integer(value["unknown_usage_attempt_count"]), + value["result_usage_scope"] == "final_response_only", + value["usage_completeness"] + in ("all_attempts_reported", "some_attempts_reported", "no_attempts_reported"), + ) + ): + return None + return dict(value) + keys = {"attempt_count", "retry_count", "elapsed_ms", "outcome", "last_http_status", "usage_state"} + elapsed = value.get("elapsed_ms") + status = value.get("last_http_status") + if ( + not keys - {"last_http_status"} <= value.keys() + or isinstance(elapsed, bool) + or not isinstance(elapsed, (int, float)) + ): + return None + if not all( + ( + _integer(value["attempt_count"], 21), + _integer(value["retry_count"], 20), + 0 <= elapsed <= 86400000 and math.isfinite(elapsed), + value["outcome"] in ("completed", "error", "deadline", "cancelled"), + value["usage_state"] in ("known", "partial", "unknown"), + status is None or (_integer(status, 599) and status >= 100), + ) + ): + return None + return {key: value.get(key) for key in keys} + + +def _diagnostic(message: str) -> None: + # Observer failures must not replace a model result, even if diagnostic logging is also broken. + try: + LOGGER.warning(message) + except Exception: # pylint: disable=broad-except + pass + + +class DecisionExecution(CustomHookPolicy): + """One operation's per-attempt pipeline policy; never shared between concurrent calls.""" + + def __init__(self, logger: Any, max_response_bytes: Optional[int]) -> None: + super().__init__() + self.logger = logger + self.max_response_bytes = max_response_bytes + self.started = time.monotonic() + self.attempt_started: Optional[float] = None + self.attempt_count = 0 + self.known_usage_attempts = 0 + self.partial_usage_attempts = 0 + self.last_http_status: Optional[int] = None + self.outcome = "error" + self.instruments: Optional[Dict[str, Any]] = None + + def on_request(self, request: Any) -> None: + self.attempt_count += 1 + self.attempt_started = time.monotonic() + super().on_request(request) + + def on_response(self, request: Any, response: Any) -> None: + raw = response.http_response + status = raw.status_code + self.last_http_status = status if _integer(status, 599) and status >= 100 else None + known = False + partial = False + try: + body = raw.body() + if self.max_response_bytes is None or len(body) <= self.max_response_bytes: + payload = json.loads(body) + usage = payload.get("usage") if isinstance(payload, dict) else None + if isinstance(usage, dict): + tokens = [_integer(usage.get(key)) for key in ("input_tokens", "output_tokens")] + known, partial = all(tokens), any(tokens) + except (ValueError, TypeError): + pass + self.known_usage_attempts += int(known) + self.partial_usage_attempts += int(partial and not known) + self.finish_attempt( + "completed" if status == 200 else "error", + "known" if known else "partial" if partial else "unknown", + self.last_http_status, + ) + super().on_response(request, response) + + def on_exception(self, request: Any) -> None: + self.finish_attempt("error") + + def summary(self, outcome: str) -> Dict[str, Any]: + return { + "attempt_count": self.attempt_count, + "retry_count": max(0, self.attempt_count - 1), + "elapsed_ms": (time.monotonic() - self.started) * 1000, + "outcome": outcome, + "last_http_status": self.last_http_status, + "usage_state": ( + "known" + if self.attempt_count and self.known_usage_attempts == self.attempt_count + else "partial" if self.known_usage_attempts or self.partial_usage_attempts else "unknown" + ), + } + + def finish_attempt(self, outcome: str, usage: str = "unknown", status: Optional[int] = None) -> None: + if self.attempt_started is None: + return + elapsed = (time.monotonic() - self.attempt_started) * 1000 + self.attempt_started = None + self.emit("attempt", outcome, self.summary(outcome), elapsed, usage, status) + + def finish(self, outcome: str) -> Optional[Dict[str, Any]]: + self.finish_attempt(outcome) + summary = self.summary(outcome) + self.emit("execution", outcome, summary, summary["elapsed_ms"], summary["usage_state"]) + accepted = validated_execution(summary) + if accepted is None: + _diagnostic("Decision execution summary exceeds the hosted metadata bounds; summary omitted.") + return accepted + + def emit( + self, + phase: str, + outcome: str, + summary: Dict[str, Any], + elapsed: float, + usage: str, + status: Optional[int] = None, + ) -> None: + status = self.last_http_status if phase == "execution" else status + dimensions = { + "backend": "decision", + "route": "shared_sdk", + "phase": phase, + "outcome": outcome, + "usage_state": usage, + "http_status_class": f"{status // 100}xx" if status is not None else "unknown", + "throttled": str(status == 429).lower(), + } + try: + logger = self.logger + if logger is not None and logger.isEnabledFor(logging.INFO): + fields = { + "decision_dimensions": json.dumps(dimensions), + "decision_execution": json.dumps(summary), + } + while isinstance(logger, logging.LoggerAdapter): + # Python 3.10 LoggerAdapter.process replaces, rather than merges, per-call extra fields. + _, kwargs = logger.process("DECISION_EXECUTION_OBSERVATION", {"extra": dict(fields)}) + fields = {**kwargs.get("extra", {}), **fields} + logger = logger.logger + logger.info("DECISION_EXECUTION_OBSERVATION", extra=fields) + except Exception: # pylint: disable=broad-except + _diagnostic("Decision execution log sink failed; evaluation and metrics continue.") + try: + self.emit_metrics(phase, elapsed, dimensions) + except Exception: # pylint: disable=broad-except + _diagnostic("Decision execution metric sink failed; evaluation and logs continue.") + + def emit_metrics(self, phase: str, elapsed: float, dimensions: Dict[str, str]) -> None: + if self.instruments is None: + try: + from opentelemetry.metrics import get_meter # pylint: disable=import-outside-toplevel + except ImportError: + self.instruments = {} + LOGGER.debug("Decision metrics require the optional opentelemetry extra.") + return + meter = get_meter("azure.ai.evaluation.decision") + self.instruments = { + key: meter.create_counter(_PREFIX + key) + for key in ("provider.attempts", "provider.retries", "operations") + } + self.instruments["provider.duration"] = meter.create_histogram(_PREFIX + "provider.duration", unit="ms") + if not self.instruments: + return + if phase == "attempt": + self.instruments["provider.attempts"].add(1, attributes=dimensions) + self.instruments["provider.duration"].record(elapsed, attributes=dimensions) + if self.attempt_count > 1: + self.instruments["provider.retries"].add(1, attributes=dimensions) + else: + self.instruments["operations"].add(1, attributes=dimensions) + + +class PromptyModelRunner: + """Loads a Prompty flow for a chat model and invokes it without interpreting the output.""" + + def __init__( + self, + *, + model_config: dict, + prompty_file: str, + credential: Any = None, + is_reasoning_model: bool = False, + evaluator_name: str, + api_version: str, + ) -> None: + user_agent = f"{UserAgentSingleton().value} (type=evaluator subtype={evaluator_name})" + prompty_model_config = construct_prompty_model_config( + validate_model_config(model_config), api_version, user_agent + ) + self.flow = AsyncPrompty.load( + source=prompty_file, + model=prompty_model_config, + token_credential=credential, + is_reasoning_model=is_reasoning_model, + ) + + async def __call__(self, *, timeout: float, **eval_input: Any) -> Dict[str, Any]: + return await self.flow(timeout=timeout, **eval_input) + + +def _invalid_config(message: str) -> EvaluationException: + return EvaluationException( + message=message, + internal_message=message, + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.INVALID_VALUE, + target=ErrorTarget.EVALUATE, + ) + + +def _failed(message: str, blame: ErrorBlame = ErrorBlame.SYSTEM_ERROR) -> EvaluationException: + return EvaluationException( + message=message, + internal_message=message, + blame=blame, + category=ErrorCategory.FAILED_EXECUTION, + target=ErrorTarget.EVALUATE, + ) + + +def _is_finite_number(value: Any) -> bool: + if isinstance(value, bool) or not isinstance(value, (int, float)): + return False + try: + return math.isfinite(value) + except OverflowError: + return False + + +def _probability(value: Any) -> float: + if not _is_finite_number(value): + raise ValueError("Decision probabilities must be finite numbers.") + if not 0 <= value <= 1: + raise ValueError("Decision probabilities must be in [0, 1].") + return float(value) + + +def validate_noul_answer(answer: Dict[str, Any]) -> float: + """Return the probability of a ``noul`` answer. + + :param answer: The answer for a ``noul`` question. + :type answer: Dict[str, Any] + :return: The probability that the condition holds. + :rtype: float + :raises ValueError: If the probability is missing, non-finite or outside [0, 1]. + """ + return _probability(answer.get("noul")) + + +def validate_score_answer(answer: Dict[str, Any], levels: int) -> List[float]: + """Return the level probabilities of a ``score`` answer after validating its fields. + + Hundredth-precision probabilities allow rounding error of ``0.005`` per level plus ``1e-12``. + Other distributions must sum to one within an absolute tolerance of ``0.001``. + The native mean is checked for finiteness, not consistency with the distribution. + + :param answer: The answer for a ``score`` question. + :type answer: Dict[str, Any] + :param levels: The number of levels in the question's scale. + :type levels: int + :return: The probability of each level, lowest level first. + :rtype: List[float] + :raises ValueError: If the probabilities, mean or confidence are missing or malformed. + """ + probabilities = answer.get("probabilities") + if not isinstance(probabilities, dict) or set(probabilities) != {str(i) for i in range(levels)}: + raise ValueError(f"a score answer requires probabilities for exactly {levels} levels.") + distribution = [_probability(probabilities[str(i)]) for i in range(levels)] + tolerance = len(distribution) * 0.005 + 1e-12 if all(value == round(value, 2) for value in distribution) else 0.001 + if not math.isclose(math.fsum(distribution), 1.0, rel_tol=0.0, abs_tol=tolerance): + raise ValueError("score probabilities must sum to one within the precision-aware rounding tolerance.") + mean = answer.get("score") + if not _is_finite_number(mean): + raise ValueError("the score mean must be finite.") + _probability(answer.get("confidence")) + return distribution + + +class DecisionModelRunner: + """Sends prepared evidence and typed questions to a Microsoft-Decision-1 deployment in Foundry. + + The model configuration must be tagged ``type="decision"`` and contain the Foundry resource endpoint + (``azure_endpoint``) and the deployment name (``azure_deployment``). Authentication uses ``api_key`` when + present, otherwise an explicitly supplied Entra credential (from ``credential`` in the configuration or the + constructor). No default credential is created for Decision. The endpoint must use HTTPS; + HTTP is permitted only for localhost or loopback IP literals. + Caller-supplied credentials remain caller-owned. ``api_version`` is accepted and ignored. + Reuse a synchronous ``azure.identity.DefaultAzureCredential`` for public synchronous and batch calls, + and close it after all calls complete. Async credentials require a caller-managed event loop and must + only be reused on that loop; cross-loop reuse is not supported. + ``probability_threshold`` (default 0.75) is only accepted when ``binary=True``. + + ``azure_endpoint`` must be the account resource root, not a project or OpenAI API endpoint. + For example, use ``https://account.services.ai.azure.com`` rather than a URL ending in + ``/api/projects/project`` or ``/openai``. Any path supplied is retained when appending the provider operation. + + Execution controls are keyword-only and separate from model configuration. ``timeout_seconds`` bounds + each connect/read; the call's ``timeout`` limits authentication, retries and response body reading. + Decision requests use the native async HTTP transport so timeout and cancellation stop body reads. + An injected pipeline retains its own transport; that transport must support cancellation for the same guarantee. + ``max_retries`` defaults to 3. ``cancellation_requested`` is polled every 50 ms, including retry waits; + it stops awaiting synchronous credentials but cannot stop their worker threads. Byte limits measure + compact unescaped UTF-8 JSON, with ``max_state_question_bytes`` applying to the largest individual pair. + ``max_response_bytes`` limits acceptance before parsing, not transport allocation. + """ + + def __init__( + self, + model_config: dict, + credential: Any = None, + *, + binary: bool = False, + evaluator_name: str = "DecisionModelRunner", + timeout_seconds: Optional[float] = None, + max_retries: int = 3, + cancellation_requested: Optional[Callable[[], bool]] = None, + max_request_bytes: Optional[int] = None, + max_state_question_bytes: Optional[int] = None, + max_response_bytes: Optional[int] = None, + ) -> None: + if timeout_seconds is not None and (not _is_finite_number(timeout_seconds) or timeout_seconds <= 0): + raise _invalid_config("'timeout_seconds' must be a positive finite number.") + if isinstance(max_retries, bool) or not isinstance(max_retries, int) or max_retries < 0: + raise _invalid_config("'max_retries' must be a nonnegative integer.") + for name, value in ( + ("max_request_bytes", max_request_bytes), + ("max_state_question_bytes", max_state_question_bytes), + ("max_response_bytes", max_response_bytes), + ): + if value is not None and (isinstance(value, bool) or not isinstance(value, int) or value <= 0): + raise _invalid_config(f"'{name}' must be a positive integer.") + if cancellation_requested is not None and not callable(cancellation_requested): + raise _invalid_config("'cancellation_requested' must be callable.") + self._timeout_seconds = timeout_seconds + self._max_retries = max_retries + self._cancellation_requested = cancellation_requested + self._max_request_bytes = max_request_bytes + self._max_state_question_bytes = max_state_question_bytes + self._max_response_bytes = max_response_bytes + if not is_decision_model_config(model_config): + raise _invalid_config(f"A decision model configuration must be a dict with type '{DECISION_MODEL_TYPE}'.") + unexpected = set(model_config) - _DECISION_CONFIG_KEYS - _IGNORED_CONFIG_KEYS + if unexpected: + raise _invalid_config(f"Unsupported decision model configuration fields: {sorted(unexpected)}.") + + endpoint = model_config.get("azure_endpoint") + if not isinstance(endpoint, str) or not endpoint.strip(): + raise _invalid_config("'azure_endpoint' must be a nonempty string.") + try: + parsed = urlsplit(endpoint) + hostname = parsed.hostname + port = parsed.port + loopback = hostname == "localhost" + if hostname and not loopback: + try: + loopback = ipaddress.ip_address(hostname).is_loopback + except ValueError: + labels = hostname.rstrip(".").encode("idna").decode("ascii").split(".") + if any( + not label + or not label[0].isalnum() + or not label[-1].isalnum() + or not all(character.isalnum() or character == "-" for character in label) + for label in labels + ): + raise ValueError + if ( + any(character.isspace() or ord(character) < 32 or ord(character) == 127 for character in endpoint) + or "\\" in endpoint + or not hostname + or "%" in hostname + or parsed.netloc.endswith(":") + or parsed.username is not None + or parsed.password is not None + or "?" in endpoint + or "#" in endpoint + or (port is not None and port == 0) + or (parsed.scheme != "https" and not (parsed.scheme == "http" and loopback)) + ): + raise ValueError + except ValueError: + raise _invalid_config( + "'azure_endpoint' must be a valid HTTPS URL; HTTP is allowed only for loopback." + ) from None + deployment = model_config.get("azure_deployment") + if not isinstance(deployment, str) or not deployment.strip(): + raise _invalid_config("'azure_deployment' must be the decision model deployment name.") + api_key = model_config.get("api_key") + if api_key is not None and (not isinstance(api_key, str) or not api_key.strip()): + raise _invalid_config("'api_key' must be a nonempty string.") + + # Like the Prompty path, an API key wins; a credential is only used when there is no key. + credential = credential if credential is not None else model_config.get("credential") + if not api_key and not callable(getattr(credential, "get_token", None)): + raise _invalid_config("Decision models require an 'api_key' or a credential with a callable 'get_token'.") + self._credential: Any = None if api_key else credential + + threshold = model_config.get("probability_threshold", _DEFAULT_PROBABILITY_THRESHOLD) + if "probability_threshold" in model_config and not binary: + raise _invalid_config("'probability_threshold' is only supported by binary evaluators.") + try: + self.probability_threshold = _probability(threshold) + except ValueError: + raise _invalid_config("'probability_threshold' must be a number in [0, 1].") from None + + self._url = f"{endpoint.rstrip('/')}{_DECISION_PATH}" + self._deployment = deployment + self._api_key = api_key + self._user_agent = f"{UserAgentSingleton().value} (type=evaluator subtype={evaluator_name})" + self._execution_logger: Any = logging.getLogger(__name__) + + def _bind_execution_logger(self, logger: Any) -> None: + """Bind a host's context-aware logger without changing transport or credential ownership. + + :param logger: The host logger or LoggerAdapter; None disables execution logs, not metrics. + :type logger: Any + """ + self._execution_logger = logger + + @property + def deployment(self) -> str: + """The deployment name sent as the request's model.""" + return self._deployment + + async def __call__(self, *, state: Any, questions: Dict[str, Dict[str, Any]], timeout: float) -> Dict[str, Any]: + """Request the decisions for ``questions`` about ``state`` and return the validated response. + + :keyword state: The prepared evidence, as text or JSON-serializable data. + :paramtype state: Any + :keyword questions: Typed questions keyed by identifier; ``noul`` and ``score`` are supported. + :paramtype questions: Dict[str, Dict[str, Any]] + :keyword timeout: Overall time limit in seconds. + :paramtype timeout: float + :return: ``{"model", "answers", "usage"}`` with the response's structure checked against the questions. + :rtype: Dict[str, Any] + """ + if not _is_finite_number(timeout) or timeout <= 0: + raise _invalid_config("'timeout' must be a positive finite number.") + deadline = time.monotonic() + timeout + execution = DecisionExecution(self._execution_logger, self._max_response_bytes) + outcome = "error" + properties = self._response_properties(None) + try: + for question in questions.values(): + if question.get("type") not in ("noul", "score"): + raise _invalid_config(f"Decision question type '{question.get('type')}' is not supported.") + body = {"model": self._deployment, "state": state, "questions": questions} + try: + content = json.dumps(body, ensure_ascii=False, separators=(",", ":"), allow_nan=False).encode("utf-8") + state_question_bytes = 0 + if self._max_state_question_bytes is not None: + state_question_bytes = max( + ( + len( + json.dumps( + {"state": state, "question": question}, + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode("utf-8") + ) + for question in questions.values() + ), + default=0, + ) + except (ValueError, TypeError, OverflowError, UnicodeError): + raise _failed( + "Decision evidence must be finite JSON-serializable data.", ErrorBlame.USER_ERROR + ) from None + if (self._max_request_bytes is not None and len(content) > self._max_request_bytes) or ( + self._max_state_question_bytes is not None and state_question_bytes > self._max_state_question_bytes + ): + raise _failed("The decision request exceeds the configured byte budget.", ErrorBlame.USER_ERROR) + try: + payload = await asyncio.wait_for( + self._await_request(content, deadline, execution), timeout=max(0, deadline - time.monotonic()) + ) + except asyncio.TimeoutError: + outcome = "deadline" + raise _failed("The decision model request timed out.") from None + properties = self._response_properties(payload) + try: + result = self._validate_response(payload, questions) + except ValueError as exc: + raise _failed(f"The decision model returned an invalid response: {exc}") from None + outcome = "completed" + return result + except asyncio.CancelledError as exc: + outcome = "cancelled" + setattr(exc, "properties", properties) + raise + except EvaluationException as exc: + if outcome != "deadline": + outcome = execution.outcome + if exc.properties is None: + exc.properties = properties + properties = exc.properties + raise + finally: + summary = execution.finish(outcome) + if summary is not None: + if outcome == "completed": + result["_decision_execution"] = summary + else: + properties.setdefault("decision_model", {})["execution"] = summary + + def _cancelled(self) -> bool: + callback = self._cancellation_requested + if callback is None: + return False + try: + result = callback() + except Exception: # pylint: disable=broad-except + raise _failed("The decision cancellation callback failed.", ErrorBlame.USER_ERROR) from None + if not isinstance(result, bool): + raise _failed("The decision cancellation callback must return a boolean.", ErrorBlame.USER_ERROR) + return result + + async def _await_request(self, content: bytes, deadline: float, execution: DecisionExecution) -> Any: + if self._cancelled(): + execution.outcome = "cancelled" + raise _failed("The decision model request was cancelled.", ErrorBlame.USER_ERROR) + if self._cancellation_requested is None: + return await self._post(content, deadline=deadline, execution=execution) + task = asyncio.create_task(self._post(content, deadline=deadline, execution=execution)) + try: + while not task.done(): + if self._cancelled(): + execution.outcome = "cancelled" + raise _failed("The decision model request was cancelled.", ErrorBlame.USER_ERROR) + await asyncio.wait({task}, timeout=0.05) + return await task + finally: + if not task.done(): + task.cancel() + await asyncio.gather(task, return_exceptions=True) + + async def _get_token(self) -> str: + if inspect.iscoroutinefunction(self._credential.get_token): + return (await self._credential.get_token(_DECISION_TOKEN_SCOPE)).token + token = await asyncio.to_thread(self._credential.get_token, _DECISION_TOKEN_SCOPE) + if inspect.isawaitable(token): + token = await token + return token.token + + async def _post(self, content: bytes, *, deadline: float, execution: DecisionExecution) -> Any: + headers = {"x-ms-useragent": self._user_agent, "Content-Type": "application/json"} + if self._api_key: + headers["api-key"] = self._api_key + else: + try: + headers["Authorization"] = f"Bearer {await self._get_token()}" + except EvaluationException: + raise + except Exception: # pylint: disable=broad-except + raise _failed("Could not acquire a token for the decision model.", ErrorBlame.USER_ERROR) from None + + policies: Dict[str, Any] = { + "custom_hook_policy": execution, + "retry_policy": AsyncRetryPolicy( + retry_total=self._max_retries, + retry_connect=self._max_retries, + retry_read=self._max_retries, + retry_status=self._max_retries, + retry_backoff_factor=0.8, + retry_on_status_codes=_DECISION_RETRY_STATUS_CODES, + ), + "redirect_policy": AsyncRedirectPolicy(permit_redirects=False), + } + remaining = deadline - time.monotonic() + if remaining <= 0: + execution.outcome = "deadline" + raise _failed("The decision model request timed out.") + # Native retry policy carries this budget across attempts and clamps the scalar connect/read timeout. + options: Dict[str, Any] = { + "retry_on_methods": ["POST"], + "timeout": remaining, + "connection_timeout": ( + min(self._timeout_seconds, remaining) if self._timeout_seconds is not None else remaining + ), + } + try: + async with get_async_http_client( + transport=AioHttpTransport(read_timeout=options["connection_timeout"]) + ).with_policies(**policies) as client: + response = await client.post(self._url, content=content, headers=headers, **options) + status = response.status_code + content = response.body() + except EvaluationException: + raise + except Exception: # pylint: disable=broad-except + if time.monotonic() >= deadline: + execution.outcome = "deadline" + raise _failed("The decision model request timed out.") from None + raise _failed("The decision model request failed; check the endpoint and network access.") from None + if self._max_response_bytes is not None and len(content) > self._max_response_bytes: + if status == 200: + raise _failed("The decision response exceeds the configured byte budget.") + payload = None + else: + try: + payload = json.loads(content) + except (ValueError, TypeError): + if status == 200: + raise _failed("The decision model returned invalid JSON.") from None + payload = None + if status != 200: + blame = ErrorBlame.USER_ERROR if status in (400, 401, 403, 404, 422) else ErrorBlame.SYSTEM_ERROR + provider_error = payload.get("error") if isinstance(payload, dict) else None + code = provider_error.get("code") if isinstance(provider_error, dict) else None + diagnostic = ( + f" ({code})" + if isinstance(code, str) and re.fullmatch(r"[A-Za-z][A-Za-z0-9_.-]{0,127}", code) is not None + else "" + ) + error = _failed(f"The decision model returned HTTP {status}{diagnostic}.", blame) + error.properties = self._response_properties(payload) + raise error + return payload + + def _response_properties(self, payload: Any) -> Dict[str, Any]: + """Retain only independently known final-response usage, never raw answers or retry totals.""" + properties: Dict[str, Any] = {"decision_model": {"deployment": self._deployment}} + usage = payload.get("usage") if isinstance(payload, dict) else None + usage = usage if isinstance(usage, dict) else {} + for native_key, key in (("input_tokens", "prompt_tokens"), ("output_tokens", "completion_tokens")): + value = usage.get(native_key) + if isinstance(value, int) and not isinstance(value, bool) and value >= 0: + properties[key] = value + if "prompt_tokens" in properties and "completion_tokens" in properties: + properties["total_tokens"] = properties["prompt_tokens"] + properties["completion_tokens"] + model = payload.get("model") if isinstance(payload, dict) else None + if isinstance(model, str) and model.strip(): + properties["model"] = model + return properties + + @staticmethod + def _validate_response(payload: Any, questions: Dict[str, Dict[str, Any]]) -> Dict[str, Any]: + # Only the response's structure is checked here; answer values are validated by the evaluator after it + # has read the status answer, so a skipped evaluation never depends on an unusable score. + if not isinstance(payload, dict) or not isinstance(payload.get("answers"), dict): + raise ValueError("answers are missing.") + answers = payload["answers"] + if set(answers) != set(questions): + raise ValueError("answer identifiers do not match the questions.") + for question_id, question in questions.items(): + answer = answers[question_id] + question_type = question.get("type") + if not isinstance(answer, dict) or answer.get("type") != question_type: + raise ValueError(f"answer '{question_id}' does not match its question type.") + + usage = payload.get("usage") + if not isinstance(usage, dict): + raise ValueError("usage is missing.") + for name in ("input_tokens", "output_tokens"): + if isinstance(usage.get(name), bool) or not isinstance(usage.get(name), int) or usage[name] < 0: + raise ValueError("usage must contain nonnegative integer token counts.") + model = payload.get("model") + if not isinstance(model, str) or not model.strip(): + raise ValueError("the model identifier is missing.") + return { + "model": model, + "answers": answers, + "usage": {"input_tokens": usage["input_tokens"], "output_tokens": usage["output_tokens"]}, + } diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_prompty_strategy.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_prompty_strategy.py new file mode 100644 index 000000000000..90855bc4bead --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_prompty_strategy.py @@ -0,0 +1,165 @@ +import json +import math +import re +from typing import Any, Callable, Dict, Optional, Tuple + +from azure.ai.evaluation._common.constants import PROMPT_BASED_REASON_EVALUATORS +from azure.ai.evaluation._common.utils import check_score_is_valid, parse_quality_evaluator_reason_score +from azure.ai.evaluation._exceptions import EvaluationException, ErrorBlame, ErrorCategory, ErrorTarget +from ._base_model_eval import ModelEvaluatorBase, not_applicable_result + + +class PromptyEvaluationStrategy: + def __init__( + self, + runner: Callable, + *, + result_key: str, + threshold: float, + timeout: float, + strict: bool = True, + missing_score: Optional[float] = 0, + score_range: Optional[Tuple[int, int]] = None, + error_target: Any = ErrorTarget.EVALUATE, + score_error_target: Any = None, + binary_cutoff: Optional[float] = None, + higher_is_better: bool = True, + completed_alias: Optional[str] = None, + top_level_usage: bool = False, + flow_resolver: Optional[Callable] = None, + ): + self.runner = runner + self.result_key = result_key + self.threshold = threshold + self.timeout = timeout + self.strict = strict + self.missing_score = missing_score + self.score_range = score_range + self.error_target = error_target + self.score_error_target = score_error_target or error_target + self.binary_cutoff = binary_cutoff + self.higher_is_better = higher_is_better + self.completed_alias = completed_alias + self.top_level_usage = top_level_usage + self.flow_resolver = flow_resolver + + async def evaluate(self, eval_input: Dict[str, Any]) -> Dict[str, Any]: + runner = self.flow_resolver() if self.flow_resolver else self.runner + return self.parse(await runner(timeout=self.timeout, **eval_input)) + + def skipped(self, reason: str, threshold: Optional[float] = None) -> Dict[str, Any]: + result = not_applicable_result(self.result_key, reason, self.threshold if threshold is None else threshold) + if self.top_level_usage: + metadata = ModelEvaluatorBase._get_token_metadata({}) + result.update({f"{self.result_key}_{key}": value for key, value in metadata.items()}) + return result + + def parse(self, output: Dict[str, Any]) -> Dict[str, Any]: + if not isinstance(output, dict) or (not self.strict and not output): + self._invalid_output() + answer = output.get("llm_output", output if self.strict else "") + if not self.strict and isinstance(answer, str): + try: + parsed = json.loads(answer) + except (json.JSONDecodeError, TypeError): + parsed = None + if isinstance(parsed, dict) and parsed: + answer = parsed + reason = "" + properties = {} + score = self.missing_score + has_score = False + if isinstance(answer, dict) and (self.strict or answer): + if answer.get("status", "completed") == "skipped": + return self.format_result( + None, + "not_applicable", + f"Not applicable: {answer.get('reason', '')}", + "skipped", + answer.get("properties", {}) or {}, + output, + ) + score = answer.get("score", self.missing_score) + has_score = "score" in answer + reason = answer.get("reason", "") + properties = answer.get("properties", {}) or {} + elif self.strict: + self._invalid_output() + elif isinstance(answer, str): + if self.result_key in PROMPT_BASED_REASON_EVALUATORS: + if self.score_range: + score, reason = parse_quality_evaluator_reason_score( + answer, valid_score_range=r"[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?" + ) + else: + score, reason = parse_quality_evaluator_reason_score(answer) + has_score = not math.isnan(score) + else: + match = re.search( + r"[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?" if self.score_range else r"\d", answer + ) + if match: + score = float(match.group()) + has_score = True + if self.score_range: + minimum, maximum = self.score_range + score_for_error = score + try: + valid_score = ( + has_score and not isinstance(score, bool) and check_score_is_valid(score, minimum, maximum) + ) + except OverflowError: + valid_score = False + # Formatting an oversized integer can also exceed Python's decimal digit limit. + score_for_error = "" + if not valid_score: + raise EvaluationException( + message=f"Invalid score value: {score_for_error}. Expected a number in range [{minimum}, {maximum}].", + internal_message="Invalid score value.", + category=ErrorCategory.FAILED_EXECUTION, + target=self.score_error_target, + blame=ErrorBlame.SYSTEM_ERROR, + ) + score = float(score) if self.strict or score is not None else math.nan + cutoff = self.threshold if self.binary_cutoff is None else self.binary_cutoff + if math.isnan(score) and self.binary_cutoff is None: + verdict = "unknown" + else: + passed = score >= cutoff if self.higher_is_better else score <= cutoff + verdict = "pass" if passed else "fail" + return self.format_result(score, verdict, reason, "completed", properties, output) + + def format_result( + self, + score: Optional[float], + verdict: str, + reason: str, + status: str, + properties: Dict[str, Any], + output: Optional[Dict[str, Any]] = None, + ) -> Dict[str, Any]: + metadata = ModelEvaluatorBase._get_token_metadata(output or {}) + properties.update(metadata) + result = { + self.result_key: score, + f"{self.result_key}_score": score, + f"{self.result_key}_passed": verdict == "pass" if verdict in ("pass", "fail", "unknown") else None, + f"{self.result_key}_result": verdict, + f"{self.result_key}_reason": reason, + f"{self.result_key}_status": status, + f"{self.result_key}_threshold": self.threshold, + f"{self.result_key}_properties": properties, + } + if self.completed_alias and status == "completed": + result[self.completed_alias] = score + if self.top_level_usage: + result.update({f"{self.result_key}_{key}": value for key, value in metadata.items()}) + return result + + def _invalid_output(self) -> None: + raise EvaluationException( + message="Evaluator returned invalid output.", + blame=ErrorBlame.SYSTEM_ERROR, + category=ErrorCategory.FAILED_EXECUTION, + target=self.error_target, + ) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_exceptions.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_exceptions.py index c73dc13bb15a..c499f7196cf7 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_exceptions.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_exceptions.py @@ -4,7 +4,7 @@ """This includes enums and classes for exceptions for use in azure-ai-evaluation.""" from enum import Enum -from typing import Optional +from typing import Any, Dict, Optional from azure.core.exceptions import AzureError @@ -129,6 +129,8 @@ class EvaluationException(AzureError): :type balance: ~azure.ai.evaluation._exceptions.ErrorBlame :param tsg_link: A link to the TSG page for troubleshooting the error. :type tsg_link: str + :param properties: Optional known evaluator metadata retained for failed-row persistence. + :type properties: Optional[Dict[str, Any]] """ def __init__( @@ -140,6 +142,7 @@ def __init__( category: ErrorCategory = ErrorCategory.UNKNOWN, blame: ErrorBlame = ErrorBlame.UNKNOWN, tsg_link: Optional[str] = None, + properties: Optional[Dict[str, Any]] = None, **kwargs, ) -> None: self.category = category @@ -147,6 +150,7 @@ def __init__( self.blame = blame self.internal_message = internal_message self.tsg_link = tsg_link + self.properties = properties super().__init__(message, *args, **kwargs) def __str__(self): diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_legacy/_common/_async_token_provider.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_legacy/_common/_async_token_provider.py index 770b65ced1ca..4509604921c7 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_legacy/_common/_async_token_provider.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_legacy/_common/_async_token_provider.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +import logging import os from typing import Any, AsyncContextManager, Optional @@ -11,10 +12,16 @@ from azure.ai.evaluation._exceptions import EvaluationException, ErrorBlame, ErrorCategory, ErrorTarget from azure.ai.evaluation._azure._envs import AzureEnvironmentClient +logger = logging.getLogger(__name__) + class AsyncAzureTokenProvider(AsyncContextManager["AsyncAzureTokenProvider"]): """Asynchronous token provider for Azure services that supports non-default Azure clouds - (e.g. Azure China, Azure US Government, etc.).""" + (e.g. Azure China, Azure US Government, etc.). + + Closing the provider releases both its internally created synchronous credential and environment client. + Lazy token acquisition remains reusable until the provider is closed. + """ def __init__(self, *, base_url: Optional[str] = None, **kwargs: Any) -> None: """Initialize the AsyncAzureTokenProvider.""" @@ -22,11 +29,16 @@ def __init__(self, *, base_url: Optional[str] = None, **kwargs: Any) -> None: self._env_client: Optional[AzureEnvironmentClient] = AzureEnvironmentClient(base_url=base_url, **kwargs) async def close(self) -> None: - if self._env_client: - await self._env_client.close() - self._env_client = None - + credential, client = self._credential, self._env_client self._credential = None + self._env_client = None + try: + close_credential = getattr(credential, "close", None) + if close_credential is not None: + close_credential() + finally: + if client is not None: + await client.close() async def get_token( self, @@ -50,7 +62,15 @@ async def get_token( return self._credential.get_token(*scopes, claims=claims, tenant_id=tenant_id, enable_cae=enable_cae, **kwargs) async def __aenter__(self) -> "AsyncAzureTokenProvider": - self._credential = await self._initialize_async(self._env_client) + try: + if self._credential is None: + self._credential = await self._initialize_async(self._env_client) + except BaseException: + try: + await self.close() + except Exception as cleanup_error: + logger.warning("Token provider cleanup failed during initialization: %s", type(cleanup_error).__name__) + raise return self async def __aexit__( diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_async_token_provider.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_async_token_provider.py new file mode 100644 index 000000000000..1d3346450b2b --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_async_token_provider.py @@ -0,0 +1,299 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Owned default-provider resources and caller-owned Decision credentials.""" + +import asyncio +import json +import threading +from types import SimpleNamespace +from unittest.mock import AsyncMock, Mock + +import pytest + +from azure.ai.evaluation._legacy._common import _async_token_provider as providers +from azure.ai.evaluation._evaluators._common._model_runners import DecisionModelRunner +from azure.ai.evaluation._exceptions import EvaluationException + +from test_decision_model_support import DECISION_CONFIG, FakeClient, FakeResponse, QUESTIONS, level_payload + + +@pytest.fixture +def resources(monkeypatch): + client = Mock(close=AsyncMock()) + credential = Mock(get_token=Mock(return_value=SimpleNamespace(token="local-token"))) + monkeypatch.setattr(providers, "AzureEnvironmentClient", Mock(return_value=client)) + initialize = AsyncMock(return_value=credential) + monkeypatch.setattr(providers.AsyncAzureTokenProvider, "_initialize_async", initialize) + return client, credential, initialize + + +@pytest.mark.parametrize("failure", [None, RuntimeError, asyncio.CancelledError]) +def test_context_closes_owned_resources_after_token_outcome(resources, failure): + client, credential, _ = resources + if failure: + credential.get_token.side_effect = failure("token failed") + + async def request(): + async with providers.AsyncAzureTokenProvider() as provider: + return await provider.get_token("scope") + + if failure: + with pytest.raises(failure, match="token failed" if failure is RuntimeError else None): + asyncio.run(request()) + else: + assert asyncio.run(request()).token == "local-token" + credential.close.assert_called_once_with() + client.close.assert_awaited_once_with() + + +@pytest.mark.parametrize("failure", [RuntimeError, asyncio.CancelledError]) +def test_failed_context_entry_closes_environment_client(resources, failure): + client, credential, initialize = resources + initialize.side_effect = failure("initialization failed") + + async def request(): + async with providers.AsyncAzureTokenProvider(): + pytest.fail("Context entry must fail") + + with pytest.raises(failure, match="initialization failed" if failure is RuntimeError else None): + asyncio.run(request()) + client.close.assert_awaited_once_with() + credential.close.assert_not_called() + + +def test_lazy_provider_reuses_credential_and_close_is_idempotent(resources): + client, credential, initialize = resources + + async def request(): + provider = providers.AsyncAzureTokenProvider() + await provider.get_token("first") + await provider.get_token("second") + await provider.__aenter__() + await provider.close() + await provider.close() + + asyncio.run(request()) + initialize.assert_awaited_once() + assert credential.get_token.call_count == 2 + credential.close.assert_called_once_with() + client.close.assert_awaited_once_with() + + +def test_repeated_provider_contexts_close_each_owned_provider(monkeypatch): + clients = [Mock(close=AsyncMock()) for _ in range(3)] + credentials = [Mock(get_token=Mock(return_value=SimpleNamespace(token="local-token"))) for _ in range(3)] + monkeypatch.setattr(providers, "AzureEnvironmentClient", Mock(side_effect=clients)) + monkeypatch.setattr(providers.AsyncAzureTokenProvider, "_initialize_async", AsyncMock(side_effect=credentials)) + + async def request(): + for _ in range(3): + async with providers.AsyncAzureTokenProvider() as provider: + await provider.get_token("https://cognitiveservices.azure.com/.default") + + asyncio.run(request()) + for client, credential in zip(clients, credentials): + client.close.assert_awaited_once_with() + credential.close.assert_called_once_with() + + +@pytest.mark.parametrize("cancelled", [False, True]) +def test_failed_entry_preserves_primary_error_when_cleanup_fails(resources, caplog, cancelled): + """Cleanup errors must not replace initialization failures or task cancellation.""" + client, credential, initialize = resources + primary = asyncio.CancelledError("primary cancellation") if cancelled else RuntimeError("primary initialization") + initialize.side_effect = primary + client.close.side_effect = ValueError("private cleanup detail") + + async def request(): + try: + await providers.AsyncAzureTokenProvider().__aenter__() + except type(primary) as error: + # Python 3.10 may replace CancelledError when it crosses the task boundary. + assert error is primary + raise + + with pytest.raises(type(primary)): + asyncio.run(request()) + client.close.assert_awaited_once_with() + credential.close.assert_not_called() + assert "ValueError" in caplog.text + assert "private cleanup detail" not in caplog.text + + +@pytest.mark.parametrize("credential_fails,client_fails", [(True, False), (False, True), (True, True)]) +def test_close_attempts_both_resources_and_exposes_cleanup_failures(resources, credential_fails, client_fails): + client, credential, _ = resources + if credential_fails: + credential.close.side_effect = RuntimeError("credential close failed") + if client_fails: + client.close.side_effect = ValueError("environment close failed") + + async def request(): + provider = providers.AsyncAzureTokenProvider() + await provider.__aenter__() + try: + await provider.close() + finally: + await provider.close() + + expected = ValueError if client_fails else RuntimeError + with pytest.raises(expected) as raised: + asyncio.run(request()) + if credential_fails and client_fails: + assert isinstance(raised.value.__context__, RuntimeError) + credential.close.assert_called_once_with() + client.close.assert_awaited_once_with() + + +@pytest.mark.parametrize("outcome", ["success", "failure", "timeout", "cancelled"]) +def test_explicit_request_credential_ownership_and_worker_cleanup(resources, monkeypatch, outcome): + from azure.ai.evaluation._evaluators._common import _model_runners + + client, credential, _ = resources + http = FakeClient(FakeResponse(body=json.dumps(level_payload(4)).encode())) + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: http) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + entered, release = threading.Event(), threading.Event() + if outcome == "failure": + credential.get_token.side_effect = RuntimeError("private token failure") + elif outcome in ("timeout", "cancelled"): + + def blocked_token(*_, **__): + entered.set() + assert release.wait(2) + return SimpleNamespace(token="local-token") + + credential.get_token.side_effect = blocked_token + + async def request(): + cancel = False + runner = DecisionModelRunner(config, credential, cancellation_requested=lambda: cancel) + task = asyncio.create_task(runner(state={}, questions=QUESTIONS, timeout=0.1 if outcome == "timeout" else 2)) + try: + if outcome in ("timeout", "cancelled"): + while not entered.is_set(): + await asyncio.sleep(0.001) + cancel = outcome == "cancelled" + if outcome == "success": + await task + else: + with pytest.raises(EvaluationException): + await task + finally: + release.set() + + asyncio.run(request()) + credential.close.assert_not_called() + client.close.assert_not_awaited() + assert len(http.calls) == (1 if outcome == "success" else 0) + + +def test_repeated_decision_calls_reuse_caller_credential_without_creating_provider(resources, monkeypatch): + from azure.ai.evaluation._evaluators._common import _model_runners + + client, credential, initialize = resources + http = FakeClient(FakeResponse(body=json.dumps(level_payload(4)).encode())) + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: http) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + runner = DecisionModelRunner(config, credential) + for _ in range(3): + asyncio.run(runner(state={}, questions=QUESTIONS, timeout=1)) + assert len(http.calls) == credential.get_token.call_count == 3 + initialize.assert_not_awaited() + credential.close.assert_not_called() + client.close.assert_not_awaited() + + +def test_prompty_still_constructs_default_provider_when_no_credential_is_supplied(resources): + from azure.ai.evaluation import FluencyEvaluator + from test_decision_model_support import CHAT_CONFIG + + client, credential, initialize = resources + evaluator = FluencyEvaluator({key: value for key, value in CHAT_CONFIG.items() if key != "api_key"}) + provider = evaluator._flow._token_credential + assert isinstance(provider, providers.AsyncAzureTokenProvider) + initialize.assert_not_awaited() + asyncio.run(provider.close()) + client.close.assert_awaited_once_with() + credential.close.assert_not_called() + + +@pytest.mark.parametrize("asynchronous", [False, True]) +@pytest.mark.parametrize("in_config", [False, True]) +@pytest.mark.parametrize("outcome", ["success", "failure", "cancelled"]) +def test_explicit_credentials_remain_caller_owned(monkeypatch, asynchronous, in_config, outcome): + from azure.ai.evaluation._evaluators._common import _model_runners + + http = FakeClient( + FakeResponse(body=json.dumps(level_payload(4)).encode()), delay=0.2 if outcome == "cancelled" else 0 + ) + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: http) + credential = Mock() + token_call = AsyncMock if asynchronous else Mock + credential.get_token = token_call(return_value=SimpleNamespace(token="caller-token")) + if outcome == "failure": + credential.get_token.side_effect = RuntimeError("private token failure") + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + if in_config: + config["credential"] = credential + + async def request(): + cancelled = asyncio.Event() + runner = DecisionModelRunner(config, None if in_config else credential, cancellation_requested=cancelled.is_set) + task = asyncio.create_task(runner(state={}, questions=QUESTIONS, timeout=1)) + if outcome == "cancelled": + while not http.calls: + await asyncio.sleep(0.001) + cancelled.set() + if outcome == "success": + await task + else: + with pytest.raises(EvaluationException): + await task + + asyncio.run(request()) + credential.close.assert_not_called() + + +@pytest.mark.parametrize("asynchronous", [False, True]) +@pytest.mark.parametrize("termination", ["timeout", "cancelled"]) +def test_caller_credential_remains_open_when_authentication_is_interrupted(monkeypatch, asynchronous, termination): + from azure.ai.evaluation._evaluators._common import _model_runners + + http = FakeClient() + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: http) + entered, release = threading.Event(), threading.Event() + credential = Mock() + + def sync_token(*_): + entered.set() + assert release.wait(2) + return SimpleNamespace(token="caller-token") + + async def async_token(*_): + entered.set() + await asyncio.sleep(10) + + credential.get_token = AsyncMock(side_effect=async_token) if asynchronous else Mock(side_effect=sync_token) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + + async def request(): + cancel = False + runner = DecisionModelRunner(config, credential, cancellation_requested=lambda: cancel) + task = asyncio.create_task( + runner(state={}, questions=QUESTIONS, timeout=0.1 if termination == "timeout" else 2) + ) + try: + while not entered.is_set(): + await asyncio.sleep(0.001) + cancel = termination == "cancelled" + with pytest.raises(EvaluationException): + await task + finally: + release.set() + + asyncio.run(request()) + credential.close.assert_not_called() + assert not http.calls diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_batch_persistence.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_batch_persistence.py new file mode 100644 index 000000000000..b5ecfc6c3e72 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_batch_persistence.py @@ -0,0 +1,664 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Decision failure metadata through the actual batch summary and row conversion.""" + +import asyncio +import json +import logging + +import pandas as pd +import pytest +from azure.core.pipeline.transport import AsyncHttpTransport, HttpResponse + +from azure.ai.evaluation import F1ScoreEvaluator +from azure.ai.evaluation._evaluate._batch_run import RunSubmitterClient +from azure.ai.evaluation._evaluate._batch_run._run_submitter_client import _decision_error_metadata +from azure.ai.evaluation._evaluate._evaluate import ( + _calculate_aoai_evaluation_summary, + _convert_single_row_to_aoai_format, + _extract_testing_criteria_metadata, +) +from azure.ai.evaluation._evaluators._common._base_model_eval import ModelEvaluatorBase +from azure.ai.evaluation._evaluators._common._decision_strategy import BinaryScoring, DecisionEvaluationStrategy +from azure.ai.evaluation._evaluators._common._model_runners import DecisionModelRunner +from azure.ai.evaluation._evaluators._common import _model_runners +from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException +from azure.ai.evaluation._http_utils import AsyncHttpPipeline + +pytestmark = pytest.mark.unittest + +CONFIG = { + "type": "decision", + "azure_endpoint": "https://example.services.ai.azure.com", + "azure_deployment": "Decision-1", + "api_key": "test-key-not-for-persistence", +} +QUESTIONS = { + "status": {"type": "noul", "instructions": "Applicable?"}, + "task_completion": {"type": "noul", "instructions": "Completed?"}, +} +CRITERIA = { + "judge": {"metrics": ["task_completion"], "type": "azure_ai_evaluator"}, + "f1": {"metrics": ["f1_score"], "type": "azure_ai_evaluator"}, +} + + +def payload(status=0.9): + return { + "model": "decision-native", + "answers": {"status": {"type": "noul", "noul": status}, "task_completion": {"type": "noul", "noul": 0.9}}, + "usage": {"input_tokens": 120, "output_tokens": 3}, + } + + +@pytest.fixture +def batch_client(): + client = RunSubmitterClient() + try: + yield client + finally: + client._thread_pool.shutdown(wait=True) + + +def convert_batch(client, judge, tmp_path, rows=1, criteria=None): + data = pd.DataFrame([{"query": "synthetic", "response": "synthetic", "ground_truth": "synthetic"}] * rows) + judge_run = client.run(judge, data, evaluator_name="judge", column_mapping={"query": "${data.query}"}) + f1_run = client.run( + F1ScoreEvaluator(), + data, + evaluator_name="f1", + column_mapping={"response": "${data.response}", "ground_truth": "${data.ground_truth}"}, + ) + judge_details = client.get_details(judge_run, all_results=True) + f1_details = client.get_details(f1_run, all_results=True) + summaries = {"judge": client.get_run_summary(judge_run), "f1": client.get_run_summary(f1_run)} + converted = [] + for index in range(rows): + row = {} + for name, details in (("judge", judge_details), ("f1", f1_details)): + for key, value in details.to_dict(orient="records")[index].items(): + row[key.replace("outputs.", f"outputs.{name}.", 1)] = value + converted.append( + _convert_single_row_to_aoai_format( + row, index, None, None, 0, criteria or CRITERIA, summaries, logging.getLogger("test") + ) + ) + path = tmp_path / "persisted.json" + path.write_text(json.dumps(converted, allow_nan=False), encoding="utf-8") + persisted = json.loads(path.read_text(encoding="utf-8")) + for row in persisted: + f1 = next(result for result in row["results"] if result["name"] == "f1") + assert f1["score"] == 1 and f1["status"] == "completed" + assert "error" not in (f1.get("sample") or {}) + return summaries, persisted + + +def strategy(runner): + return DecisionEvaluationStrategy( + runner, + result_key="task_completion", + error_target=ErrorTarget.EVALUATE, + questions=QUESTIONS, + scoring=BinaryScoring(0.75), + threshold=1, + timeout=2, + ) + + +class TestDecisionBatchPersistence: + EXECUTION = { + "operation_id": "a" * 32, + "attempt_count": 1, + "unknown_usage_attempt_count": 0, + "result_usage_scope": "final_response_only", + "usage_completeness": "all_attempts_reported", + } + + @pytest.mark.parametrize("field", ["status_completion_probability", "status_probability_threshold"]) + @pytest.mark.parametrize( + "value", + [ + pytest.param(10**309, id="oversized_positive"), + pytest.param(-(10**309), id="oversized_negative"), + pytest.param(float("nan"), id="nan"), + pytest.param(float("inf"), id="infinity"), + pytest.param(True, id="boolean"), + pytest.param("0.5", id="string"), + ], + ) + def test_invalid_failure_probability_preserves_batch_error_and_usage(self, batch_client, tmp_path, field, value): + error = EvaluationException( + "original custom evaluator failure", + blame=ErrorBlame.USER_ERROR, + category=ErrorCategory.FAILED_EXECUTION, + target=ErrorTarget.EVALUATE, + properties={ + "prompt_tokens": 41, + "completion_tokens": 3, + "total_tokens": 44, + "model": "custom-judge", + "decision_model": {"deployment": "Decision-1", field: value, "usage_available": True}, + }, + ) + + async def judge(query): + raise error + + summaries, rows = convert_batch(batch_client, judge, tmp_path) + metric = next(item for item in rows[0]["results"] if item["name"] == "judge") + assert summaries["judge"]["failed_lines"] == 1 + assert metric["status"] == "error" and metric["score"] is None and metric["passed"] is None + assert metric["sample"]["error"]["code"] == "FAILED_EXECUTION" + assert metric["sample"]["error"]["blame"] == "UserError" + assert metric["sample"]["usage"] == {"prompt_tokens": 41, "completion_tokens": 3, "total_tokens": 44} + assert metric["sample"]["model"] == "custom-judge" + assert field not in metric["properties"]["decision_model"] + assert error.properties["decision_model"][field] is value + + @pytest.mark.parametrize( + "backend,known,attempted", + [("system_one", False, False), ("foundry_decision", False, True), ("system_one", True, True)], + ) + def test_independent_failed_metadata_preserves_distinct_scopes_and_known_fields(self, backend, known, attempted): + expected = { + "backend": backend, + "protocol": "system_one", + "usage_available": known, + "result_usage_scope": "reported_attempts_only", + } + if attempted: + expected["execution"] = { + **self.EXECUTION, + "unknown_usage_attempt_count": int(not known), + "usage_completeness": "all_attempts_reported" if known else "no_attempts_reported", + } + usage = dict(prompt_tokens=41, completion_tokens=3, total_tokens=44, model="independent-model") if known else {} + error = EvaluationException( + "synthetic failure", + properties={ + **usage, + "decision_model": {**expected, "private": "never-persist"}, + "private": "never-persist", + }, + ) + assert _decision_error_metadata(error)["properties"] == {**usage, "decision_model": expected} + + @pytest.mark.parametrize( + "changes", + [ + {"operation_id": "A" * 32}, + {"operation_id": "a" * 31}, + {"operation_id": 42}, + {"attempt_count": True}, + {"attempt_count": -1}, + {"unknown_usage_attempt_count": True}, + {"unknown_usage_attempt_count": -1}, + {"result_usage_scope": "reported_attempts_only"}, + {"usage_completeness": "unknown"}, + {"extra": "private"}, + ], + ) + def test_malformed_independent_summary_is_dropped_not_rewritten(self, changes): + error = EvaluationException( + "synthetic failure", + properties={"decision_model": {"execution": {**self.EXECUTION, **changes}, "usage_available": False}}, + ) + assert _decision_error_metadata(error)["properties"]["decision_model"] == {"usage_available": False} + + def test_failed_metadata_rejects_untyped_and_unrecognized_provenance(self): + error = EvaluationException( + "synthetic failure", + properties={ + "decision_model": { + "backend": "private", + "protocol": ["system_one"], + "usage_available": 1, + "result_usage_scope": True, + "execution": "private", + } + }, + ) + assert _decision_error_metadata(error)["properties"] == {"decision_model": {}} + + @pytest.mark.parametrize("members", [5, 6]) + @pytest.mark.parametrize("case", ["completed", "skipped", "mixed", "semantic_error"]) + @pytest.mark.parametrize("primary_first", [False, True]) + @pytest.mark.parametrize("metadata_source", ["manual", "sdk_instance", "sdk_builtin"]) + def test_shared_composite_request_is_counted_once_for_all_parsed_members( + self, batch_client, tmp_path, monkeypatch, members, case, primary_first, metadata_source + ): + calls = [] + keys = [f"member_{index}" for index in range(members)] + root = "overall" + if metadata_source != "manual": + if members == 6: + root = "output_quality" + keys = [ + "fluency", + "coherence", + "intent_resolution", + "task_adherence", + "groundedness", + "task_completion", + ] + else: + root = "tool_use_quality" + keys = [ + "tool_call_accuracy", + "tool_call_success", + "tool_input_accuracy", + "tool_output_utilization", + "tool_selection", + ] + questions = { + key: {"type": "noul", "instructions": key} for member in keys for key in (member, f"{member}_status") + } + answers = {} + for index, key in enumerate(keys): + status = 0.1 if case == "skipped" or (case == "mixed" and index == 0) else 0.9 + score = ( + float("nan") + if case == "semantic_error" and index == members - 1 + else 0.1 if case == "mixed" and index == members - 1 else 0.9 + ) + answers[key] = {"type": "noul", "noul": score} + answers[f"{key}_status"] = {"type": "noul", "noul": status} + + class Response(HttpResponse): + def __init__(self, request): + super().__init__(request, None) + self.status_code = 200 + self.headers = {} + + def body(self): + return json.dumps( + { + "model": "decision-native", + "answers": answers, + "usage": { + "input_tokens": 120, + "output_tokens": 3, + }, + } + ).encode() + + class Transport(AsyncHttpTransport): + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + calls.append(json.loads(request.body)) + return Response(request) + + monkeypatch.setattr( + _model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=Transport()) + ) + + async def judge(query, runner=None): + if runner is None: + runner = DecisionModelRunner(CONFIG, max_retries=0) + shared = await runner(state={"query": query}, questions=questions, timeout=2) + result = {} + for key in keys: + member_strategy = DecisionEvaluationStrategy( + runner, + result_key=key, + error_target=ErrorTarget.EVALUATE, + questions={"status": questions[f"{key}_status"], key: questions[key]}, + scoring=BinaryScoring(0.75), + threshold=1, + timeout=2, + ) + member_response = { + **shared, + "answers": { + "status": shared["answers"][f"{key}_status"], + key: shared["answers"][key], + }, + } + result.update(member_strategy.parse(member_response, {"query": query})) + result.update( + { + root: None if case == "skipped" else float(case == "completed"), + f"{root}_status": "skipped" if case == "skipped" else "completed", + f"{root}_passed": None if case == "skipped" else case == "completed", + f"{root}_result": ( + "not_applicable" if case == "skipped" else "pass" if case == "completed" else "fail" + ), + f"{root}_prompt_tokens": 120, + f"{root}_completion_tokens": 3, + f"{root}_total_tokens": 123, + f"{root}_model": shared["model"], + } + ) + return result + + criteria = { + **CRITERIA, + "judge": { + "metrics": [root, *keys] if primary_first else [*keys, root], + "type": "azure_ai_evaluator", + "evaluator_name": f"builtin.{root}", + }, + } + evaluator = judge + if metadata_source != "manual": + + class OutputQualityEvaluator(ModelEvaluatorBase): + _supports_decision_models = True + _binary_decision = True + + def __call__(self, *, query): + return super().__call__(query=query) + + async def _do_eval(self, eval_input): + return await judge(eval_input["query"], self._decision_model_runner) + + class ToolUseQualityEvaluator(OutputQualityEvaluator): + pass + + evaluator_class = OutputQualityEvaluator if members == 6 else ToolUseQualityEvaluator + evaluator = evaluator_class(result_key=root, model_config=CONFIG, threshold=1, max_retries=0) + metadata = None + if metadata_source == "sdk_builtin": + metadata = { + "testing_criteria": [ + {"name": "judge", "type": "azure_ai_evaluator", "evaluator_name": f"builtin.{root}"} + ] + } + criteria = _extract_testing_criteria_metadata( + {"judge": evaluator, "f1": F1ScoreEvaluator()}, metadata, None, logging.getLogger("test"), None, None + ) + assert criteria["judge"]["metrics"] == [root, *keys] + assert criteria["judge"]["evaluator_name"] == (root if metadata is None else f"builtin.{root}") + assert criteria["judge"]["is_inverse"] is False + if not primary_first: + criteria["judge"]["metrics"] = [*keys, root] + _, rows = convert_batch(batch_client, evaluator, tmp_path, criteria=criteria) + assert len(calls) == 1 and len(calls[0]["questions"]) == members * 2 + assert {result["metric"] for result in rows[0]["results"] if result["name"] == "judge"} == {root, *keys} + for result in rows[0]["results"]: + if case == "semantic_error" and result["name"] == "judge": + assert result["status"] == "error" and result["score"] is None and result["passed"] is None + assert result["sample"]["error"]["blame"] == "SystemError" + assert result["properties"]["total_tokens"] == 123 + assert "native_answer" not in result["properties"]["decision_model"] + elif result["metric"] in keys: + assert "usage" not in (result.get("sample") or {}) + assert result["properties"]["total_tokens"] == 123 + assert len(result["properties"]["decision_model"]["rubric_hash"]) == 64 + if case == "skipped": + assert result["status"] == "skipped" and result["score"] is None and result["passed"] is None + assert sum("usage" in (result.get("sample") or {}) for result in rows[0]["results"]) == 1 + overall = next(result for result in rows[0]["results"] if result["metric"] == root) + assert overall["sample"]["usage"]["total_tokens"] == 123 + rollup = _calculate_aoai_evaluation_summary(rows, logging.getLogger("test"), criteria) + if metadata_source != "manual": + criteria_rollup = next( + item for item in rollup["per_testing_criteria_results"] if item["testing_criteria"] == "judge" + ) + expected = {"passed": 0, "failed": 0, "skipped": 0, "errored": 0} + expected[ + {"completed": "passed", "mixed": "failed", "skipped": "skipped", "semantic_error": "errored"}[case] + ] = 1 + assert criteria_rollup == {"testing_criteria": "judge", **expected} + assert rollup["per_model_usage"] == [ + { + "model_name": "decision-native", + "invocation_count": 1, + "prompt_tokens": 120, + "completion_tokens": 3, + "total_tokens": 123, + "cached_tokens": 0, + } + ] + + @pytest.mark.parametrize( + "status", [float("nan"), float("inf"), "bad", pytest.param(10**309, id="oversized_integer")] + ) + def test_semantic_failure_retains_measured_usage_and_hashes(self, batch_client, tmp_path, status): + class Runner: + deployment = "Decision-1" + + async def __call__(self, **kwargs): + return payload(status) + + async def judge(query): + return await strategy(Runner()).evaluate({"query": query}) + + summary, rows = convert_batch(batch_client, judge, tmp_path) + result = next(item for item in rows[0]["results"] if item["name"] == "judge") + assert result["status"] == "error" and result["score"] is None and result["passed"] is None + assert result["sample"]["error"]["blame"] == "SystemError" + assert result["sample"]["error"]["code"] == "FAILED_EXECUTION" + assert result["sample"]["usage"] == {"prompt_tokens": 120, "completion_tokens": 3, "total_tokens": 123} + assert result["sample"]["model"] == "decision-native" + assert result["properties"]["total_tokens"] == 123 + assert len(result["properties"]["decision_model"]["rubric_hash"]) == 64 + assert "native_status_answer" not in result["properties"]["decision_model"] + assert summary["judge"]["failed_lines"] == 1 + rollup = _calculate_aoai_evaluation_summary(rows, logging.getLogger("test"), CRITERIA) + assert rollup["per_model_usage"] == [ + { + "model_name": "decision-native", + "invocation_count": 1, + "prompt_tokens": 120, + "completion_tokens": 3, + "total_tokens": 123, + "cached_tokens": 0, + } + ] + + @pytest.mark.parametrize("status, expected", [(0.9, "completed"), (0.1, "skipped")]) + def test_success_and_skip_are_not_stamped_as_errors(self, batch_client, tmp_path, status, expected): + class Runner: + deployment = "Decision-1" + + async def __call__(self, **kwargs): + return payload(status) + + async def judge(query): + return await strategy(Runner()).evaluate({"query": query}) + + summary, rows = convert_batch(batch_client, judge, tmp_path) + result = next(item for item in rows[0]["results"] if item["name"] == "judge") + assert result["status"] == expected + assert "error" not in (result.get("sample") or {}) + assert "per_line_error_metadata" not in summary["judge"] + assert result["sample"]["usage"] == {"prompt_tokens": 120, "completion_tokens": 3, "total_tokens": 123} + assert result["sample"]["model"] == "decision-native" + assert result["properties"]["total_tokens"] == 123 + if expected == "skipped": + assert result["score"] is None and result["passed"] is None + else: + assert result["score"] == 1 and result["passed"] is True + rollup = _calculate_aoai_evaluation_summary(rows, logging.getLogger("test"), CRITERIA) + assert rollup["per_model_usage"] == [ + { + "model_name": "decision-native", + "invocation_count": 1, + "prompt_tokens": 120, + "completion_tokens": 3, + "total_tokens": 123, + "cached_tokens": 0, + } + ] + + @pytest.mark.parametrize( + "case", ["malformed_shape", "invalid_json", "partial_usage", "precancel", "inflight_cancel", "billed_cancel"] + ) + def test_real_pipeline_failure_metadata_survives_batch_conversion(self, batch_client, tmp_path, monkeypatch, case): + cancelled = False + + class Response(HttpResponse): + def __init__(self, request): + super().__init__(request, None) + self.status_code = 429 if case == "billed_cancel" else 200 + self.headers = {"Retry-After": "10"} if case == "billed_cancel" else {} + + def body(self): + if case == "invalid_json": + return b"not-json" + return json.dumps( + { + "model": "decision-native", + "answers": {}, + "usage": {"input_tokens": True if case == "partial_usage" else 12, "output_tokens": 4}, + } + ).encode() + + class Transport(AsyncHttpTransport): + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + nonlocal cancelled + if case == "inflight_cancel": + await asyncio.sleep(10) + if case == "billed_cancel": + cancelled = True + return Response(request) + + monkeypatch.setattr( + _model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=Transport()) + ) + + async def judge(query): + nonlocal cancelled + cancelled = case == "precancel" + handle = None + if case == "inflight_cancel": + + def cancel(): + nonlocal cancelled + cancelled = True + + handle = asyncio.get_running_loop().call_later(0.02, cancel) + try: + runner = DecisionModelRunner( + CONFIG, + max_retries=1, + cancellation_requested=lambda: cancelled, + ) + return await strategy(runner).evaluate({"query": query}) + finally: + if handle is not None: + handle.cancel() + + _, rows = convert_batch(batch_client, judge, tmp_path) + result = next(item for item in rows[0]["results"] if item["name"] == "judge") + assert result["status"] == "error" and result["score"] is None and result["passed"] is None + assert "decision_request_observations" not in result["properties"] + execution = result["properties"]["decision_model"].pop("execution") + assert execution["attempt_count"] == (0 if case == "precancel" else 1) + assert execution["outcome"] == ("cancelled" if "cancel" in case else "error") + assert execution["usage_state"] == ( + "known" + if case in ("malformed_shape", "billed_cancel") + else "partial" if case == "partial_usage" else "unknown" + ) + if case == "malformed_shape": + assert result["sample"]["usage"] == {"prompt_tokens": 12, "completion_tokens": 4, "total_tokens": 16} + assert result["sample"]["model"] == "decision-native" + elif case == "partial_usage": + assert result["sample"]["usage"] == {"completion_tokens": 4} + assert result["sample"]["model"] == "decision-native" + assert "total_tokens" not in result["properties"] and "prompt_tokens" not in result["properties"] + else: + assert "usage" not in result["sample"] and "model" not in result["sample"] + assert result["properties"] == {"decision_model": {"deployment": "Decision-1"}} + if "cancel" in case: + assert result["sample"]["error"]["blame"] == "UserError" + else: + assert result["sample"]["error"]["blame"] == "SystemError" + assert "test-key-not-for-persistence" not in json.dumps(result) + assert "synthetic" not in json.dumps(result["properties"]) + + def test_per_line_classification_and_metadata_do_not_bleed(self, batch_client, tmp_path): + calls = 0 + + async def judge(query): + nonlocal calls + index = calls + calls += 1 + if index == 0: + raise EvaluationException( + "Cancelled.", + category=ErrorCategory.FAILED_EXECUTION, + blame=ErrorBlame.USER_ERROR, + properties={"decision_model": {}}, + ) + if index == 1: + raise EvaluationException( + "Invalid.", + category=ErrorCategory.INVALID_VALUE, + blame=ErrorBlame.SYSTEM_ERROR, + properties={ + "prompt_tokens": 7, + "completion_tokens": True, + "total_tokens": float("nan"), + "evidence": "secret", + "model": "decision-native", + "decision_model": {"rubric_hash": "known", "native_answer": {"noul": float("nan")}}, + }, + ) + return {"task_completion": 1, "task_completion_score": 1, "task_completion_passed": True} + + _, rows = convert_batch(batch_client, judge, tmp_path, rows=3) + first, second, third = [next(item for item in row["results"] if item["name"] == "judge") for row in rows] + assert first["sample"]["error"]["blame"] == "UserError" + assert first["sample"]["error"]["code"] == "FAILED_EXECUTION" + assert second["sample"]["error"]["blame"] == "SystemError" + assert second["sample"]["error"]["code"] == "INVALID VALUE" + assert second["sample"]["usage"] == {"prompt_tokens": 7} + assert second["properties"] == { + "prompt_tokens": 7, + "model": "decision-native", + "decision_model": {"rubric_hash": "known"}, + } + assert third["status"] == "completed" and "error" not in (third.get("sample") or {}) + + def test_other_exceptions_preserve_summary_and_error_row_shape(self, batch_client, tmp_path): + async def judge(query): + raise EvaluationException( + "Ordinary error.", category=ErrorCategory.INVALID_VALUE, blame=ErrorBlame.USER_ERROR + ) + + summaries, rows = convert_batch(batch_client, judge, tmp_path) + assert set(summaries["judge"]) == { + "status", + "duration", + "completed_lines", + "failed_lines", + "log_path", + "per_line_errors", + "error_message", + "error_code", + } + result = next(item for item in rows[0]["results"] if item["name"] == "judge") + assert result == { + "type": "azure_ai_evaluator", + "name": "judge", + "metric": "task_completion", + "score": None, + "label": None, + "reason": None, + "threshold": None, + "passed": None, + "status": "error", + "sample": {"error": {"code": summaries["judge"]["error_code"], "message": "(UserError) Ordinary error."}}, + } diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_conversation_failure.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_conversation_failure.py new file mode 100644 index 000000000000..9a444edc50e3 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_conversation_failure.py @@ -0,0 +1,338 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Failed split conversations retain known usage through public calls and batch conversion.""" + +import asyncio +from copy import deepcopy +import json +import logging +from unittest.mock import Mock + +import pandas as pd +import pytest +from azure.core.pipeline.transport import AsyncHttpTransport, HttpResponse + +from azure.ai.evaluation._evaluate._batch_run import RunSubmitterClient +from azure.ai.evaluation._evaluate._evaluate import _convert_single_row_to_aoai_format +from azure.ai.evaluation._evaluators._common import ModelEvaluatorBase +from azure.ai.evaluation._evaluators._common import _model_runners +from azure.ai.evaluation._evaluators._common._decision_strategy import BinaryScoring, DecisionEvaluationStrategy +from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException +from azure.ai.evaluation._http_utils import AsyncHttpPipeline + +pytestmark = pytest.mark.unittest + +CONFIG = { + "type": "decision", + "azure_endpoint": "https://example.services.ai.azure.com", + "azure_deployment": "Decision-1", + "api_key": "offline-key", +} +QUESTIONS = {"status": {"type": "noul"}, "task_completion": {"type": "noul"}} +CONVERSATION = { + "messages": [ + {"role": "user", "content": "first"}, + {"role": "assistant", "content": "one"}, + {"role": "user", "content": "second"}, + {"role": "assistant", "content": "two"}, + ] +} + + +class SplitDecisionEvaluator(ModelEvaluatorBase): + _supports_decision_models = True + + def __init__(self): + super().__init__(result_key="task_completion", model_config=CONFIG, timeout=1, max_retries=0) + self.error = None + self.original_properties = None + + def _derive_singleton_inputs(self): + return [["query", "response"]] + + async def _do_eval(self, eval_input): + try: + return await DecisionEvaluationStrategy( + self._decision_model_runner, + result_key="task_completion", + error_target=ErrorTarget.EVALUATE, + questions=QUESTIONS, + scoring=BinaryScoring(0.75), + threshold=1, + timeout=self._LLM_CALL_TIMEOUT, + ).evaluate(eval_input) + except EvaluationException as error: + if not {"prompt_tokens", "completion_tokens", "total_tokens"}.intersection(error.properties or {}): + # A caller's unmeasured-turn metadata must not label prior known usage unavailable. + error.properties.setdefault("decision_model", {}).update( + usage_available=False, model="unmeasured-failure-model" + ) + self.error = error + self.original_properties = deepcopy(error.properties) + raise + + +@pytest.mark.parametrize("batch", [False, True], ids=["public", "batch"]) +@pytest.mark.parametrize( + "failure,failed_turn,mixed", + [ + ("semantic", 1, False), + ("semantic", 1, True), + ("partial", 1, False), + ("timeout", 1, False), + ("semantic", 0, False), + ("timeout", 0, False), + ], +) +def test_failed_split_conversation_preserves_known_usage(monkeypatch, tmp_path, batch, failure, failed_turn, mixed): + calls = [] + + class Response(HttpResponse): + def __init__(self, request, body): + super().__init__(request, None) + self.status_code, self.headers, self._body = 200, {}, body + + def body(self): + return self._body + + class Transport(AsyncHttpTransport): + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + failing = len(calls) == failed_turn + calls.append(json.loads(request.body)) + if failing and failure == "timeout": + await asyncio.sleep(5) + body = { + "model": "other-model" if failing and mixed else "same-model", + "usage": {"input_tokens": 34 if failing else 12, "output_tokens": 5 if failing else 3}, + "answers": { + "status": {"type": "noul", "noul": 0.9}, + "task_completion": {"type": "noul", "noul": 2 if failing else 0.9}, + }, + } + if failing and failure == "partial": + body["usage"]["input_tokens"] = True + return Response(request, json.dumps(body).encode()) + + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=Transport())) + evaluator = SplitDecisionEvaluator() + if batch: + client = RunSubmitterClient() + try: + run = client.run( + evaluator, + pd.DataFrame([{"conversation": CONVERSATION}]), + evaluator_name="judge", + column_mapping={"conversation": "${data.conversation}"}, + ) + details = client.get_details(run, all_results=True).to_dict(orient="records")[0] + summary = client.get_run_summary(run) + row = {key.replace("outputs.", "outputs.judge.", 1): value for key, value in details.items()} + converted = _convert_single_row_to_aoai_format( + row, + 0, + None, + None, + 0, + {"judge": {"metrics": ["task_completion"], "type": "azure_ai_evaluator"}}, + {"judge": summary}, + logging.getLogger("test"), + ) + path = tmp_path / "failed-conversation.json" + path.write_text(json.dumps(converted, allow_nan=False), encoding="utf-8") + result = json.loads(path.read_text(encoding="utf-8"))["results"][0] + assert summary["failed_lines"] == 1 and summary["completed_lines"] == 0 + assert result["status"] == "error" and result["score"] is None and result["passed"] is None + assert result["sample"]["error"]["code"] == "FAILED_EXECUTION" + assert result["sample"]["error"]["blame"] == "SystemError" + properties = result["properties"] + finally: + client._thread_pool.shutdown(wait=True) + else: + with pytest.raises(EvaluationException) as raised: + evaluator(conversation=CONVERSATION) + assert raised.value is evaluator.error + assert raised.value.category == ErrorCategory.FAILED_EXECUTION + assert raised.value.blame == ErrorBlame.SYSTEM_ERROR + properties = raised.value.properties + + assert len(calls) == failed_turn + 1 + if failed_turn: + expected = {"prompt_tokens": 46, "completion_tokens": 8, "total_tokens": 54} + if failure == "timeout": + expected = {"prompt_tokens": 12, "completion_tokens": 3, "total_tokens": 15} + elif failure == "partial": + expected = {"prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 15} + assert {field: properties[field] for field in expected} == expected + assert properties["decision_model"]["result_usage_scope"] == "reported_turns_only" + assert properties["decision_model"]["usage_available"] is True + assert "execution" not in properties["decision_model"] + if mixed: + assert "model" not in properties and "model" not in properties["decision_model"] + else: + assert properties["model"] == "same-model" + assert properties["decision_model"]["model"] == "same-model" + if batch: + assert result["sample"]["usage"] == expected + assert result["sample"].get("model") == (None if mixed else "same-model") + else: + assert "result_usage_scope" not in properties["decision_model"] + assert properties["decision_model"]["execution"]["attempt_count"] == 1 + if failure == "semantic": + assert properties["total_tokens"] == 39 + else: + assert not {"prompt_tokens", "completion_tokens", "total_tokens"}.intersection(properties) + if not batch: + assert properties == evaluator.original_properties + + +@pytest.mark.parametrize("failed_turn", [0, 1]) +def test_direct_task_cancellation_preserves_completed_usage_and_closes_transports(monkeypatch, failed_turn): + """Direct task cancellation retains paid earlier turns without changing its exception type.""" + transports = [] + + async def scenario(): + entered = asyncio.Event() + + class Response(HttpResponse): + def __init__(self, request): + super().__init__(request, None) + self.status_code, self.headers = 200, {} + + def body(self): + return json.dumps( + { + "model": "known-model", + "usage": {"input_tokens": 12, "output_tokens": 3}, + "answers": { + "status": {"type": "noul", "noul": 1}, + "task_completion": {"type": "noul", "noul": 1}, + }, + } + ).encode() + + class Transport(AsyncHttpTransport): + def __init__(self): + self.index = len(transports) + self.closed = False + transports.append(self) + + async def open(self): + pass + + async def close(self): + self.closed = True + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + if self.index == failed_turn: + entered.set() + await asyncio.sleep(10) + raise AssertionError("The cancelled request must not complete") + return Response(request) + + monkeypatch.setattr( + _model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=Transport()) + ) + evaluator = SplitDecisionEvaluator() + cancellations = [] + + async def evaluate(): + try: + return await evaluator._to_async()(conversation=CONVERSATION) + except asyncio.CancelledError as error: + # Observe metadata before Python 3.10 replaces the task's cancellation exception. + cancellations.append(error) + raise + + task = asyncio.create_task(evaluate()) + await asyncio.wait_for(entered.wait(), timeout=2) + task.cancel() + with pytest.raises(asyncio.CancelledError): + await task + assert task.cancelled() + assert len(cancellations) == 1 + properties = cancellations[0].properties + if failed_turn: + assert {field: properties[field] for field in ("prompt_tokens", "completion_tokens", "total_tokens")} == { + "prompt_tokens": 12, + "completion_tokens": 3, + "total_tokens": 15, + } + assert properties["model"] == "known-model" + assert properties["decision_model"]["result_usage_scope"] == "reported_turns_only" + assert "execution" not in properties["decision_model"] + else: + assert not {"prompt_tokens", "completion_tokens", "total_tokens"}.intersection(properties) + assert properties["decision_model"]["execution"]["outcome"] == "cancelled" + assert len(transports) == failed_turn + 1 + assert all(transport.closed for transport in transports) + + asyncio.run(scenario()) + + +def test_cancelled_error_without_properties_can_retain_known_turn_metadata(): + """The shared hook also accepts cancellation before the runner attaches a carrier.""" + evaluator = SplitDecisionEvaluator() + error = asyncio.CancelledError() + evaluator._on_evaluation_error( + error, + [ + { + "task_completion_prompt_tokens": 12, + "task_completion_completion_tokens": 3, + "task_completion_total_tokens": 15, + "task_completion_model": "known-model", + } + ], + ) + assert error.properties["total_tokens"] == 15 + assert error.properties["decision_model"]["usage_available"] is True + + +def test_prompty_split_failure_preserves_existing_exception(monkeypatch): + monkeypatch.setattr(_model_runners.AsyncPrompty, "load", Mock()) + error = EvaluationException( + message="chat failure", + internal_message="chat failure", + target=ErrorTarget.EVALUATE, + category=ErrorCategory.INVALID_VALUE, + blame=ErrorBlame.USER_ERROR, + ) + error.properties = {"model": "chat-model", "total_tokens": 39, "custom": "unchanged"} + original = deepcopy(error.properties) + + class ChatEvaluator(ModelEvaluatorBase): + def _derive_singleton_inputs(self): + return [["query", "response"]] + + async def _do_eval(self, eval_input): + if eval_input["query"] == "second": + raise error + return {"metric": 1, "metric_total_tokens": 15, "metric_model": "chat-model"} + + evaluator = ChatEvaluator( + result_key="metric", + prompty_file="unused.prompty", + model_config={ + "azure_endpoint": "https://example.openai.azure.com", + "azure_deployment": "chat", + "api_key": "offline-key", + }, + ) + with pytest.raises(EvaluationException) as raised: + evaluator(conversation=CONVERSATION) + assert raised.value is error and error.properties == original + assert error.category == ErrorCategory.INVALID_VALUE and error.blame == ErrorBlame.USER_ERROR diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_default_transport.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_default_transport.py new file mode 100644 index 000000000000..d8d0a43b9aaf --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_default_transport.py @@ -0,0 +1,481 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Actual localhost HTTP coverage for Decision async HTTP and the unchanged shared requests transport.""" + +import asyncio +import json +import threading +import time +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer + +import pytest +import aiohttp +import requests + +from azure.ai.evaluation._evaluators._common._model_runners import DecisionModelRunner +from azure.ai.evaluation._evaluators._common._model_runners import validated_execution +from azure.ai.evaluation._evaluators._common._base_model_eval import ModelEvaluatorBase +from azure.ai.evaluation._exceptions import ErrorBlame, EvaluationException +from azure.ai.evaluation._http_utils import get_async_http_client +from azure.core.pipeline.policies import AsyncRetryPolicy +from azure.core.pipeline.transport import AsyncioRequestsTransport +from azure.core.exceptions import ServiceRequestTimeoutError + +pytestmark = pytest.mark.unittest +QUESTIONS = {"status": {"type": "noul", "instructions": "Applicable?"}} + + +@pytest.fixture +def localhost(): + calls = [] + delay = [0] + statuses = [200] + payload = { + "model": "native-decision", + "answers": {"status": {"type": "noul", "noul": 0.9}}, + "usage": {"input_tokens": 12, "output_tokens": 4}, + } + + class Handler(BaseHTTPRequestHandler): + def log_message(self, *_): + pass + + def do_POST(self): + body = self.rfile.read(int(self.headers["Content-Length"])) + calls.append({"path": self.path, "body": body, "content_type": self.headers.get("Content-Type")}) + time.sleep(delay[0]) + content = json.dumps(payload).encode() + self.send_response(statuses.pop(0) if len(statuses) > 1 else statuses[0]) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(content))) + self.end_headers() + try: + self.wfile.write(content) + except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError): + pass + + server = ThreadingHTTPServer(("127.0.0.1", 0), Handler) + thread = threading.Thread(target=server.serve_forever) + thread.start() + try: + yield f"http://127.0.0.1:{server.server_port}", calls, delay, statuses + finally: + server.shutdown() + server.server_close() + thread.join() + + +def invoke(endpoint, timeout=3, **controls): + runner = DecisionModelRunner( + {"type": "decision", "azure_endpoint": endpoint, "azure_deployment": "Decision-1", "api_key": "local-test"}, + **controls, + ) + return asyncio.run(runner(state={"query": "é"}, questions=QUESTIONS, timeout=timeout)) + + +def assert_failure_execution(error, attempts, outcome): + assert set(error.properties) == {"decision_model"} + native = error.properties["decision_model"] + assert set(native) == {"deployment", "execution"} and native["deployment"] == "Decision-1" + execution = native["execution"] + assert validated_execution(execution) == execution + assert execution["attempt_count"] == attempts and execution["retry_count"] == max(0, attempts - 1) + assert execution["outcome"] == outcome + + +class SynchronousDecisionEvaluator(ModelEvaluatorBase): + _supports_decision_models = True + + def __call__(self, *, query): + return super().__call__(query=query) + + async def _do_eval(self, eval_input): + return await self._decision_model_runner(state=eval_input, questions=QUESTIONS, timeout=self._LLM_CALL_TIMEOUT) + + +@pytest.mark.parametrize("timeout,timeout_seconds", [(0.05, None), (0.2, 0.02), (0.05, 0.2)]) +def test_public_synchronous_overall_timeout_bounds_native_async_transport( + localhost, monkeypatch, timeout, timeout_seconds +): + endpoint, calls, delay, _ = localhost + delay[0] = 0.65 + observed = [] + original = aiohttp.ClientSession.request + + def record(session, *args, **kwargs): + observed.append(kwargs["timeout"].sock_connect) + return original(session, *args, **kwargs) + + monkeypatch.setattr(aiohttp.ClientSession, "request", record) + evaluator = SynchronousDecisionEvaluator( + result_key="status", + model_config={ + "type": "decision", + "azure_endpoint": endpoint, + "azure_deployment": "Decision-1", + "api_key": "local-test", + }, + timeout=timeout, + timeout_seconds=timeout_seconds, + max_retries=0, + ) + started = time.monotonic() + with pytest.raises(EvaluationException) as raised: + evaluator(query="synthetic") + elapsed = time.monotonic() - started + print(f"Entire public synchronous evaluator call: {elapsed:.3f}s") + assert elapsed < 0.4 + if ( + timeout_seconds is not None + and timeout_seconds < timeout + and isinstance(raised.value.__context__, ServiceRequestTimeoutError) + ): + assert not calls + else: + assert len(calls) == 1 + bound = min(timeout, timeout_seconds) if timeout_seconds is not None else timeout + assert len(observed) == 1 and 0 < observed[0] <= bound + 1e-8 + if timeout_seconds is None or timeout_seconds > timeout: + assert "timed out" in str(raised.value) + assert_failure_execution( + raised.value, 1, "deadline" if timeout_seconds is None or timeout_seconds > timeout else "error" + ) + + +def test_public_synchronous_authentication_consumes_transport_deadline(localhost, monkeypatch): + endpoint, calls, delay, _ = localhost + delay[0] = 0.65 + observed = [] + original = aiohttp.ClientSession.request + + def record(session, *args, **kwargs): + observed.append(kwargs["timeout"].sock_connect) + return original(session, *args, **kwargs) + + class Credential: + async def get_token(self, *_): + await asyncio.sleep(0.08) + from azure.core.credentials import AccessToken + + return AccessToken("local-test", 9999999999) + + monkeypatch.setattr(aiohttp.ClientSession, "request", record) + evaluator = SynchronousDecisionEvaluator( + result_key="status", + model_config={"type": "decision", "azure_endpoint": endpoint, "azure_deployment": "Decision-1"}, + credential=Credential(), + timeout=0.15, + max_retries=0, + ) + started = time.monotonic() + with pytest.raises(EvaluationException, match="timed out"): + evaluator(query="synthetic") + assert time.monotonic() - started < 0.4 + assert len(calls) == 1 and len(observed) == 1 + assert 0 < observed[0] <= 0.075 + + +@pytest.mark.parametrize("first_request_delay", [0, 0.16]) +def test_public_synchronous_retries_and_backoff_share_remaining_deadline(localhost, monkeypatch, first_request_delay): + endpoint, calls, delay, statuses = localhost + delay[0] = 0.04 + statuses[:] = [429, 429, 200] + observed = [] + original = aiohttp.ClientSession.request + + def record(session, *args, **kwargs): + if not observed: + time.sleep(first_request_delay) + observed.append(kwargs["timeout"].sock_connect) + return original(session, *args, **kwargs) + + monkeypatch.setattr(aiohttp.ClientSession, "request", record) + evaluator = SynchronousDecisionEvaluator( + result_key="status", + model_config={ + "type": "decision", + "azure_endpoint": endpoint, + "azure_deployment": "Decision-1", + "api_key": "local-test", + }, + # Allow scheduling headroom for two responses, but expire before the native 1.6s backoff. + timeout=0.8, + max_retries=3, + ) + started = time.monotonic() + with pytest.raises(EvaluationException, match="timed out") as raised: + evaluator(query="synthetic") + assert time.monotonic() - started < 1.2 + assert len(calls) == len(observed) == 2 + assert 0 < observed[1] <= observed[0] - 0.03 + assert observed[0] <= 0.8 + 1e-8 + assert_failure_execution(raised.value, 2, "deadline") + + +def test_default_transport_sends_policy_request_and_retries(localhost, monkeypatch): + endpoint, calls, _, statuses = localhost + statuses[:] = [429, 200] + observed_timeouts = [] + socket_read_timeouts = [] + original = aiohttp.ClientSession.request + + def record(session, *args, **kwargs): + observed_timeouts.append(kwargs["timeout"].sock_connect) + socket_read_timeouts.append(kwargs["timeout"].sock_read) + assert "read_timeout" not in kwargs and "connection_timeout" not in kwargs + return original(session, *args, **kwargs) + + monkeypatch.setattr(aiohttp.ClientSession, "request", record) + result = invoke(endpoint, timeout_seconds=0.5, max_retries=1) + assert result["usage"] == {"input_tokens": 12, "output_tokens": 4} + assert observed_timeouts == [0.5, 0.5] + assert socket_read_timeouts == [0.5, 0.5] + assert len(calls) == 2 and calls[0]["body"] == calls[1]["body"] + assert calls[0]["path"] == "/providers/microsoft/v1/systemone" + assert calls[0]["content_type"] == "application/json" + assert json.loads(calls[0]["body"]) == {"model": "Decision-1", "state": {"query": "é"}, "questions": QUESTIONS} + assert b"\xc3\xa9" in calls[0]["body"] + + +def test_default_transport_read_timeout_is_enforced(localhost): + endpoint, calls, delay, _ = localhost + delay[0] = 0.5 + started = time.monotonic() + with pytest.raises(EvaluationException) as raised: + invoke(endpoint, timeout_seconds=0.05, max_retries=0) + assert time.monotonic() - started < 0.4 + assert len(calls) == 1 + assert_failure_execution(raised.value, 1, "error") + + +def test_default_transport_native_scalar_timeout_preserves_numeric_retry_deadline(localhost, monkeypatch): + endpoint, _, _, _ = localhost + original = requests.Session.request + observed = [] + + def record(session, *args, **kwargs): + observed.append(kwargs["timeout"]) + return original(session, *args, **kwargs) + + monkeypatch.setattr(requests.Session, "request", record) + + async def request(): + async with get_async_http_client(retry_policy=AsyncRetryPolicy(retry_total=0)) as client: + return await client.post(endpoint, content=b"{}", connection_timeout=2, timeout=0.8) + + assert asyncio.run(request()).status_code == 200 + assert 0 < observed[0] <= 0.8 + + +def test_default_transport_without_read_override_preserves_scalar_timeout(localhost, monkeypatch): + endpoint, _, _, _ = localhost + original = requests.Session.request + observed = [] + + def record(session, *args, **kwargs): + observed.append(kwargs["timeout"]) + return original(session, *args, **kwargs) + + monkeypatch.setattr(requests.Session, "request", record) + + async def request(): + async with get_async_http_client() as client: + return await client.post(endpoint, content=b"{}", connection_timeout=0.7) + + assert asyncio.run(request()).status_code == 200 + assert observed == [0.7] + + +def test_decision_preserves_factory_injected_requests_transport(localhost, monkeypatch): + from azure.ai.evaluation._evaluators._common import _model_runners + + endpoint, calls, _, _ = localhost + observed = [] + original = requests.Session.request + + def record(session, *args, **kwargs): + observed.append(kwargs["timeout"]) + assert "read_timeout" not in kwargs + return original(session, *args, **kwargs) + + monkeypatch.setattr(requests.Session, "request", record) + monkeypatch.setattr( + _model_runners, + "get_async_http_client", + lambda **_: get_async_http_client(transport=AsyncioRequestsTransport()), + ) + assert invoke(endpoint, timeout_seconds=0.7)["usage"] == {"input_tokens": 12, "output_tokens": 4} + assert observed == [0.7] + assert len(calls) == 1 + + +def test_repeated_public_calls_close_async_sessions_on_their_own_loops(localhost, monkeypatch): + endpoint, calls, _, _ = localhost + closed = [] + original_close = aiohttp.ClientSession.close + + async def close(session): + await original_close(session) + closed.append((session, asyncio.get_running_loop())) + + monkeypatch.setattr(aiohttp.ClientSession, "close", close) + evaluator = SynchronousDecisionEvaluator( + result_key="status", + model_config={ + "type": "decision", + "azure_endpoint": endpoint, + "azure_deployment": "Decision-1", + "api_key": "local-test", + }, + ) + for _ in range(2): + assert evaluator(query="synthetic")["usage"] == {"input_tokens": 12, "output_tokens": 4} + assert len(calls) == len(closed) == 2 + assert all(session.closed and loop.is_closed() for session, loop in closed) + assert closed[0][1] is not closed[1][1] + + +def test_default_transport_cancellation_interrupts_awaiting_a_real_request(localhost): + endpoint, calls, delay, _ = localhost + delay[0] = 0.5 + + async def request(): + cancelled = asyncio.Event() + runner = DecisionModelRunner( + {"type": "decision", "azure_endpoint": endpoint, "azure_deployment": "Decision-1", "api_key": "local-test"}, + timeout_seconds=1, + max_retries=0, + cancellation_requested=cancelled.is_set, + ) + started = time.monotonic() + handle = asyncio.get_running_loop().call_later(0.05, cancelled.set) + try: + with pytest.raises(EvaluationException, match="cancelled") as raised: + await runner(state={}, questions=QUESTIONS, timeout=3) + assert time.monotonic() - started < 0.4 + assert raised.value.blame == ErrorBlame.USER_ERROR + assert_failure_execution(raised.value, 1, "cancelled") + finally: + handle.cancel() + + asyncio.run(request()) + assert len(calls) == 1 + + +@pytest.fixture +def trickling_endpoint(): + sent = [] + disconnected = threading.Event() + disconnected_at = [] + payload = json.dumps( + { + "model": "native-decision", + "answers": {"status": {"type": "noul", "noul": 0.9}}, + "usage": {"input_tokens": 12, "output_tokens": 4}, + "padding": "x" * 160, + } + ).encode() + + class Handler(BaseHTTPRequestHandler): + def log_message(self, *_): + pass + + def do_POST(self): + self.rfile.read(int(self.headers["Content-Length"])) + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(payload))) + self.end_headers() + for offset in range(0, len(payload), 4): + try: + self.wfile.write(payload[offset : offset + 4]) + self.wfile.flush() + sent.append(len(payload[offset : offset + 4])) + except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError): + disconnected_at.append(time.monotonic()) + disconnected.set() + break + time.sleep(0.03) + + server = ThreadingHTTPServer(("127.0.0.1", 0), Handler) + thread = threading.Thread(target=server.serve_forever) + thread.start() + try: + yield f"http://127.0.0.1:{server.server_port}", sent, disconnected, disconnected_at, len(payload) + finally: + server.shutdown() + server.server_close() + thread.join() + + +@pytest.mark.parametrize("batch", [False, True], ids=["public_sync", "batch"]) +@pytest.mark.parametrize("cancel", [False, True], ids=["deadline", "cancellation"]) +def test_trickling_body_is_stopped_by_overall_deadline_or_cancellation(trickling_endpoint, monkeypatch, batch, cancel): + import pandas as pd + + from azure.ai.evaluation._evaluate._batch_run import RunSubmitterClient + + endpoint, sent, disconnected, disconnected_at, length = trickling_endpoint + closed_sessions = [] + original_close = aiohttp.ClientSession.close + + async def close(session): + await original_close(session) + closed_sessions.append(session) + + monkeypatch.setattr(aiohttp.ClientSession, "close", close) + cancelled = threading.Event() + evaluator = SynchronousDecisionEvaluator( + result_key="status", + model_config={ + "type": "decision", + "azure_endpoint": endpoint, + "azure_deployment": "Decision-1", + "api_key": "local-test", + }, + timeout=3 if cancel else 0.2, + cancellation_requested=cancelled.is_set if cancel else None, + max_retries=0, + ) + client = RunSubmitterClient() if batch else None + timer = threading.Timer(0.2, cancelled.set) if cancel else None + try: + if timer: + timer.start() + started = time.monotonic() + if client: + run = client.run( + evaluator, + pd.DataFrame([{"query": "synthetic"}]), + evaluator_name="judge", + column_mapping={"query": "${data.query}"}, + ) + summary = client.get_run_summary(run) + assert summary["failed_lines"] == 1 + assert summary["completed_lines"] == 0 + else: + with pytest.raises(EvaluationException, match="cancelled" if cancel else "timed out") as raised: + evaluator(query="synthetic") + assert_failure_execution(raised.value, 1, "cancelled" if cancel else "deadline") + elapsed = time.monotonic() - started + # The existing batch engine polls run completion every second; the HTTP read must stop sooner. + assert elapsed < (1.5 if batch else 0.8) + assert 0 < sum(sent) < length + assert disconnected.wait(0.5), "The server must observe the HTTP body read stopping." + assert disconnected_at[0] - started < 0.8 + assert len(closed_sessions) == 1 and closed_sessions[0].closed + stopped_at = sum(sent) + time.sleep(0.09) + assert sum(sent) == stopped_at < length + print( + f"batch={batch} cancel={cancel}: returned={elapsed:.3f}s disconnected=" + f"{disconnected_at[0] - started:.3f}s bytes={stopped_at}/{length}" + ) + finally: + if timer: + timer.cancel() + timer.join() + if client: + client._thread_pool.shutdown(wait=True) diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_model_support.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_model_support.py new file mode 100644 index 000000000000..c9596a76d7f9 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_decision_model_support.py @@ -0,0 +1,2041 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +"""Offline tests for shared decision-model runners, base selection, and evaluation strategy.""" + +import asyncio +import hashlib +import json +import logging +import math +import sys +import threading +from copy import deepcopy +from logging.handlers import BufferingHandler +from concurrent.futures import ThreadPoolExecutor +from types import SimpleNamespace +from unittest.mock import AsyncMock, Mock, call, patch + +import pytest +from openai.types.chat import ChatCompletion +from azure.core.pipeline.policies import AsyncRedirectPolicy, AsyncRetryPolicy +from azure.core.pipeline.transport import AsyncHttpTransport, HttpResponse +from azure.core.exceptions import ServiceRequestError + +from azure.ai.evaluation import CoherenceEvaluator, FluencyEvaluator +from azure.ai.evaluation._evaluators._common import EvaluatorBase, ModelEvaluatorBase, PromptyEvaluatorBase +from azure.ai.evaluation._evaluators._common import _model_runners +from azure.ai.evaluation._evaluators._common._decision_strategy import ( + BinaryScoring, + DecisionEvaluationStrategy, + LikertScoring, +) +from azure.ai.evaluation._evaluators._common._model_runners import ( + DecisionModelRunner, + PromptyModelRunner, + validate_noul_answer, + validate_score_answer, +) +from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException +from azure.ai.evaluation._evaluators._common._model_runners import DecisionExecution, validated_execution + +pytestmark = pytest.mark.unittest + +DECISION_CONFIG = { + "type": "decision", + "azure_endpoint": "https://example.services.ai.azure.com", + "azure_deployment": "Decision-1", + "api_key": "test-key-value", +} +CHAT_CONFIG = { + "azure_endpoint": "https://example.openai.azure.com", + "azure_deployment": "chat-deployment", + "api_key": "chat-key", +} + + +def score_answer(levels): + """A consistent five-level score answer for the given level probabilities.""" + return { + "type": "score", + "score": sum(index * value for index, value in enumerate(levels)), + "confidence": max(levels), + "probabilities": {str(index): value for index, value in enumerate(levels)}, + } + + +def decision_payload(status=0.95, result=None, model="microsoft-decision-1", usage=(120, 3), **answers): + payload = { + "model": model, + "answers": {"status": {"type": "noul", "noul": status}}, + "usage": {"input_tokens": usage[0], "output_tokens": usage[1]}, + } + if result is not None: + payload["answers"].update(result) + payload["answers"].update(answers) + return payload + + +def level_payload(level, status=0.95): + levels = [0.0] * 5 + levels[level] = 1.0 + return decision_payload(status, {"tool_call_accuracy": score_answer(levels)}) + + +class FakeResponse(HttpResponse): + def __init__(self, status_code=200, body=b"{}", request=None): + super().__init__(request, None) + self.status_code = status_code + self._body = body + + def body(self): + return self._body + + +class FakeClient: + def __init__(self, response=None, delay=0.0): + self.response = response or FakeResponse() + self.delay = delay + self.calls = [] + self.policies = None + + def with_policies(self, **policies): + self.policies = policies + return self + + async def __aenter__(self): + return self + + async def __aexit__(self, *_): + return False + + async def post(self, url, content=None, headers=None, **options): + self.calls.append( + {"url": url, "json": json.loads(content), "content": content, "headers": dict(headers), "options": options} + ) + if self.delay: + await asyncio.sleep(self.delay) + return self.response + + +@pytest.fixture +def client(monkeypatch): + fake = FakeClient() + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: fake) + return fake + + +QUESTIONS = { + "status": {"type": "noul", "instructions": "Applicable?"}, + "tool_call_accuracy": {"type": "score", "instructions": "How accurate?", "criteria": ["a", "b", "c", "d", "e"]}, +} + + +def run(runner, **overrides): + arguments = {"state": {"query": "q"}, "questions": QUESTIONS, "timeout": 5} + arguments.update(overrides) + return asyncio.run(runner(**arguments)) + + +class TestDecisionModelRunnerConfiguration: + @pytest.mark.parametrize( + "changes", + [ + {"type": "azure_openai"}, + {"extra": "field"}, + {"azure_endpoint": None}, + {"azure_endpoint": " "}, + {"azure_deployment": " "}, + {"azure_deployment": None}, + {"api_key": " "}, + {"probability_threshold": 0.5}, + ], + ) + def test_invalid_configuration_is_a_user_error(self, changes): + config = {**DECISION_CONFIG, **changes} + with pytest.raises(EvaluationException) as raised: + DecisionModelRunner(config) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert "secret" not in str(raised.value) + + @pytest.mark.parametrize("value", [True, "0.5", None, float("nan"), -0.1, 1.1]) + def test_invalid_probability_threshold(self, value): + with pytest.raises(EvaluationException): + DecisionModelRunner({**DECISION_CONFIG, "probability_threshold": value}, binary=True) + + @pytest.mark.parametrize( + "endpoint", + [ + "https://example.services.ai.azure.com", + "https://example.services.ai.azure.com/", + "http://example.services.ai.azure.com", + "https://user:secret@example.services.ai.azure.com", + "https://example.services.ai.azure.com?x=1", + "https://example.services.ai.azure.com#fragment", + "https://example.services.ai.azure.com/api/projects/proj", + "not-a-url", + ], + ) + def test_endpoint_requires_secure_resource_url(self, endpoint): + if endpoint in ( + "https://example.services.ai.azure.com", + "https://example.services.ai.azure.com/", + "https://example.services.ai.azure.com/api/projects/proj", + ): + runner = DecisionModelRunner({**DECISION_CONFIG, "azure_endpoint": endpoint}) + assert runner._url == endpoint.rstrip("/") + "/providers/microsoft/v1/systemone" + else: + with pytest.raises(EvaluationException, match="HTTPS"): + DecisionModelRunner({**DECISION_CONFIG, "azure_endpoint": endpoint}) + + @pytest.mark.parametrize( + "endpoint", + ["http://localhost:8080", "http://LOCALHOST", "http://127.0.0.1:8080", "http://127.1.2.3", "http://[::1]:8080"], + ) + def test_http_is_allowed_for_loopback(self, endpoint): + runner = DecisionModelRunner({**DECISION_CONFIG, "azure_endpoint": endpoint}) + assert runner._url == endpoint.rstrip("/") + "/providers/microsoft/v1/systemone" + + @pytest.mark.parametrize("authentication", ["key", "credential", "default"]) + @pytest.mark.parametrize( + "endpoint", + [ + "http://example.services.ai.azure.com", + "http://localhost.example.com", + "http://example-localhost", + "http://127.0.0.1.example.com", + "http://localhost@evil.example", + "http://evil.example@localhost", + "http://0.0.0.0", + "http://192.168.1.1", + "http://[::2]", + "http://local\thost", + "https://example.com\\@localhost", + "https://example.com?x=1", + "https://example.com#fragment", + "https://", + "https://example.com:bad", + "https://example.com:70000", + "https://example.com:", + "https://bad^host", + "https://bad..host", + "http://[::1%25anything]", + "https://example.com?", + "ftp://localhost", + "not-a-url", + ], + ) + def test_invalid_endpoint_is_rejected_before_authentication_or_transport(self, client, endpoint, authentication): + config = {**DECISION_CONFIG, "azure_endpoint": endpoint} + credential = Mock() + if authentication != "key": + config.pop("api_key") + with pytest.raises(EvaluationException, match="HTTPS") as raised: + DecisionModelRunner(config, credential if authentication == "credential" else None) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert endpoint not in str(raised.value) + credential.get_token.assert_not_called() + assert not client.calls + + def test_binary_probability_threshold(self): + assert DecisionModelRunner(DECISION_CONFIG, binary=True).probability_threshold == 0.75 + runner = DecisionModelRunner({**DECISION_CONFIG, "probability_threshold": 0.7}, binary=True) + assert runner.probability_threshold == 0.7 + + def test_api_key_wins_over_credential(self): + class IgnoredCredential: + @property + def get_token(self): + raise AssertionError("Ignored credential must not be inspected.") + + runner = DecisionModelRunner(DECISION_CONFIG, credential=IgnoredCredential()) + assert runner._credential is None and runner._api_key == DECISION_CONFIG["api_key"] + + @pytest.mark.parametrize( + "credential", [None, object(), "token-secret", {"get_token": "secret"}, SimpleNamespace(get_token=3)] + ) + @pytest.mark.parametrize("in_config", [False, True]) + def test_missing_or_invalid_explicit_auth_is_rejected_at_construction(self, client, credential, in_config): + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + if in_config: + config["credential"] = credential + with pytest.raises(EvaluationException, match="callable 'get_token'") as raised: + DecisionModelRunner(config, None if in_config else credential) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert raised.value.category == ErrorCategory.INVALID_VALUE + assert raised.value.target == ErrorTarget.EVALUATE + assert "token-secret" not in str(raised.value) + assert not client.calls + + def test_constructor_credential_takes_precedence_without_identity_fallback(self): + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + configured = Mock() + supplied = Mock() + assert DecisionModelRunner({**config, "credential": configured}, supplied)._credential is supplied + with pytest.raises(EvaluationException, match="callable 'get_token'"): + DecisionModelRunner({**config, "credential": configured}, object()) + + +class TestDecisionModelRunnerRequests: + def test_request_shape_with_api_key(self, client): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + result = run(DecisionModelRunner(DECISION_CONFIG, evaluator_name="Probe"), state={"query": "q"}) + call = client.calls[0] + assert call["url"] == "https://example.services.ai.azure.com/providers/microsoft/v1/systemone" + assert call["json"] == {"model": "Decision-1", "state": {"query": "q"}, "questions": QUESTIONS} + assert call["headers"]["api-key"] == "test-key-value" + assert "Authorization" not in call["headers"] + assert call["headers"]["x-ms-useragent"].endswith("(type=evaluator subtype=Probe)") + assert result["usage"] == {"input_tokens": 120, "output_tokens": 3} + + @pytest.mark.parametrize("asynchronous", [False, True]) + def test_credential_acquires_a_scoped_bearer_token(self, client, asynchronous): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + token = SimpleNamespace(token="bearer-value") + credential = Mock() + credential.get_token = AsyncMock(return_value=token) if asynchronous else Mock(return_value=token) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + run(DecisionModelRunner(config, credential)) + credential.get_token.assert_called_once_with("https://cognitiveservices.azure.com/.default") + headers = client.calls[0]["headers"] + assert headers["Authorization"] == "Bearer bearer-value" and "api-key" not in headers + + def test_credential_in_configuration(self, client): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + credential = Mock(get_token=Mock(return_value=SimpleNamespace(token="from-config"))) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + run(DecisionModelRunner({**config, "credential": credential})) + assert client.calls[0]["headers"]["Authorization"] == "Bearer from-config" + + def test_bounded_retries_without_redirects(self, client): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + run(DecisionModelRunner(DECISION_CONFIG)) + retry, redirect = client.policies["retry_policy"], client.policies["redirect_policy"] + assert isinstance(retry, AsyncRetryPolicy) and retry.total_retries == 3 + assert isinstance(redirect, AsyncRedirectPolicy) and redirect.allow is False + + @pytest.mark.parametrize("status", _model_runners._DECISION_RETRY_STATUS_CODES) + def test_transient_post_response_is_retried_without_retry_after(self, monkeypatch, status): + from azure.ai.evaluation._http_utils import AsyncHttpPipeline + + class Response(HttpResponse): + def __init__(self, request, status_code): + super().__init__(request, None) + self.status_code = status_code + self.headers = {} + + def body(self): + return json.dumps(level_payload(4)).encode() + + class Transport(AsyncHttpTransport): + def __init__(self): + self.calls = 0 + + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *args): + await self.close() + + async def send(self, request, **kwargs): + self.calls += 1 + return Response(request, status if self.calls == 1 else 200) + + transport = Transport() + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=transport)) + result = run(DecisionModelRunner(DECISION_CONFIG)) + assert transport.calls == 2 + assert result["model"] == "microsoft-decision-1" + + def test_explicit_sync_credential_token_acquisition_runs_off_event_loop(self, client): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + loop_thread = threading.get_ident() + token_threads = [] + + def get_token(*scopes, **kwargs): + token_threads.append(threading.get_ident()) + return SimpleNamespace(token="default-token") + + credential = Mock(get_token=get_token) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + run(DecisionModelRunner(config, credential)) + assert token_threads and all(token_thread != loop_thread for token_thread in token_threads) + credential.close.assert_not_called() + assert client.calls[0]["headers"]["Authorization"] == "Bearer default-token" + + def test_explicit_sync_credential_does_not_block_request_timeout(self, client): + release = threading.Event() + + def get_token(*scopes, **kwargs): + release.wait(timeout=2) + return SimpleNamespace(token="default-token") + + credential = Mock(get_token=get_token) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + + async def request(): + try: + with pytest.raises(EvaluationException, match="timed out"): + await DecisionModelRunner(config, credential)(state={}, questions=QUESTIONS, timeout=0.02) + finally: + release.set() + + asyncio.run(request()) + assert not client.calls + credential.close.assert_not_called() + + @pytest.mark.parametrize( + "status, blame", + [ + (400, ErrorBlame.USER_ERROR), + (401, ErrorBlame.USER_ERROR), + (404, ErrorBlame.USER_ERROR), + (429, ErrorBlame.SYSTEM_ERROR), + (503, ErrorBlame.SYSTEM_ERROR), + ], + ) + def test_http_failures_are_sanitized(self, client, status, blame): + client.response = FakeResponse(status, b"echoed test-key-value and secret detail") + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG)) + assert raised.value.blame == blame + assert str(status) in str(raised.value) + assert "test-key-value" not in str(raised.value) and "secret detail" not in str(raised.value) + + @pytest.mark.parametrize( + "status,response_limit,code", + [ + (404, 1024, "DeploymentNotFound"), + (500, 1024, "InvalidRequest"), + (404, 1024, "RateLimitExceeded"), + (404, 1024, "secret_like_identifier_123"), + (500, 1024, "A" * 128), + (404, 1, "DeploymentNotFound"), + (500, 1, "InvalidRequest"), + ], + ) + def test_provider_http_error_code_preserves_classification_and_accepted_metadata( + self, client, status, response_limit, code + ): + payload = decision_payload() + payload["error"] = { + "code": code, + "message": "test-key-value and private-message", + "details": "private-details", + } + client.response = FakeResponse(status, json.dumps(payload).encode()) + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG, max_retries=0, max_response_bytes=response_limit)) + diagnostic = f" ({code})" if response_limit == 1024 else "" + prefix = "UserError" if status == 404 else "InternalError" + assert str(raised.value) == f"({prefix}) The decision model returned HTTP {status}{diagnostic}." + assert raised.value.blame == (ErrorBlame.USER_ERROR if status == 404 else ErrorBlame.SYSTEM_ERROR) + assert raised.value.category == ErrorCategory.FAILED_EXECUTION + assert raised.value.target == ErrorTarget.EVALUATE + execution = raised.value.properties["decision_model"].pop("execution") + assert validated_execution(execution) == execution + assert execution["outcome"] == "error" + assert raised.value.properties == ( + { + "decision_model": {"deployment": "Decision-1"}, + "prompt_tokens": 120, + "completion_tokens": 3, + "total_tokens": 123, + "model": "microsoft-decision-1", + } + if response_limit == 1024 + else {"decision_model": {"deployment": "Decision-1"}} + ) + + @pytest.mark.parametrize( + "payload", + [ + {"error": {"code": ""}}, + {"error": {"code": "InvalidRequest\nprivate-message"}}, + {"error": {"code": "A" * 129}}, + {"error": {"code": "DeploymentNotFound "}}, + {"error": {"code": None}}, + {"error": {"code": 404}}, + {"error": {"code": True}}, + {"error": {"code": ["DeploymentNotFound"]}}, + {"error": {"code": {"value": "DeploymentNotFound"}}}, + {"error": {"message": "private-message", "details": "private-details"}}, + {"error": "DeploymentNotFound"}, + {"error": ["DeploymentNotFound"]}, + {"error": None}, + {"code": "DeploymentNotFound"}, + ["DeploymentNotFound"], + None, + ], + ) + def test_malformed_or_missing_nested_http_error_codes_are_not_exposed(self, client, payload): + client.response = FakeResponse(404, json.dumps(payload).encode()) + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG)) + assert str(raised.value) == "(UserError) The decision model returned HTTP 404." + assert raised.value.blame == ErrorBlame.USER_ERROR + + def test_non_json_http_error_cannot_surface_code_text(self, client): + client.response = FakeResponse(404, b"DeploymentNotFound private-message test-key-value") + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG)) + assert str(raised.value) == "(UserError) The decision model returned HTTP 404." + + def test_transport_failure_is_sanitized(self, monkeypatch): + class Broken(FakeClient): + async def post(self, *_, **__): + raise ConnectionError("https://example.services.ai.azure.com test-key-value") + + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: Broken()) + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG)) + assert "test-key-value" not in str(raised.value) and "example.services" not in str(raised.value) + + def test_token_failure_is_a_user_error(self, client): + credential = Mock(get_token=Mock(side_effect=RuntimeError("token-secret"))) + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(config, credential)) + assert raised.value.blame == ErrorBlame.USER_ERROR and "token-secret" not in str(raised.value) + assert not client.calls + + def test_invalid_json(self, client): + client.response = FakeResponse(body=b"not json") + with pytest.raises(EvaluationException, match="invalid JSON"): + run(DecisionModelRunner(DECISION_CONFIG)) + + def test_timeout(self, client): + client.delay = 1 + client.response = FakeResponse(body=json.dumps(decision_payload()).encode()) + with pytest.raises(EvaluationException, match="timed out"): + run(DecisionModelRunner(DECISION_CONFIG), timeout=0.01) + + @pytest.mark.parametrize( + "mutate", + [ + lambda p: p.pop("answers"), + lambda p: p["answers"].pop("status"), + lambda p: p["answers"].update(extra={"type": "noul", "noul": 1}), + lambda p: p["answers"]["status"].update(type="score"), + lambda p: p.pop("usage"), + lambda p: p["usage"].update(input_tokens=-1), + lambda p: p["usage"].update(output_tokens=True), + lambda p: p.update(model=" "), + ], + ) + def test_structurally_invalid_responses(self, client, mutate): + payload = level_payload(4) + mutate(payload) + client.response = FakeResponse(body=json.dumps(payload).encode()) + with pytest.raises(EvaluationException, match="invalid response"): + run(DecisionModelRunner(DECISION_CONFIG)) + + def test_unsupported_question_type(self, client): + with pytest.raises(EvaluationException, match="not supported") as raised: + run(DecisionModelRunner(DECISION_CONFIG), questions={"team": {"type": "choice", "criteria": {}}}) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert not client.calls + + +class TestAnswerValidation: + def test_noul(self): + assert validate_noul_answer({"type": "noul", "noul": 0.25}) == 0.25 + for bad in (True, "0.5", None, float("nan"), -0.01, 1.01): + with pytest.raises(ValueError): + validate_noul_answer({"type": "noul", "noul": bad}) + + def test_score_mean_does_not_require_distribution_consistency(self): + levels = [0.1, 0.2, 0.3, 0.2, 0.2] + answer = score_answer(levels) + answer["score"] = 0 + assert validate_score_answer(answer, 5) == levels + + def test_score_accepts_rounded_distribution_without_normalizing(self): + levels = [0.333333, 0.333333, 0.333334] + assert validate_score_answer(score_answer(levels), 3) == levels + levels = [0.3333333] * 3 + assert validate_score_answer(score_answer(levels), 3) == levels + + @pytest.mark.parametrize( + "levels", + [ + [0.19, 0.34, 0.11, 0.07, 0.28], + [0.20, 0.34, 0.11, 0.07, 0.29], + [0.19, 0.34, 0.11, 0.07, 0.27], + [0.21, 0.34, 0.11, 0.07, 0.29], + ], + ) + def test_score_accepts_hundredths_rounding_without_normalizing(self, levels): + assert validate_score_answer(score_answer(levels), 5) == levels + + @pytest.mark.parametrize( + "levels", + [ + [0.22, 0.34, 0.11, 0.07, 0.29], + [0.18, 0.34, 0.11, 0.07, 0.27], + [0.191, 0.339, 0.11, 0.07, 0.28], + [0.201, 0.339, 0.11, 0.07, 0.29], + ], + ) + def test_score_rejects_outside_hundredths_or_finer_precision_tolerance(self, levels): + with pytest.raises(ValueError, match="sum to one"): + validate_score_answer(score_answer(levels), 5) + + @pytest.mark.parametrize("levels", [[0] * 5, [0.1] * 5, [0.3] * 5]) + def test_score_rejects_nonunit_distribution(self, levels): + with pytest.raises(ValueError, match="sum to one"): + validate_score_answer(score_answer(levels), 5) + + @pytest.mark.parametrize("direction", [-1, 1]) + @pytest.mark.parametrize("inside", [False, True]) + def test_score_sum_tolerance_boundary(self, direction, inside): + boundary = 1 + direction * 0.001 + total = math.nextafter(boundary, 1.0 if inside else direction * math.inf) + levels = [0.5, total - 0.5] + assert math.fsum(levels) == total + if inside: + assert validate_score_answer(score_answer(levels), 2) == levels + else: + with pytest.raises(ValueError, match="sum to one"): + validate_score_answer(score_answer(levels), 2) + + @pytest.mark.parametrize( + "mutate", + [ + lambda a: a["probabilities"].pop("4"), + lambda a: a["probabilities"].update({"5": 0.0}), + lambda a: a["probabilities"].update({"4": 1.5}), + lambda a: a.update(score=float("nan")), + lambda a: a.update(score=True), + lambda a: a.update(confidence=2), + ], + ) + def test_malformed_scores(self, mutate): + answer = score_answer([0, 0, 0, 0, 1.0]) + mutate(answer) + with pytest.raises(ValueError): + validate_score_answer(answer, 5) + + +class ProbeModelEvaluator(ModelEvaluatorBase): + _supports_decision_models = True + + async def _do_eval(self, eval_input): + return await self._model_runner(timeout=self._LLM_CALL_TIMEOUT, **eval_input) + + +class TestSharedBaseSelection: + def test_common_exports_match_existing_private_imports(self): + from azure.ai.evaluation._evaluators import _common + from azure.ai.evaluation._evaluators._common._prompty_strategy import PromptyEvaluationStrategy + + for name, implementation in ( + ("DecisionModelRunner", DecisionModelRunner), + ("PromptyModelRunner", PromptyModelRunner), + ("DecisionEvaluationStrategy", DecisionEvaluationStrategy), + ("PromptyEvaluationStrategy", PromptyEvaluationStrategy), + ("BinaryScoring", BinaryScoring), + ("LikertScoring", LikertScoring), + ): + assert getattr(_common, name) is implementation + assert name in _common.__all__ + + def test_hierarchy(self): + assert issubclass(ModelEvaluatorBase, EvaluatorBase) + assert issubclass(PromptyEvaluatorBase, ModelEvaluatorBase) + + def test_decision_configuration_selects_the_decision_runner_without_loading_prompty(self): + with patch.object(_model_runners.AsyncPrompty, "load", side_effect=AssertionError("prompty loaded")): + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + assert isinstance(evaluator._model_runner, DecisionModelRunner) + assert evaluator._uses_decision_model and not hasattr(evaluator, "_flow") + + def test_decision_base_does_not_require_a_prompty_file(self): + with patch.object(_model_runners.AsyncPrompty, "load", side_effect=AssertionError("prompty loaded")): + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + assert evaluator._decision_model_runner is evaluator._model_runner + assert not hasattr(evaluator, "_flow") + + def test_chat_base_requires_a_prompty_file(self): + with pytest.raises(EvaluationException, match="prompty_file"): + ProbeModelEvaluator(result_key="probe", model_config=CHAT_CONFIG) + + def test_decision_runner_accessor_rejects_a_chat_runner(self): + with patch.object(_model_runners.AsyncPrompty, "load"): + evaluator = ProbeModelEvaluator(result_key="probe", prompty_file="probe.prompty", model_config=CHAT_CONFIG) + with pytest.raises(RuntimeError, match="not configured"): + _ = evaluator._decision_model_runner + + def test_replacing_legacy_flow_updates_runner_execution(self): + with patch.object(_model_runners.AsyncPrompty, "load"): + evaluator = ProbeModelEvaluator(result_key="probe", prompty_file="probe.prompty", model_config=CHAT_CONFIG) + flow = AsyncMock(return_value={"llm_output": {"score": 1, "reason": "replacement", "properties": {}}}) + evaluator._flow = flow + assert evaluator._prompty_model_runner.flow is flow + inputs = {"query": "q", "response": "r"} + assert asyncio.run(evaluator._do_eval(inputs)) == flow.return_value + flow.assert_awaited_once_with(timeout=evaluator._LLM_CALL_TIMEOUT, **inputs) + + @pytest.mark.parametrize("tag", ["Decision", "system_one", "azure_openai", None, ""]) + def test_other_tags_are_not_decision_configurations(self, tag): + assert not _model_runners.is_decision_model_config({**DECISION_CONFIG, "type": tag}) + with pytest.raises(EvaluationException): + DecisionModelRunner({**DECISION_CONFIG, "type": tag}) + + def test_chat_configuration_selects_the_prompty_runner_without_a_decision_runner(self): + flow = AsyncMock() + with ( + patch.object(_model_runners.AsyncPrompty, "load", return_value=flow), + patch.object(_model_runners, "DecisionModelRunner", side_effect=AssertionError("decision runner built")), + ): + evaluator = ProbeModelEvaluator(result_key="probe", prompty_file="probe.prompty", model_config=CHAT_CONFIG) + assert isinstance(evaluator._model_runner, PromptyModelRunner) + assert evaluator._flow is flow and not evaluator._uses_decision_model + + def test_prompty_only_evaluators_reject_a_decision_configuration(self): + with patch.object(_model_runners.AsyncPrompty, "load", side_effect=AssertionError("prompty loaded")): + with pytest.raises(EvaluationException) as raised: + FluencyEvaluator(DECISION_CONFIG) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert "FluencyEvaluator" in str(raised.value) + + def test_wrapper_is_initialized_once(self): + original = EvaluatorBase.__init__ + initialized = [] + + def record(instance, **kwargs): + initialized.append(instance) + original(instance, **kwargs) + + with patch.object(EvaluatorBase, "__init__", record): + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + assert initialized == [evaluator] + + def test_prompty_load_parity(self): + flow = AsyncMock() + credential = object() + with patch.object(_model_runners.AsyncPrompty, "load", return_value=flow) as load: + evaluator = ProbeModelEvaluator( + result_key="probe", + prompty_file="probe.prompty", + model_config=CHAT_CONFIG, + credential=credential, + threshold=4, + ) + kwargs = load.call_args.kwargs + assert kwargs["source"] == "probe.prompty" + assert kwargs["token_credential"] is credential and kwargs["is_reasoning_model"] is False + headers = kwargs["model"]["parameters"]["extra_headers"] + assert headers["x-ms-useragent"].endswith("(type=evaluator subtype=ProbeModelEvaluator)") + assert kwargs["model"]["configuration"]["api_version"] == "2024-02-15-preview" + assert evaluator._threshold == 4 and evaluator._flow is flow + + def test_inherited_helpers_remain_available_to_prompty_evaluators(self): + with patch.object(_model_runners.AsyncPrompty, "load"): + evaluator = FluencyEvaluator(CHAT_CONFIG) + assert isinstance(evaluator, PromptyEvaluatorBase) + assert evaluator._get_binary_result(5) == "pass" and evaluator._get_binary_result(float("nan")) == "unknown" + assert evaluator._get_token_metadata({"input_token_count": 3})["prompt_tokens"] == 3 + assert evaluator._return_not_applicable_result("why", 3)["fluency_status"] == "skipped" + + def test_bundled_fluency_public_call_uses_legacy_prompty_parsing(self): + flow = AsyncMock( + return_value={ + "llm_output": "Clear prose4", + "input_token_count": 12, + "output_token_count": 3, + "total_token_count": 15, + "model_id": "chat-model", + } + ) + with patch.object(_model_runners.AsyncPrompty, "load", return_value=flow): + evaluator = FluencyEvaluator(CHAT_CONFIG) + result = evaluator(response="A clear sentence.") + assert result["fluency"] == 4 + assert result["fluency_reason"] == "Clear prose" + assert result["fluency_result"] == "pass" + assert result["fluency_properties"]["model"] == "chat-model" + assert result["fluency_properties"]["prompt_tokens"] == 12 + flow.assert_awaited_once_with(timeout=600, response="A clear sentence.") + + @pytest.mark.parametrize( + "evaluator_type,metric", [(FluencyEvaluator, "fluency"), (CoherenceEvaluator, "coherence")] + ) + @pytest.mark.parametrize("multi_turn", [False, True]) + def test_bundled_prompty_public_call_loads_real_template(self, evaluator_type, metric, multi_turn): + completion = ChatCompletion( + id="offline-completion", + created=0, + object="chat.completion", + model="offline-chat-model", + choices=[ + { + "index": 0, + "finish_reason": "stop", + "message": { + "role": "assistant", + "content": json.dumps({"reason": "Clear prose", "score": 4, "status": "completed"}), + }, + } + ], + usage={"prompt_tokens": 12, "completion_tokens": 3, "total_tokens": 15}, + ) + + async def send(*, api_client, params, timeout): + await api_client.close() + assert timeout == 600 + assert params["response_format"] == {"type": "json_object"} + assert params["messages"] + assert any("A clear sentence." in str(message["content"]) for message in params["messages"]) + return completion + + with patch.object(_model_runners.AsyncPrompty, "_send_with_retries", side_effect=send) as request: + evaluator = evaluator_type(CHAT_CONFIG) + assert evaluator._flow.path.is_file() + assert evaluator._flow.path.name == f"{metric}.prompty" + if multi_turn: + result = evaluator( + conversation={ + "messages": [ + {"role": "user", "content": "Explain clearly."}, + {"role": "assistant", "content": "A clear sentence."}, + {"role": "user", "content": "Explain again."}, + {"role": "assistant", "content": "A clear sentence."}, + ] + } + ) + else: + inputs = {"response": "A clear sentence."} + if metric == "coherence": + inputs["query"] = "Explain clearly." + result = evaluator(**inputs) + assert result[metric] == 4 + assert request.await_count == (2 if multi_turn else 1) + if multi_turn: + assert result["evaluation_per_turn"][metric] == [4, 4] + assert result["evaluation_per_turn"][f"{metric}_reason"] == ["Clear prose"] * 2 + else: + assert result[f"{metric}_reason"] == "Clear prose" + assert result[f"{metric}_result"] == "pass" + assert result[f"{metric}_properties"]["model"] == "offline-chat-model" + assert result[f"{metric}_properties"]["prompt_tokens"] == 12 + + +def completion_payload(probability, status=0.95): + return decision_payload(status, {"task_completion": {"type": "noul", "noul": probability}}) + + +def strategy_with(payload, scoring, key="tool_call_accuracy", extra_properties=None): + runner = AsyncMock(return_value=payload) + runner.deployment = "Decision-1" + return DecisionEvaluationStrategy( + runner, + result_key=key, + error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR, + questions={"status": {"type": "noul"}, key: {"type": "score"}}, + scoring=scoring, + threshold=3, + timeout=5, + extra_properties=extra_properties, + ) + + +class TestSharedDecisionStrategy: + @pytest.mark.parametrize("question", ["status", "tool_call_accuracy"]) + @pytest.mark.parametrize("extra", [math.inf, -math.inf, math.nan, {"nested": [math.inf]}]) + def test_nonfinite_answer_extras_raise_a_json_safe_metadata_preserving_error(self, question, extra): + """Validate retained provenance without discarding the paid response's known usage.""" + response = level_payload(4) + response["answers"][question]["diagnostic"] = extra + configured = strategy_with(response, LikertScoring(5)) + with pytest.raises(EvaluationException, match="JSON-safe") as raised: + asyncio.run(configured.evaluate({})) + assert raised.value.blame == ErrorBlame.SYSTEM_ERROR + assert raised.value.properties["total_tokens"] == 123 + assert raised.value.properties["model"] == "microsoft-decision-1" + json.dumps(raised.value.properties, allow_nan=False) + + def test_json_numeric_overflow_in_an_extra_is_rejected_after_real_response_parsing(self, client): + """A valid JSON exponent must not become infinity in a completed result.""" + response = level_payload(4) + response["answers"]["status"]["diagnostic"] = "OVERFLOW" + client.response = FakeResponse(body=json.dumps(response).replace('"OVERFLOW"', "1e309").encode()) + configured = strategy_with(response, LikertScoring(5)) + configured.runner = DecisionModelRunner(DECISION_CONFIG) + with pytest.raises(EvaluationException, match="JSON-safe") as raised: + asyncio.run(configured.evaluate({})) + assert raised.value.properties["total_tokens"] == 123 + json.dumps(raised.value.properties, allow_nan=False) + + def test_json_safe_answer_extras_are_preserved_without_mutating_the_response(self): + """Do not remove valid provider diagnostics while validating durable metadata.""" + response = level_payload(4) + diagnostic = {"optional": None, "values": [True, 0, "kept"]} + response["answers"]["status"]["diagnostic"] = diagnostic + response["answers"]["tool_call_accuracy"]["diagnostic"] = diagnostic + original = deepcopy(response) + result = asyncio.run(strategy_with(response, LikertScoring(5)).evaluate({})) + native = result["tool_call_accuracy_properties"]["decision_model"] + assert native["native_status_answer"]["diagnostic"] == diagnostic + assert native["native_answer"]["diagnostic"] == diagnostic + assert response == original + json.dumps(result, allow_nan=False) + + def test_skipped_unusable_answer_extras_are_not_validated_or_persisted(self): + """A false applicability verdict still ignores the unused score answer.""" + response = level_payload(4, status=0.1) + response["answers"]["tool_call_accuracy"]["diagnostic"] = math.inf + result = asyncio.run(strategy_with(response, LikertScoring(5)).evaluate({})) + assert result["tool_call_accuracy_status"] == "skipped" + assert "native_answer" not in result["tool_call_accuracy_properties"]["decision_model"] + json.dumps(result, allow_nan=False) + + @pytest.mark.parametrize("field", ["status", "noul", "probability", "confidence", "score"]) + def test_oversized_integer_preserves_typed_failure_metadata(self, field): + from azure.ai.evaluation._evaluate._batch_run._run_submitter_client import _decision_error_metadata + + response = completion_payload(0.9) if field == "noul" else level_payload(4) + if field == "status": + response["answers"]["status"]["noul"] = 10**309 + elif field == "noul": + response["answers"]["task_completion"]["noul"] = 10**309 + elif field == "probability": + response["answers"]["tool_call_accuracy"]["probabilities"]["0"] = 10**309 + else: + response["answers"]["tool_call_accuracy"][field] = 10**309 + response = json.loads(json.dumps(response)) + strategy = ( + strategy_with(response, BinaryScoring(0.75), "task_completion") + if field == "noul" + else strategy_with(response, LikertScoring(5)) + ) + with pytest.raises(EvaluationException) as raised: + strategy.parse(response, {}) + assert raised.value.blame == ErrorBlame.SYSTEM_ERROR + assert raised.value.category == ErrorCategory.FAILED_EXECUTION + metadata = _decision_error_metadata(raised.value) + assert metadata["properties"]["total_tokens"] == 123 + assert metadata["properties"]["model"] == "microsoft-decision-1" + assert metadata["properties"]["decision_model"]["deployment"] == "Decision-1" + assert len(metadata["properties"]["decision_model"]["rubric_hash"]) == 64 + json.dumps(metadata, allow_nan=False) + + @pytest.mark.parametrize("status", [0.1, 0.9]) + def test_parse_reuses_shared_response_without_http_or_usage_suffixes(self, status): + strategy = strategy_with(level_payload(4, status=status), LikertScoring(5)) + strategy.runner = Mock(deployment="Decision-1") + parsed = strategy.parse(level_payload(4, status=status), {}) + assert parsed["tool_call_accuracy_status"] == ("skipped" if status < 0.5 else "completed") + assert parsed["tool_call_accuracy_properties"]["total_tokens"] == 123 + assert not any( + key.endswith(("_prompt_tokens", "_completion_tokens", "_total_tokens", "_model")) for key in parsed + ) + strategy.runner.assert_not_called() + + @pytest.mark.parametrize("probability, score", [(0.6, 1.0), (0.5999, 0.0)]) + def test_binary_scoring_uses_its_own_cutoff(self, probability, score): + strategy = strategy_with(completion_payload(probability), BinaryScoring(0.6), key="task_completion") + assert asyncio.run(strategy.evaluate({}))["task_completion"] == score + + def test_standalone_binary_result_does_not_use_score_threshold(self): + strategy = strategy_with(completion_payload(0.1), BinaryScoring(0.6), key="task_completion") + strategy.threshold = 0 + result = asyncio.run(strategy.evaluate({})) + assert result["task_completion"] == 0 + assert result["task_completion_threshold"] == 0 + assert result["task_completion_passed"] is False + + @pytest.mark.parametrize("minimum, score", [(0, 2.0), (1, 3.0)]) + def test_likert_scoring_offsets_the_level_by_the_scale_minimum(self, minimum, score): + strategy = strategy_with(level_payload(2), LikertScoring(5, minimum=minimum)) + assert asyncio.run(strategy.evaluate({}))["tool_call_accuracy"] == score + + def test_likert_scoring_selects_the_lowest_tied_level(self): + payload = decision_payload(0.95, {"tool_call_accuracy": score_answer([0.0, 0.5, 0.0, 0.5, 0.0])}) + assert asyncio.run(strategy_with(payload, LikertScoring(5)).evaluate({}))["tool_call_accuracy"] == 2.0 + + def test_invalid_answer_reports_the_evaluator_error_target(self): + payload = level_payload(4) + payload["answers"]["tool_call_accuracy"]["probabilities"]["0"] = 1.5 + with pytest.raises(EvaluationException) as raised: + asyncio.run(strategy_with(payload, LikertScoring(5)).evaluate({})) + assert raised.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + + @pytest.mark.parametrize("levels", [[0] * 5, [0.1] * 5, [0.3] * 5]) + @pytest.mark.parametrize("minimum", [0, 1]) + def test_invalid_distribution_is_system_error_before_argmax(self, levels, minimum): + payload = decision_payload(0.95, {"tool_call_accuracy": score_answer(levels)}) + with pytest.raises(EvaluationException, match="sum to one") as raised: + asyncio.run(strategy_with(payload, LikertScoring(5, minimum=minimum)).evaluate({})) + assert raised.value.blame == ErrorBlame.SYSTEM_ERROR + assert raised.value.category == ErrorCategory.FAILED_EXECUTION + assert raised.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + assert raised.value.properties["total_tokens"] == 123 + assert raised.value.properties["model"] == "microsoft-decision-1" + + def test_public_call_rejects_invalid_distribution_with_evaluation_system_error(self, client): + class ScoredEvaluator(ModelEvaluatorBase): + _supports_decision_models = True + + def _derive_singleton_inputs(self): + return [["query", "response"]] + + async def _do_eval(self, eval_input): + return await DecisionEvaluationStrategy( + self._decision_model_runner, + result_key="tool_call_accuracy", + error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR, + questions=QUESTIONS, + scoring=LikertScoring(5), + threshold=3, + timeout=self._LLM_CALL_TIMEOUT, + ).evaluate(eval_input) + + payload = decision_payload(0.95, {"tool_call_accuracy": score_answer([0.3] * 5)}) + client.response = FakeResponse(body=json.dumps(payload).encode()) + evaluator = ScoredEvaluator(result_key="tool_call_accuracy", model_config=DECISION_CONFIG) + with pytest.raises(EvaluationException, match="sum to one") as raised: + evaluator(query="synthetic", response="synthetic") + assert raised.value.blame == ErrorBlame.SYSTEM_ERROR + assert raised.value.category == ErrorCategory.FAILED_EXECUTION + assert raised.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + assert raised.value.properties["total_tokens"] == 123 + + def test_extra_properties_are_added_with_the_decision_provenance(self): + strategy = strategy_with( + level_payload(4), LikertScoring(5), extra_properties=lambda eval_input: {"calls": len(eval_input["calls"])} + ) + properties = asyncio.run(strategy.evaluate({"calls": [1, 2]}))["tool_call_accuracy_properties"] + assert properties["calls"] == 2 and properties["decision_model"]["deployment"] == "Decision-1" + + def test_skipped_unusable_score_retains_known_usage_and_provenance(self): + payload = level_payload(4, status=0.1) + payload["answers"]["tool_call_accuracy"]["probabilities"] = None + result = asyncio.run(strategy_with(payload, LikertScoring(5)).evaluate({})) + assert result["tool_call_accuracy_status"] == "skipped" + assert result["tool_call_accuracy"] is None + properties = result["tool_call_accuracy_properties"] + assert (properties["prompt_tokens"], properties["completion_tokens"], properties["total_tokens"]) == ( + 120, + 3, + 123, + ) + assert properties["model"] == "microsoft-decision-1" + assert properties["decision_model"]["status_completion_probability"] == 0.1 + assert "native_answer" not in properties["decision_model"] + assert "sample_input" not in properties and "finish_reason" not in properties + + def test_semantic_failure_retains_known_usage_and_provenance(self): + payload = level_payload(4) + payload["answers"]["tool_call_accuracy"]["confidence"] = float("nan") + with pytest.raises(EvaluationException) as raised: + asyncio.run(strategy_with(payload, LikertScoring(5)).evaluate({})) + assert raised.value.properties["total_tokens"] == 123 + assert raised.value.properties["decision_model"]["deployment"] == "Decision-1" + + @pytest.mark.parametrize("status", [float("nan"), float("inf"), float("-inf"), "invalid", None, True, -0.1, 1.1]) + def test_invalid_status_error_properties_are_strict_json_with_known_metadata(self, client, status): + client.response = FakeResponse(body=json.dumps(level_payload(4, status=status)).encode()) + strategy = DecisionEvaluationStrategy( + DecisionModelRunner(DECISION_CONFIG), + result_key="tool_call_accuracy", + error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR, + questions=QUESTIONS, + scoring=LikertScoring(5), + threshold=3, + timeout=5, + ) + with pytest.raises(EvaluationException) as raised: + asyncio.run(strategy.evaluate({})) + properties = raised.value.properties + assert json.loads(json.dumps(properties, allow_nan=False)) == properties + assert (properties["prompt_tokens"], properties["completion_tokens"], properties["total_tokens"]) == ( + 120, + 3, + 123, + ) + assert properties["model"] == "microsoft-decision-1" + provenance = properties["decision_model"] + assert provenance["deployment"] == "Decision-1" + assert provenance["model"] == "microsoft-decision-1" + for field, question_id in (("rubric_hash", "tool_call_accuracy"), ("status_rubric_hash", "status")): + assert ( + provenance[field] + == hashlib.sha256(json.dumps(QUESTIONS[question_id], sort_keys=True).encode("utf-8")).hexdigest() + ) + assert "native_status_answer" not in provenance + assert "status_completion_probability" not in provenance + + @pytest.mark.parametrize("status, expected", [(0.4999, "skipped"), (0.5, "completed")]) + def test_applicability_cutoff_remains_fixed(self, status, expected): + payload = level_payload(4, status=status) + result = asyncio.run(strategy_with(payload, LikertScoring(5)).evaluate({})) + assert result["tool_call_accuracy_status"] == expected + assert result["tool_call_accuracy_properties"]["decision_model"]["status_probability_threshold"] == 0.5 + assert result["tool_call_accuracy_properties"]["decision_model"]["native_status_answer"] == ( + payload["answers"]["status"] + ) + + def test_successful_properties_only_contain_decision_metadata(self): + properties = asyncio.run(strategy_with(level_payload(4), LikertScoring(5)).evaluate({}))[ + "tool_call_accuracy_properties" + ] + assert set(properties) == { + "decision_model", + "prompt_tokens", + "completion_tokens", + "total_tokens", + "model", + } + assert {key: value for key, value in properties.items() if key != "decision_model"} == { + "prompt_tokens": 120, + "completion_tokens": 3, + "total_tokens": 123, + "model": "microsoft-decision-1", + } + + def test_likert_provenance_omits_legend_without_mutating_shared_response(self): + payload = level_payload(4) + answer = payload["answers"]["tool_call_accuracy"] + answer["legend"] = {str(index): "Repeated rubric description " * 20 for index in range(5)} + strategy = strategy_with(payload, LikertScoring(5)) + result = asyncio.run(strategy.evaluate({})) + native = result["tool_call_accuracy_properties"]["decision_model"]["native_answer"] + assert native == {name: value for name, value in answer.items() if name != "legend"} + assert "legend" in answer + assert result["tool_call_accuracy"] == 5 + assert result["tool_call_accuracy_properties"]["total_tokens"] == 123 + + +class TestDecisionConversationUsage: + def test_public_split_conversation_sums_native_usage_and_retains_model(self, client): + import logging + + from azure.ai.evaluation._evaluate._evaluate import _convert_single_row_to_aoai_format + + class SplitEvaluator(ModelEvaluatorBase): + _supports_decision_models = True + + def _derive_singleton_inputs(self): + return [["query", "response"]] + + async def _do_eval(self, eval_input): + return await DecisionEvaluationStrategy( + self._decision_model_runner, + result_key="tool_call_accuracy", + error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR, + questions=QUESTIONS, + scoring=LikertScoring(5), + threshold=3, + timeout=self._LLM_CALL_TIMEOUT, + ).evaluate(eval_input) + + payloads = [level_payload(0), level_payload(4)] + payloads[0]["usage"] = {"input_tokens": 12, "output_tokens": 3} + payloads[1]["usage"] = {"input_tokens": 34, "output_tokens": 5} + client.post = AsyncMock(side_effect=[FakeResponse(body=json.dumps(payload).encode()) for payload in payloads]) + evaluator = SplitEvaluator(result_key="tool_call_accuracy", model_config=DECISION_CONFIG) + result = evaluator( + conversation={ + "messages": [ + {"role": "user", "content": "first"}, + {"role": "assistant", "content": "one"}, + {"role": "user", "content": "second"}, + {"role": "assistant", "content": "two"}, + ] + } + ) + assert client.post.await_count == 2 + assert result["tool_call_accuracy"] == 3 + assert result["tool_call_accuracy_prompt_tokens"] == 46 + assert result["tool_call_accuracy_completion_tokens"] == 8 + assert result["tool_call_accuracy_total_tokens"] == 54 + assert result["tool_call_accuracy_model"] == "microsoft-decision-1" + assert result["evaluation_per_turn"]["tool_call_accuracy_prompt_tokens"] == [12, 34] + assert result["evaluation_per_turn"]["tool_call_accuracy_model"] == ["microsoft-decision-1"] * 2 + assert [json.loads(call.kwargs["content"])["state"]["query"] for call in client.post.await_args_list] == [ + "first", + "second", + ] + converted = _convert_single_row_to_aoai_format( + {f"outputs.judge.{key}": value for key, value in result.items()}, + 0, + None, + None, + 0, + {"judge": {"metrics": ["tool_call_accuracy"], "type": "azure_ai_evaluator"}}, + None, + logging.getLogger("test"), + ) + persisted = converted["results"][0] + assert persisted["sample"]["usage"] == {"prompt_tokens": 46, "completion_tokens": 8, "total_tokens": 54} + assert persisted["sample"]["model"] == "microsoft-decision-1" + properties = result["tool_call_accuracy_properties"] + assert {field: properties[field] for field in ("prompt_tokens", "completion_tokens", "total_tokens")} == { + "prompt_tokens": 46, + "completion_tokens": 8, + "total_tokens": 54, + } + assert properties["model"] == "microsoft-decision-1" + assert properties["decision_model"]["result_usage_scope"] == "reported_turns_only" + assert "execution" not in properties["decision_model"] + assert persisted["properties"] == properties + turns = result["evaluation_per_turn"]["tool_call_accuracy_properties"] + assert [turn["total_tokens"] for turn in turns] == [15, 39] + assert all("native_answer" in turn["decision_model"] for turn in turns) + assert properties["decision_model"]["native_answer"] == turns[-1]["decision_model"]["native_answer"] + + payloads[1]["model"] = "another-model" + client.post = AsyncMock(side_effect=[FakeResponse(body=json.dumps(payload).encode()) for payload in payloads]) + mixed = evaluator( + conversation={ + "messages": [ + {"role": "user", "content": "first"}, + {"role": "assistant", "content": "one"}, + {"role": "user", "content": "second"}, + {"role": "assistant", "content": "two"}, + ] + } + ) + mixed_properties = mixed["tool_call_accuracy_properties"] + assert mixed_properties["total_tokens"] == mixed["tool_call_accuracy_total_tokens"] == 54 + assert "tool_call_accuracy_model" not in mixed + assert "model" not in mixed_properties and "model" not in mixed_properties["decision_model"] + converted = _convert_single_row_to_aoai_format( + {f"outputs.judge.{key}": value for key, value in mixed.items()}, + 0, + None, + None, + 0, + {"judge": {"metrics": ["tool_call_accuracy"], "type": "azure_ai_evaluator"}}, + None, + logging.getLogger("test"), + ) + persisted = converted["results"][0] + assert persisted["properties"] == mixed_properties + assert persisted["sample"]["usage"]["total_tokens"] == 54 + assert persisted["sample"].get("model") is None + + @pytest.mark.parametrize( + "case", + [ + "same_model", + "mixed_models", + "missing_model", + "partial_usage", + "unknown_usage", + "last_free_skip", + "all_free_skips", + "first_free_skip", + "final_paid_skip", + ], + ) + def test_aggregate_properties_match_known_usage_without_mutating_turns(self, case): + from copy import deepcopy + + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + turns = [] + for index, count in enumerate((15, 39)): + model = "model-b" if case == "mixed_models" and index else "model-a" + if case == "missing_model" and index: + model = None + usage = {"prompt_tokens": count - 3, "completion_tokens": 3, "total_tokens": count} + if case == "partial_usage": + usage = {"prompt_tokens": 0} if index == 0 else {"completion_tokens": 3} + elif case == "unknown_usage": + usage = {} + native = { + "deployment": "Decision-1", + "model": model, + "rubric_hash": "a" * 64, + "status_rubric_hash": "b" * 64, + "status_probability_threshold": 0.5, + "status_completion_probability": 0.9, + "native_answer": {"type": "noul", "noul": 0.8}, + "execution": {"attempt_count": 1}, + } + properties = {**usage, "model": model, "decision_model": native} + turn = { + "probe": index + 1, + **{f"probe_{field}": value for field, value in usage.items()}, + "probe_model": model, + "probe_properties": properties, + } + if case == "final_paid_skip" and index: + turn["probe"] = None + native.pop("native_answer") + native["status_completion_probability"] = 0.1 + native["native_status_answer"] = {"type": "noul", "noul": 0.1} + if ( + case == "all_free_skips" + or (case == "last_free_skip" and index) + or (case == "first_free_skip" and index == 0) + ): + turn = {"probe": None, "probe_properties": None} + turns.append(turn) + original = deepcopy(turns) + result = evaluator._aggregate_results(turns) + properties = result["probe_properties"] + assert turns == original + assert result["evaluation_per_turn"]["probe_properties"] == [turn["probe_properties"] for turn in original] + if case in ("last_free_skip", "all_free_skips"): + assert properties is None + if case == "last_free_skip": + assert result["probe_total_tokens"] == 15 + return + for field in ("prompt_tokens", "completion_tokens", "total_tokens"): + if f"probe_{field}" in result: + assert properties[field] == result[f"probe_{field}"] + else: + assert field not in properties + if "probe_model" in result: + assert properties["model"] == result["probe_model"] + assert properties["decision_model"]["model"] == result["probe_model"] + else: + assert "model" not in properties and "model" not in properties["decision_model"] + assert properties["decision_model"]["usage_available"] is bool( + {"prompt_tokens", "completion_tokens", "total_tokens"}.intersection(properties) + ) + assert properties["decision_model"]["result_usage_scope"] == "reported_turns_only" + assert "execution" not in properties["decision_model"] + assert properties["decision_model"]["status_completion_probability"] == ( + original[-1]["probe_properties"]["decision_model"]["status_completion_probability"] + ) + if case == "final_paid_skip": + assert properties["decision_model"]["native_status_answer"] == {"type": "noul", "noul": 0.1} + assert "native_answer" not in properties["decision_model"] + else: + assert properties["decision_model"]["native_answer"] == {"type": "noul", "noul": 0.8} + + @pytest.mark.parametrize("models", [("first", "second"), ("first", None)]) + def test_different_or_unknown_models_remain_per_turn(self, models): + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + turns = [{"probe": 1, "probe_model": model} for model in models] + result = evaluator._aggregate_results(turns) + assert "probe_model" not in result + assert result["evaluation_per_turn"]["probe_model"] == list(models) + assert "probe_prompt_tokens" not in result + + def test_only_known_usage_is_summed_without_fabricating_totals(self): + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + result = evaluator._aggregate_results( + [{"probe": 1, "probe_prompt_tokens": 0}, {"probe": 5, "probe_completion_tokens": 4}] + ) + assert result["probe"] == 3 + assert result["probe_prompt_tokens"] == 0 + assert result["probe_completion_tokens"] == 4 + assert "probe_total_tokens" not in result + + def test_chat_aggregation_is_unchanged(self): + with patch.object(_model_runners.AsyncPrompty, "load"): + evaluator = ProbeModelEvaluator(result_key="probe", prompty_file="probe.prompty", model_config=CHAT_CONFIG) + turns = [ + {"probe": 1, "probe_prompt_tokens": 12, "probe_model": "chat"}, + {"probe": 5, "probe_prompt_tokens": 34, "probe_model": "chat"}, + ] + assert evaluator._aggregate_results(turns) == EvaluatorBase._aggregate_results(evaluator, turns) + + +class TestDecisionExecutionControls: + @pytest.mark.parametrize( + "value", + [ + pytest.param(10**309, id="oversized_positive"), + pytest.param(-(10**309), id="oversized_negative"), + ], + ) + @pytest.mark.parametrize("control", ["probability_threshold", "timeout_seconds", "timeout", "call_timeout"]) + def test_oversized_numeric_controls_raise_typed_user_error(self, client, control, value): + with pytest.raises(EvaluationException) as raised: + if control == "probability_threshold": + DecisionModelRunner({**DECISION_CONFIG, control: value}, binary=True) + elif control == "timeout_seconds": + DecisionModelRunner(DECISION_CONFIG, timeout_seconds=value) + elif control == "timeout": + ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG, timeout=value) + else: + asyncio.run(DecisionModelRunner(DECISION_CONFIG)(state={}, questions=QUESTIONS, timeout=value)) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert raised.value.category == ErrorCategory.INVALID_VALUE + assert not client.calls + + def test_overall_timeout_defaults_are_backend_specific(self): + decision = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG) + with patch.object(_model_runners.AsyncPrompty, "load"): + chat = ProbeModelEvaluator(result_key="probe", prompty_file="probe.prompty", model_config=CHAT_CONFIG) + assert decision._LLM_CALL_TIMEOUT == 120 + assert chat._LLM_CALL_TIMEOUT == 600 + + @pytest.mark.parametrize("timeout,expected", [(5, 5), (300, 300), (900, 600)]) + def test_explicit_overall_timeout_retains_existing_cap(self, timeout, expected): + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG, timeout=timeout) + assert evaluator._LLM_CALL_TIMEOUT == expected + + @pytest.mark.parametrize("name", ["execution_policy", "observer", "deadline_seconds"]) + def test_obsolete_controls_are_not_accepted(self, name): + with pytest.raises(TypeError, match=name): + DecisionModelRunner(DECISION_CONFIG, **{name: object()}) + + @pytest.mark.parametrize( + "options", + [ + {"timeout_seconds": 0}, + {"timeout_seconds": True}, + {"timeout_seconds": float("nan")}, + {"max_retries": True}, + {"max_retries": -1}, + {"max_retries": 1.5}, + {"max_request_bytes": 0}, + {"max_state_question_bytes": False}, + {"max_response_bytes": "100"}, + {"cancellation_requested": False}, + ], + ) + def test_invalid_controls(self, options): + with pytest.raises(EvaluationException) as raised: + DecisionModelRunner(DECISION_CONFIG, **options) + assert raised.value.blame == ErrorBlame.USER_ERROR + + def test_base_forwards_controls_outside_strict_config(self): + evaluator = ProbeModelEvaluator( + result_key="probe", model_config=DECISION_CONFIG, max_retries=0, timeout=5, timeout_seconds=2 + ) + assert evaluator._decision_model_runner._max_retries == 0 + assert evaluator._decision_model_runner._timeout_seconds == 2 + assert evaluator._LLM_CALL_TIMEOUT == 5 + with pytest.raises(EvaluationException, match="Unsupported"): + DecisionModelRunner({**DECISION_CONFIG, "max_retries": 0}) + + @pytest.mark.parametrize("timeout", [0, -1, True, float("nan"), float("inf"), "30"]) + def test_invalid_overall_timeouts_are_rejected(self, client, timeout): + with pytest.raises(EvaluationException, match="positive finite"): + ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG, timeout=timeout) + with pytest.raises(EvaluationException, match="positive finite"): + run(DecisionModelRunner(DECISION_CONFIG), timeout=timeout) + assert not client.calls + + @pytest.mark.parametrize("status", [400, 429, 500]) + @pytest.mark.parametrize("response_limit", [1, 1024]) + def test_final_http_error_keeps_classification_and_only_accepted_known_usage(self, client, status, response_limit): + client.response = FakeResponse(status, json.dumps(level_payload(4)).encode()) + with pytest.raises(EvaluationException, match=f"HTTP {status}") as raised: + run(DecisionModelRunner(DECISION_CONFIG, max_retries=0, max_response_bytes=response_limit)) + assert raised.value.blame == (ErrorBlame.USER_ERROR if status == 400 else ErrorBlame.SYSTEM_ERROR) + execution = raised.value.properties["decision_model"].pop("execution") + assert validated_execution(execution) == execution + assert execution["outcome"] == "error" + if response_limit == 1: + assert raised.value.properties == {"decision_model": {"deployment": "Decision-1"}} + else: + assert raised.value.properties["total_tokens"] == 123 + assert raised.value.properties["model"] == "microsoft-decision-1" + + @pytest.mark.parametrize( + "controls", + [ + {"timeout": 10}, + {"timeout_seconds": 2}, + {"max_retries": 0}, + {"cancellation_requested": lambda: False}, + {"max_request_bytes": 10}, + {"max_state_question_bytes": 10}, + {"max_response_bytes": 10}, + ], + ) + def test_explicit_controls_on_prompty_are_rejected_without_loading_a_flow(self, controls): + with patch.object(_model_runners.AsyncPrompty, "load") as load: + with pytest.raises(EvaluationException, match="only supported"): + ProbeModelEvaluator( + result_key="probe", + prompty_file="probe.prompty", + model_config=CHAT_CONFIG, + **controls, + ) + load.assert_not_called() + + def test_transport_timeout_and_single_retry_policy(self, client): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + run(DecisionModelRunner(DECISION_CONFIG, timeout_seconds=2, max_retries=7)) + retry = client.policies["retry_policy"] + assert retry.total_retries == retry.connect_retries == retry.read_retries == retry.status_retries == 7 + assert client.calls[0]["options"]["connection_timeout"] == 2 + assert "read_timeout" not in client.calls[0]["options"] + + @pytest.mark.parametrize("field", ["max_request_bytes", "max_state_question_bytes"]) + def test_request_budget_exact_boundary_and_no_send_on_overflow(self, client, field): + state = {"query": "\u00e9"} + if field == "max_request_bytes": + body = {"model": "Decision-1", "state": state, "questions": QUESTIONS} + size = len(json.dumps(body, ensure_ascii=False, separators=(",", ":"), allow_nan=False).encode("utf-8")) + else: + size = max( + len( + json.dumps( + {"state": state, "question": question}, + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode("utf-8") + ) + for question in QUESTIONS.values() + ) + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + run(DecisionModelRunner(DECISION_CONFIG, **{field: size}), state=state) + assert b"\xc3\xa9" in client.calls[0]["content"] and b"\\u00e9" not in client.calls[0]["content"] + client.calls.clear() + with pytest.raises(EvaluationException, match="byte budget") as raised: + run( + DecisionModelRunner(DECISION_CONFIG, **{field: size - 1}), + state=state, + ) + assert not client.calls + assert raised.value.blame == ErrorBlame.USER_ERROR + + @pytest.mark.parametrize("request_cap", [None, 10000]) + def test_uncapped_state_question_pairs_are_not_serialized(self, client, request_cap, caplog): + caplog.set_level(logging.INFO, logger=_model_runners.__name__) + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + with patch.object(_model_runners.json, "dumps", wraps=json.dumps) as serialize: + run(DecisionModelRunner(DECISION_CONFIG, max_request_bytes=request_cap)) + request_serializations = [entry for entry in serialize.call_args_list if "state" in entry.args[0]] + assert request_serializations == [ + call( + {"model": "Decision-1", "state": {"query": "q"}, "questions": QUESTIONS}, + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ) + ] + + def test_non_json_request_is_rejected_before_authentication_or_network(self, client): + with pytest.raises(EvaluationException, match="JSON-serializable") as raised: + run(DecisionModelRunner(DECISION_CONFIG), state={"value": float("nan")}) + assert not client.calls and raised.value.blame == ErrorBlame.USER_ERROR + + def test_response_budget_exact_boundary(self, client): + content = json.dumps(level_payload(4)).encode() + client.response = FakeResponse(body=content) + run(DecisionModelRunner(DECISION_CONFIG, max_response_bytes=len(content))) + with pytest.raises(EvaluationException, match="byte budget"): + run(DecisionModelRunner(DECISION_CONFIG, max_response_bytes=len(content) - 1)) + + def test_structural_failure_preserves_usage_before_answer_validation(self, client): + payload = level_payload(4) + payload["answers"] = {} + client.response = FakeResponse(body=json.dumps(payload).encode()) + with pytest.raises(EvaluationException, match="invalid response") as raised: + run(DecisionModelRunner(DECISION_CONFIG)) + assert raised.value.properties["prompt_tokens"] == 120 + assert raised.value.properties["completion_tokens"] == 3 + assert raised.value.properties["total_tokens"] == 123 + assert raised.value.properties["model"] == "microsoft-decision-1" + + def test_unknown_or_invalid_usage_is_not_fabricated(self, client): + client.response = FakeResponse(body=json.dumps({"usage": {"input_tokens": True, "output_tokens": 3}}).encode()) + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG)) + execution = raised.value.properties["decision_model"].pop("execution") + assert execution["usage_state"] == "unknown" + assert raised.value.properties == {"decision_model": {"deployment": "Decision-1"}, "completion_tokens": 3} + + def test_default_pipeline_owns_an_execution_observer(self, client): + client.response = FakeResponse(body=json.dumps(level_payload(4)).encode()) + run(DecisionModelRunner(DECISION_CONFIG)) + assert isinstance(client.policies["custom_hook_policy"], DecisionExecution) + assert type(client.policies["retry_policy"]) is AsyncRetryPolicy + + def test_base_timeout_caps_existing_evaluator_timeout(self, client): + client.delay = 1 + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG, timeout=0.01) + with pytest.raises(EvaluationException, match="timed out") as raised: + run(evaluator._decision_model_runner, timeout=evaluator._LLM_CALL_TIMEOUT) + assert raised.value.blame == ErrorBlame.SYSTEM_ERROR + + def test_evaluator_timeout_still_wins_over_longer_constructor_timeout(self, client): + client.delay = 1 + evaluator = ProbeModelEvaluator(result_key="probe", model_config=DECISION_CONFIG, timeout=900) + assert evaluator._LLM_CALL_TIMEOUT == 600 + with pytest.raises(EvaluationException, match="timed out"): + run(evaluator._decision_model_runner, timeout=0.01) + + def test_precancellation_does_not_send(self, client): + with pytest.raises(EvaluationException, match="cancelled") as raised: + run(DecisionModelRunner(DECISION_CONFIG, cancellation_requested=lambda: True)) + assert not client.calls and raised.value.blame == ErrorBlame.USER_ERROR + + def test_inflight_cancellation_cleans_up_request(self, monkeypatch): + cleaned_up = [] + + class WaitingClient(FakeClient): + async def post(self, *args, **kwargs): + try: + await asyncio.sleep(10) + finally: + cleaned_up.append(True) + + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: WaitingClient()) + + async def request(): + cancelled = False + + async def cancel(): + nonlocal cancelled + await asyncio.sleep(0.01) + cancelled = True + + cancellation = asyncio.create_task(cancel()) + try: + runner = DecisionModelRunner(DECISION_CONFIG, cancellation_requested=lambda: cancelled) + with pytest.raises(EvaluationException, match="cancelled") as raised: + await runner(state={}, questions=QUESTIONS, timeout=1) + assert raised.value.blame == ErrorBlame.USER_ERROR + finally: + await cancellation + + asyncio.run(request()) + assert cleaned_up == [True] + + @pytest.mark.parametrize("value", [None, "yes", 1]) + def test_cancellation_callback_requires_boolean(self, client, value): + with pytest.raises(EvaluationException, match="boolean"): + run(DecisionModelRunner(DECISION_CONFIG, cancellation_requested=lambda: value)) + assert not client.calls + + def test_cancellation_callback_failure_is_explicit_and_sanitized(self, client): + callback = Mock(side_effect=RuntimeError("cancellation-secret")) + with pytest.raises(EvaluationException, match="cancellation callback failed") as raised: + run(DecisionModelRunner(DECISION_CONFIG, cancellation_requested=callback)) + assert raised.value.blame == ErrorBlame.USER_ERROR + assert "secret" not in str(raised.value) + assert not client.calls + + @pytest.mark.parametrize("field", ["max_request_bytes", "max_state_question_bytes"]) + def test_tiny_positive_budget_rejects_before_send(self, client, field): + with pytest.raises(EvaluationException, match="byte budget"): + run(DecisionModelRunner(DECISION_CONFIG, **{field: 1})) + assert not client.calls + + def test_authentication_failure_is_sanitized_and_has_no_fabricated_usage(self, client): + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + credential = Mock(get_token=Mock(side_effect=RuntimeError("credential-secret"))) + with pytest.raises(EvaluationException, match="acquire a token") as raised: + run(DecisionModelRunner(config, credential)) + execution = raised.value.properties["decision_model"].pop("execution") + assert execution["attempt_count"] == 0 + assert execution["usage_state"] == "unknown" + assert raised.value.properties == {"decision_model": {"deployment": "Decision-1"}} + assert "secret" not in str(raised.value) + assert not client.calls + + @pytest.mark.parametrize("termination", ["timeout", "cancelled"]) + def test_termination_while_authenticating_does_not_send(self, client, termination): + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + cleaned_up = [] + + async def get_token(*_): + try: + await asyncio.sleep(10) + finally: + cleaned_up.append(True) + + credential = Mock(get_token=get_token) + + async def request(): + cancel = asyncio.Event() + loop = asyncio.get_running_loop() + handle = loop.call_later(0.01, cancel.set) + try: + with pytest.raises(EvaluationException) as raised: + await DecisionModelRunner( + config, credential, cancellation_requested=cancel.is_set if termination == "cancelled" else None + )(state={}, questions=QUESTIONS, timeout=0.02 if termination == "timeout" else 1) + assert raised.value.blame == ( + ErrorBlame.SYSTEM_ERROR if termination == "timeout" else ErrorBlame.USER_ERROR + ) + finally: + handle.cancel() + + asyncio.run(request()) + assert cleaned_up == [True] and not client.calls + + @pytest.mark.parametrize("termination", ["timeout", "cancelled"]) + def test_queued_explicit_auth_is_not_started_after_timeout_or_cancellation(self, client, termination): + config = {key: value for key, value in DECISION_CONFIG.items() if key != "api_key"} + entered = threading.Event() + release = threading.Event() + + def occupy_worker(): + entered.set() + release.wait(timeout=5) + + async def request(): + loop = asyncio.get_running_loop() + loop.set_default_executor(ThreadPoolExecutor(max_workers=1)) + occupied = loop.run_in_executor(None, occupy_worker) + cancel = asyncio.Event() + handle = None + try: + while not entered.is_set(): + await asyncio.sleep(0) + handle = loop.call_later(0.01, cancel.set) + credential = Mock(get_token=Mock(return_value=SimpleNamespace(token="unused"))) + with pytest.raises(EvaluationException) as raised: + await DecisionModelRunner( + config, credential, cancellation_requested=cancel.is_set if termination == "cancelled" else None + )(state={}, questions=QUESTIONS, timeout=0.03 if termination == "timeout" else 1) + assert raised.value.blame == ( + ErrorBlame.SYSTEM_ERROR if termination == "timeout" else ErrorBlame.USER_ERROR + ) + credential.get_token.assert_not_called() + credential.close.assert_not_called() + finally: + if handle is not None: + handle.cancel() + release.set() + await occupied + + asyncio.run(request()) + assert not client.calls + + @pytest.mark.parametrize("termination", ["timeout", "cancelled"]) + @pytest.mark.parametrize("waiting", ["send", "retry_backoff"]) + def test_real_pipeline_termination_interrupts_send_and_retry_wait(self, monkeypatch, termination, waiting): + from azure.ai.evaluation._http_utils import AsyncHttpPipeline + + cancelled = False + cleaned_up = [] + + class Response(HttpResponse): + def __init__(self, request): + super().__init__(request, None) + self.status_code = 429 + self.headers = {"Retry-After": "10"} + + def body(self): + return json.dumps(level_payload(4)).encode() + + class Transport(AsyncHttpTransport): + def __init__(self): + self.calls = 0 + + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + self.calls += 1 + if waiting == "retry_backoff": + return Response(request) + try: + await asyncio.sleep(10) + finally: + cleaned_up.append(True) + + transport = Transport() + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=transport)) + + async def request(): + nonlocal cancelled + loop = asyncio.get_running_loop() + + def cancel(): + nonlocal cancelled + cancelled = True + + handle = loop.call_later(0.01, cancel) + try: + with pytest.raises(EvaluationException) as raised: + await DecisionModelRunner( + DECISION_CONFIG, + cancellation_requested=(lambda: cancelled) if termination == "cancelled" else None, + )(state={}, questions=QUESTIONS, timeout=0.08 if termination == "timeout" else 1) + assert raised.value.blame == ( + ErrorBlame.SYSTEM_ERROR if termination == "timeout" else ErrorBlame.USER_ERROR + ) + execution = raised.value.properties["decision_model"].pop("execution") + assert execution["attempt_count"] == 1 + assert execution["outcome"] == ("deadline" if termination == "timeout" else "cancelled") + assert raised.value.properties == {"decision_model": {"deployment": "Decision-1"}} + finally: + handle.cancel() + + asyncio.run(request()) + assert transport.calls == 1 + assert cleaned_up == ([True] if waiting == "send" else []) + + @pytest.mark.parametrize("max_retries", [0, 1]) + def test_real_pipeline_transport_errors_respect_retry_bound(self, monkeypatch, max_retries): + from azure.ai.evaluation._http_utils import AsyncHttpPipeline + + class Transport(AsyncHttpTransport): + def __init__(self): + self.calls = 0 + + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + self.calls += 1 + raise ServiceRequestError("transport-secret") + + transport = Transport() + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=transport)) + with pytest.raises(EvaluationException) as raised: + run(DecisionModelRunner(DECISION_CONFIG, max_retries=max_retries)) + expected = max_retries + 1 + assert transport.calls == expected + execution = raised.value.properties["decision_model"].pop("execution") + assert execution["attempt_count"] == expected + assert execution["retry_count"] == max_retries + assert execution["outcome"] == "error" + assert raised.value.properties == {"decision_model": {"deployment": "Decision-1"}} + assert "secret" not in str(raised.value) + + def test_real_pipeline_success_has_no_hook_failure_or_billed_replay(self, monkeypatch): + from azure.ai.evaluation._http_utils import AsyncHttpPipeline + + class Response(HttpResponse): + def __init__(self, request): + super().__init__(request, None) + self.status_code = 200 + self.headers = {} + + def body(self): + return json.dumps(level_payload(4)).encode() + + class Transport(AsyncHttpTransport): + calls = 0 + + async def open(self): + pass + + async def close(self): + pass + + async def __aexit__(self, *_): + await self.close() + + async def send(self, request, **kwargs): + self.calls += 1 + return Response(request) + + transport = Transport() + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=transport)) + assert run(DecisionModelRunner(DECISION_CONFIG))["usage"] == {"input_tokens": 120, "output_tokens": 3} + assert transport.calls == 1 + + +class TestDecisionExecutionObservations: + SUMMARY = { + "attempt_count": 1, + "retry_count": 0, + "elapsed_ms": 12.5, + "outcome": "completed", + "last_http_status": 200, + "usage_state": "known", + } + + @pytest.mark.parametrize( + "case,sink", + [ + ("completed", "normal"), + ("retry", "normal"), + ("error", "normal"), + ("deadline", "normal"), + ("cancelled", "normal"), + ("external_cancelled", "normal"), + ("completed", "info_off"), + ("completed", "log_failure"), + ("completed", "metric_failure"), + ], + ) + def test_actual_pipeline_observations_are_owned_once_and_sinks_are_independent(self, monkeypatch, case, sink): + from azure.ai.evaluation._http_utils import AsyncHttpPipeline + + logger = logging.Logger("decision-test", logging.WARNING if sink == "info_off" else logging.INFO) + handler = BufferingHandler(20) + logger.addHandler(handler) + adapter = logging.LoggerAdapter(logger, {"run_id": "private-run", "correlation_id": "private-correlation"}) + instruments = {} + + def instrument(name, **_): + value = instruments.setdefault(name, Mock()) + if sink == "metric_failure": + value.add.side_effect = RuntimeError("metric-secret") + value.record.side_effect = RuntimeError("metric-secret") + return value + + meter = SimpleNamespace(create_counter=instrument, create_histogram=instrument) + + async def send(request, **_): + if case in ("deadline", "cancelled", "external_cancelled"): + await asyncio.sleep(10) + failed = case == "error" or (case == "retry" and transport.send.await_count == 1) + payload = {"error": {"message": "provider-secret"}} if failed else level_payload(4) + response = FakeResponse(500 if failed else 200, json.dumps(payload).encode(), request) + response.headers["Retry-After"] = "0" + return response + + transport = AsyncMock(spec=AsyncHttpTransport) + transport.send.side_effect = send + + monkeypatch.setattr(_model_runners, "get_async_http_client", lambda **_: AsyncHttpPipeline(transport=transport)) + if sink == "log_failure": + monkeypatch.setattr(logger, "info", Mock(side_effect=RuntimeError("logger-secret"))) + + async def request(): + cancelled = asyncio.Event() + runner = DecisionModelRunner( + DECISION_CONFIG, + max_retries=1 if case == "retry" else 0, + cancellation_requested=cancelled.is_set if case == "cancelled" else None, + ) + runner._bind_execution_logger(adapter) + task = asyncio.current_task() + handle = asyncio.get_running_loop().call_later( + 0.02, task.cancel if case == "external_cancelled" else cancelled.set + ) + try: + call = runner(state="private-evidence", questions=QUESTIONS, timeout=0.04 if case == "deadline" else 1) + if case in ("completed", "retry"): + response = await call + summary = response["_decision_execution"] + assert response["usage"]["input_tokens"] == 120 + else: + with pytest.raises( + asyncio.CancelledError if case == "external_cancelled" else EvaluationException + ) as error: + await call + summary = error.value.properties["decision_model"]["execution"] + assert validated_execution(summary) == summary + assert summary["attempt_count"] == (2 if case == "retry" else 1) + assert summary["retry_count"] == (1 if case == "retry" else 0) + assert summary["outcome"] == ( + "completed" if case == "retry" else "cancelled" if case == "external_cancelled" else case + ) + assert summary["usage_state"] == ( + "known" if case == "completed" else "partial" if case == "retry" else "unknown" + ) + assert summary["last_http_status"] == ( + 200 if case in ("completed", "retry") else 500 if case == "error" else None + ) + finally: + handle.cancel() + + with patch.dict(sys.modules, {"opentelemetry.metrics": SimpleNamespace(get_meter=lambda _: meter)}): + asyncio.run(request()) + expected = 2 if case == "retry" else 1 + assert transport.send.await_count == expected + transport.__aexit__.assert_awaited_once() + if sink not in ("info_off", "log_failure"): + assert len(handler.buffer) == expected + 1 + dimensions = [json.loads(record.decision_dimensions) for record in handler.buffer] + assert [item["phase"] for item in dimensions] == ["attempt"] * expected + ["execution"] + for record in handler.buffer: + assert record.run_id == "private-run" and record.correlation_id == "private-correlation" + assert "private-evidence" not in record.decision_execution + record.getMessage() + assert "secret" not in record.decision_execution + record.getMessage() + else: + assert not handler.buffer + if sink != "metric_failure": + prefix = "azure.ai.evaluation.decision." + assert instruments[prefix + "provider.attempts"].add.call_count == expected + assert instruments[prefix + "provider.duration"].record.call_count == expected + instruments[prefix + "operations"].add.assert_called_once() + assert instruments[prefix + "provider.retries"].add.call_count == expected - 1 + for value in instruments.values(): + for call in value.add.call_args_list + value.record.call_args_list: + attributes = call.kwargs["attributes"] + assert set(attributes) == { + "backend", + "route", + "phase", + "outcome", + "usage_state", + "http_status_class", + "throttled", + } + assert "private" not in str(attributes) and "Decision-1" not in str(attributes) + handler.close() + + @pytest.mark.parametrize("outcome", ["completed", "skipped", "semantic_error"]) + def test_strategy_projects_valid_execution_without_reemitting(self, outcome): + response = level_payload(4, status=0.1 if outcome == "skipped" else 0.9) + summary = self.SUMMARY + response["_decision_execution"] = summary + if outcome == "semantic_error": + response["answers"]["tool_call_accuracy"]["probabilities"]["4"] = 0.5 + strategy = DecisionEvaluationStrategy( + DecisionModelRunner(DECISION_CONFIG), + result_key="tool_call_accuracy", + error_target=ErrorTarget.EVALUATE, + questions=QUESTIONS, + scoring=LikertScoring(5), + threshold=3, + timeout=1, + ) + with patch.object(DecisionExecution, "emit") as emit: + if outcome == "semantic_error": + with pytest.raises(EvaluationException) as error: + strategy.parse(response, {}) + properties = error.value.properties + else: + properties = strategy.parse(response, {})["tool_call_accuracy_properties"] + assert properties["decision_model"]["execution"] == summary + assert properties["decision_model"]["execution"] is not summary + emit.assert_not_called() + + @pytest.mark.parametrize( + "changes", + [ + {"attempt_count": True}, + {"attempt_count": 1.0}, + {"attempt_count": 22}, + {"retry_count": 21}, + {"elapsed_ms": True}, + {"elapsed_ms": float("nan")}, + {"elapsed_ms": float("inf")}, + {"elapsed_ms": 86400001}, + {"elapsed_ms": 10**1000}, + {"last_http_status": True}, + {"last_http_status": 99}, + {"last_http_status": 600}, + {"outcome": "private-outcome"}, + {"usage_state": "private-usage"}, + ], + ) + def test_malformed_shared_carrier_is_rejected_without_coercion(self, changes): + assert validated_execution({**self.SUMMARY, **changes}) is None + + def test_hosted_summary_bounds_do_not_restrict_public_retry_configuration(self, caplog): + runner = DecisionModelRunner(DECISION_CONFIG, max_retries=100) + assert runner._max_retries == 100 + execution = DecisionExecution(None, None) + execution.attempt_count = 21 + execution.known_usage_attempts = 21 + assert validated_execution(execution.summary("completed"))["retry_count"] == 20 + execution.attempt_count = 22 + with patch.object(DecisionExecution, "emit"): + assert execution.finish("completed") is None + assert "summary omitted" in caplog.text + + def test_optional_metrics_absence_does_not_change_summary_or_require_a_logger(self): + execution = DecisionExecution(None, None) + with patch.dict(sys.modules, {"opentelemetry.metrics": None}): + summary = execution.finish("error") + assert summary["attempt_count"] == 0 and summary["usage_state"] == "unknown" diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_prompty_strategy.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_prompty_strategy.py new file mode 100644 index 000000000000..3f0227e867f7 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_prompty_strategy.py @@ -0,0 +1,373 @@ +import asyncio +import json +import math +from unittest.mock import AsyncMock + +import pytest + +from azure.ai.evaluation._evaluators._common._prompty_strategy import PromptyEvaluationStrategy +from azure.ai.evaluation._exceptions import EvaluationException, ErrorBlame, ErrorCategory, ErrorTarget + + +def strategy(**kwargs): + options = {"result_key": "metric", "threshold": 3, "timeout": 17} + options.update(kwargs) + return PromptyEvaluationStrategy(AsyncMock(), **options) + + +@pytest.mark.parametrize( + "answer,expected,reason", + [ + ({"score": 4, "reason": "good"}, 4, "good"), + ('{"score": 4, "reason": "good"}', 4, "good"), + ("malformed JSON { score 4", 4, ""), + ("the score is 2", 2, ""), + ("[] score 2", 2, ""), + (None, math.nan, ""), + ({"score": None}, math.nan, ""), + ({}, math.nan, ""), + ("no score", math.nan, ""), + ], +) +def test_legacy_parser(answer, expected, reason): + result = strategy(strict=False, missing_score=math.nan).parse({"llm_output": answer}) + if math.isnan(expected): + assert math.isnan(result["metric"]) + assert result["metric_result"] == "unknown" + assert result["metric_passed"] is False + else: + assert result["metric"] == expected + assert result["metric_reason"] == reason + + +def test_legacy_quality_xml(): + result = strategy(result_key="fluency", strict=False, missing_score=math.nan).parse( + { + "llm_output": " Clear prose 4", + } + ) + assert result["fluency"] == 4 + assert result["fluency_reason"] == "Clear prose" + + +@pytest.mark.parametrize( + "higher,score,expected", + [ + (True, 2, "fail"), + (True, 3, "pass"), + (True, 4, "pass"), + (False, 2, "pass"), + (False, 3, "pass"), + (False, 4, "fail"), + ], +) +def test_threshold_direction(higher, score, expected): + assert strategy(higher_is_better=higher).parse({"score": score})["metric_result"] == expected + + +@pytest.mark.parametrize( + "output", + [ + None, + [], + "text", + {"llm_output": '{"score":4}'}, + {"llm_output": []}, + {"llm_output": None}, + ], +) +def test_strict_rejects_non_dict_answer(output): + with pytest.raises(EvaluationException, match="Evaluator returned invalid output") as error: + strategy(error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR).parse(output) + assert error.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + + +@pytest.mark.parametrize("score", [None, 0, -1, 6, "bad", math.nan, math.inf]) +def test_score_range_errors(score): + with pytest.raises(EvaluationException, match="Invalid score value") as error: + strategy(score_range=(1, 5), error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR).parse({"score": score}) + assert error.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + + +@pytest.mark.parametrize("strict", [True, False]) +@pytest.mark.parametrize("sign", [1, -1], ids=["positive", "negative"]) +@pytest.mark.parametrize("exponent", [309, 5000]) +def test_oversized_integer_scores_preserve_typed_error_classification(strict, sign, exponent): + """Integer conversion and error formatting cannot bypass the configured score error.""" + with pytest.raises(EvaluationException, match="Invalid score value") as error: + strategy( + strict=strict, + score_range=(0, 1), + score_error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR, + ).parse({"llm_output": {"score": sign * 10**exponent}}) + assert error.value.blame == ErrorBlame.SYSTEM_ERROR + assert error.value.category == ErrorCategory.FAILED_EXECUTION + assert error.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + + +@pytest.mark.parametrize("sign", [1, -1], ids=["positive", "negative"]) +def test_oversized_json_integer_scores_preserve_typed_error_classification(sign): + with pytest.raises(EvaluationException, match="Invalid score value") as error: + strategy( + strict=False, + score_range=(0, 1), + score_error_target=ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR, + ).parse({"llm_output": json.dumps({"score": sign * 10**309})}) + assert error.value.blame == ErrorBlame.SYSTEM_ERROR + assert error.value.category == ErrorCategory.FAILED_EXECUTION + assert error.value.target == ErrorTarget.TOOL_CALL_ACCURACY_EVALUATOR + + +@pytest.mark.parametrize("strict", [True, False]) +@pytest.mark.parametrize("score", [0, 0.0, "0"]) +def test_zero_inclusive_range_accepts_an_explicit_zero(strict, score): + """A parsed zero is a valid score, not a missing-score sentinel.""" + result = strategy(strict=strict, score_range=(0, 1)).parse({"llm_output": {"score": score}}) + assert result["metric"] == 0.0 + assert result["metric_status"] == "completed" + + +@pytest.mark.parametrize("missing_score", [0, 1]) +@pytest.mark.parametrize("strict", [True, False]) +@pytest.mark.parametrize( + "answer", + [ + {}, + {"reason": "no score"}, + {"score": None}, + {"score": ""}, + {"score": "bad"}, + {"score": math.nan}, + {"score": True}, + {"score": False}, + ], +) +def test_zero_inclusive_range_rejects_missing_or_invalid_scores(strict, missing_score, answer): + """A default fallback must not manufacture a valid ranged grade.""" + with pytest.raises(EvaluationException, match="Invalid score value"): + strategy(strict=strict, missing_score=missing_score, score_range=(0, 1)).parse({"llm_output": answer}) + + +@pytest.mark.parametrize("answer", ['{"score": 0}', "the score is 0"]) +def test_zero_inclusive_range_accepts_a_parsed_text_zero(answer): + """Legacy textual and JSON parsing retain explicit zero scores.""" + result = strategy(strict=False, score_range=(0, 1)).parse({"llm_output": answer}) + assert result["metric"] == 0.0 + + +@pytest.mark.parametrize("score", ["-1", "+10", "10", "-0.25", "1.25", "1e1", "1e309", "-1e-1"]) +def test_explicit_text_range_rejects_the_full_out_of_range_score(score): + """Out-of-range text cannot become a passing score by dropping its sign or suffix.""" + with pytest.raises(EvaluationException, match="Invalid score value"): + strategy(strict=False, score_range=(0, 1), threshold=1).parse({"llm_output": f"the score is {score}"}) + + +@pytest.mark.parametrize( + "score,score_range,expected", + [ + ("-1", (-2, 2), -1.0), + ("10", (0, 10), 10.0), + ("0.25", (0, 1), 0.25), + (".25", (0, 1), 0.25), + ("+0.25", (0, 1), 0.25), + ("1.", (0, 1), 1.0), + ("1e-1", (0, 1), 0.1), + ("1E+1", (0, 10), 10.0), + ("-1e-1", (-1, 1), -0.1), + ], +) +def test_explicit_text_range_preserves_the_full_valid_score(score, score_range, expected): + """Ranged text keeps valid signed, multidigit, decimal and exponent values intact.""" + result = strategy(strict=False, score_range=score_range, threshold=1).parse({"llm_output": f"the score is {score}"}) + assert result["metric"] == expected + assert result["metric_status"] == "completed" + assert result["metric_passed"] is (expected >= 1) + + +@pytest.mark.parametrize("score,expected", [("-1", 1.0), ("10", 1.0), ("0.25", 0.0), ("1e-1", 1.0)]) +def test_legacy_text_keeps_single_digit_parsing_without_an_explicit_range(score, expected): + result = strategy(strict=False).parse({"llm_output": f"the score is {score}"}) + assert result["metric"] == expected + + +@pytest.mark.parametrize("answer,valid", [("Reason0", True), ("No grade", False)]) +def test_quality_text_zero_is_distinct_from_a_missing_grade(answer, valid): + """The quality parser reports presence independently of its numeric fallback.""" + configured = strategy(result_key="fluency", strict=False, score_range=(0, 5)) + if valid: + assert configured.parse({"llm_output": answer})["fluency"] == 0.0 + else: + with pytest.raises(EvaluationException, match="Invalid score value"): + configured.parse({"llm_output": answer}) + + +@pytest.mark.parametrize("score", ["-1", "6", "1e309"]) +def test_explicit_quality_text_range_rejects_out_of_range_scores(score): + """An explicit range validates the full parsed number instead of a leading digit.""" + with pytest.raises(EvaluationException, match="Invalid score value"): + strategy(result_key="fluency", strict=False, score_range=(0, 5)).parse( + {"llm_output": f"Reason{score}"} + ) + + +def test_legacy_quality_text_domain_is_unchanged_without_an_explicit_range(): + """The existing quality parser still accepts only its default one-through-five domain.""" + result = strategy(result_key="fluency", strict=False).parse({"llm_output": "Reason0"}) + assert math.isnan(result["fluency"]) + assert result["fluency_result"] == "unknown" + + +def test_missing_completion_score_and_binary_rule(): + completion = strategy(binary_cutoff=1, threshold=7) + assert completion.parse({})["metric"] == 0 + assert completion.parse({"score": 1})["metric_result"] == "pass" + with pytest.raises(ValueError): + completion.parse({"score": "bad"}) + + +@pytest.mark.parametrize("strict", [True, False]) +def test_skipped_bypasses_score_validation(strict): + result = strategy(strict=strict, score_range=(1, 5)).parse( + { + "llm_output": {"score": "bad", "status": "skipped", "reason": "not relevant"}, + } + ) + assert result == { + "metric": None, + "metric_score": None, + "metric_passed": None, + "metric_result": "not_applicable", + "metric_reason": "Not applicable: not relevant", + "metric_status": "skipped", + "metric_threshold": 3, + "metric_properties": { + "prompt_tokens": 0, + "completion_tokens": 0, + "total_tokens": 0, + "finish_reason": "", + "model": "", + "sample_input": "", + "sample_output": "", + }, + } + + +@pytest.mark.parametrize( + "key,alias,usage", + [ + ("task_completion", None, False), + ("tool_call_accuracy", "gpt_tool_call_accuracy", False), + ("task_completion", None, True), + ("tool_call_accuracy", None, False), + ], +) +def test_exact_chat_schemas(key, alias, usage): + configured = strategy(result_key=key, completed_alias=alias, top_level_usage=usage) + output = {"llm_output": {"score": 4, "properties": {"custom": "kept"}}, "input_token_count": 9} + completed = configured.parse(output) + metadata = { + "prompt_tokens": 9, + "completion_tokens": 0, + "total_tokens": 0, + "finish_reason": "", + "model": "", + "sample_input": "", + "sample_output": "", + } + expected_keys = {key} | { + f"{key}_{suffix}" + for suffix in ( + "score", + "passed", + "result", + "reason", + "status", + "threshold", + "properties", + ) + } + assert completed[f"{key}_properties"] == {"custom": "kept", **metadata} + if alias: + expected_keys.add(alias) + assert completed[alias] == 4 + if usage: + expected_keys.update(f"{key}_{name}" for name in metadata) + assert completed[f"{key}_prompt_tokens"] == 9 + assert set(completed) == expected_keys + skipped = configured.parse({"llm_output": {"status": "skipped"}, "input_token_count": 9}) + assert set(skipped) == expected_keys - ({alias} if alias else set()) + assert skipped[f"{key}_properties"] == metadata + if usage: + assert skipped[f"{key}_prompt_tokens"] == 9 + + +@pytest.mark.parametrize("strict", [True, False]) +@pytest.mark.parametrize("top_level_usage", [True, False]) +def test_post_inference_skip_preserves_measured_usage(strict, top_level_usage): + configured = strategy(strict=strict, top_level_usage=top_level_usage, completed_alias="legacy_metric") + output = { + "llm_output": { + "status": "skipped", + "score": None, + "reason": "not applicable", + "properties": {"custom": "kept"}, + }, + "input_token_count": 9, + "output_token_count": 3, + "total_token_count": 12, + "model_id": "chat-judge-skip-fixture", + } + configured.runner.return_value = output + result = asyncio.run(configured.evaluate({"query": "q"})) + metadata = { + "prompt_tokens": 9, + "completion_tokens": 3, + "total_tokens": 12, + "model": "chat-judge-skip-fixture", + "finish_reason": "", + "sample_input": "", + "sample_output": "", + } + assert result == { + "metric": None, + "metric_score": None, + "metric_passed": None, + "metric_result": "not_applicable", + "metric_reason": "Not applicable: not applicable", + "metric_status": "skipped", + "metric_threshold": 3, + "metric_properties": {"custom": "kept", **metadata}, + **({f"metric_{key}": value for key, value in metadata.items()} if top_level_usage else {}), + } + configured.runner.assert_awaited_once_with(timeout=17, query="q") + + +@pytest.mark.parametrize("top_level_usage", [True, False]) +def test_pre_inference_skip_does_not_call_runner_or_manufacture_usage(top_level_usage): + configured = strategy(top_level_usage=top_level_usage) + result = configured.skipped("no applicable input") + assert result["metric_status"] == "skipped" + assert result["metric"] is result["metric_score"] is result["metric_passed"] is None + assert result["metric_properties"] is None + if top_level_usage: + assert [result[f"metric_{key}"] for key in ("prompt_tokens", "completion_tokens", "total_tokens")] == [0, 0, 0] + assert result["metric_model"] == "" + else: + assert "metric_prompt_tokens" not in result + assert "metric_model" not in result + configured.runner.assert_not_called() + + +def test_runtime_flow_resolution(): + original = AsyncMock(side_effect=AssertionError("stale flow")) + current = original + configured = strategy(flow_resolver=lambda: current) + current = AsyncMock(return_value={"score": 4}) + assert asyncio.run(configured.evaluate({"query": "q"}))["metric"] == 4 + current.assert_awaited_once_with(timeout=17, query="q") + original.assert_not_awaited() + + +def test_legacy_empty_envelope_is_invalid(): + with pytest.raises(EvaluationException, match="Evaluator returned invalid output"): + strategy(strict=False).parse({}) diff --git a/sdk/evaluation/cspell.yaml b/sdk/evaluation/cspell.yaml index 8279e22c0eef..4861b96360db 100644 --- a/sdk/evaluation/cspell.yaml +++ b/sdk/evaluation/cspell.yaml @@ -32,6 +32,7 @@ words: - nbformat - ncols - ndcg + - noul - ollama - onedp - otel @@ -62,6 +63,8 @@ words: - xpia ignorePaths: - sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_common/onedp/models/_enums.py + - sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_decision_strategy.py + - sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_model_runners.py - sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_groundedness/groundedness_with_query.prompty - sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_intent_resolution/intent_resolution.prompty - sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_retrieval/retrieval.prompty From 6e7ec452935bb8a620886df743167c87ba6925bd Mon Sep 17 00:00:00 2001 From: knit Date: Thu, 22 Oct 2026 19:25:54 +0800 Subject: [PATCH 19/35] AgentServer: add voice_conversation_engine, data passthrough and user.barge_in (#49487) * Add Bridge data passthrough to AgentServer Voice Add immutable structured input parts and complete data output messages to the Voice relay while retaining protocol 1.0 and application-owned response lifecycles. Update codec coverage, protocol tests, documentation, and API listings. Validation: 371 Voice tests passed; Pyright and scoped Black checks passed. * feat(agentserver): add standalone conversation engine route * docs(agentserver): clarify CE declarations for both agent schemas * docs(agentserver): clarify protocol-specific Foundry routes * docs(agentserver): add conversation engine changelog entry * Rename Voice interruption to user.barge_in Port the interruption rename from knitvoger/azure-sdk-for-python#1 onto the data passthrough branch. Preserve exact Bridge 1.0 and the existing invocations_ws route; no old event/model/callback aliases remain. Include generated API, migration notes and callback/sample cancellation regressions. * Rename hosted Voice CE protocol endpoint Use voice_conversation_engine for the typed host route, route name, Hosted Agent declaration examples and documentation. Reject the superseded route without adding an alias. Preserve invocations_ws, the Voice Agent conversation_engine configuration field, Bridge 1.0, data passthrough and user.barge_in. Validation: 398 Voice tests and 285 other non-live Invocations tests passed (1 skipped, 5 deselected); 35 changed-route regressions passed after formatting. Black 24.4, source mypy and changed-source pylint passed. Pyright reported 0 errors and 5 warnings in unchanged modules; package-wide pylint retains 6 diagnostics in unchanged generic Invocations files. Public API listings and Python version metadata are unchanged. * docs(agentserver): simplify unpublished Voice protocol release notes * fix(agentserver): require matching SDK for Voice sample Require Invocations 1.3.0b1 or later for UserBargeIn. Update local-wheel installation guidance and add version-boundary regressions. Voice tests: 403 passed; repository Black check passed. Runtime code, API metadata and package versions are unchanged. * fix(agentserver): align beta package classifier Mark Invocations 1.3.0b1 as Development Status :: 4 - Beta so Verify sdist accepts the package metadata. Only the classifier changes; package versions and runtime code are unchanged. Validation: reproduced the classifier rejection before the fix; the repository classifier validator accepts the actual package metadata after the fix, and all 9 existing classifier tests pass. Full sdist verification and pipeline completion remain for CI. * fix(agentserver): preserve Python 3.11 API generation metadata Regenerated the current 1.3.0b1 wheel API with Python 3.11.15 and apiview-stub-generator 0.3.31 using the repository apistub workflow. API content and hash are unchanged after trailing-whitespace normalization. Metadata generation test passed. --------- Co-authored-by: wujin <19744544+knitvoger@users.noreply.github.com> --- ...gentserver-conversation-engine-20261015.md | 7 + .../agentserver-user-barge-in-20261019.md | 7 + .../CHANGELOG.md | 12 + .../README.md | 26 +- .../azure-ai-agentserver-invocations/api.md | 114 +++++--- .../api.metadata.yml | 4 +- .../ai/agentserver/invocations/_version.py | 2 +- .../agentserver/invocations/voice/__init__.py | 14 +- .../agentserver/invocations/voice/_codec.py | 51 +++- .../agentserver/invocations/voice/_models.py | 68 ++++- .../invocations/voice/_voice_host.py | 88 +++++-- .../pyproject.toml | 2 +- .../samples/basic_voice_agent/README.md | 68 ++++- .../basic_voice_agent/basic_voice_agent.py | 6 +- .../basic_voice_agent/requirements.txt | 2 +- .../tests/voice/test_basic_voice_agent.py | 44 +++- .../tests/voice/test_voice_codec.py | 84 +++++- .../tests/voice/test_voice_host.py | 245 ++++++++++++++++++ .../voice/test_voice_protocol_findings.py | 115 ++++++++ 19 files changed, 847 insertions(+), 112 deletions(-) create mode 100644 .chronus/changes/agentserver-conversation-engine-20261015.md create mode 100644 .chronus/changes/agentserver-user-barge-in-20261019.md diff --git a/.chronus/changes/agentserver-conversation-engine-20261015.md b/.chronus/changes/agentserver-conversation-engine-20261015.md new file mode 100644 index 000000000000..cf2219b6cf8c --- /dev/null +++ b/.chronus/changes/agentserver-conversation-engine-20261015.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - azure-ai-agentserver-invocations +--- + +Added a standalone `/voice_conversation_engine` WebSocket route to `VoiceAgentServerHost`, reusing the typed Bridge event relay alongside its unchanged `/invocations_ws` route without new constructor options. Generic `InvocationAgentServerHost` raw WebSocket handlers are unchanged. diff --git a/.chronus/changes/agentserver-user-barge-in-20261019.md b/.chronus/changes/agentserver-user-barge-in-20261019.md new file mode 100644 index 000000000000..3c44825f6b88 --- /dev/null +++ b/.chronus/changes/agentserver-user-barge-in-20261019.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - azure-ai-agentserver-invocations +--- + +Aligned the experimental Voice caller-interruption contract with `user.barge_in`, `UserBargeIn`, `UserBargeInCallback`, and `VoiceAgentServerHost.on_user_barge_in`. Playback snapshots and application-owned cancellation/history are preserved. Voice Live senders must use the same event contract. Generic raw WebSocket handlers are unchanged. diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md b/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md index 0adbd7ac5a56..4aa7e5931bcb 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md +++ b/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.3.0b1 (Unreleased) + +### Features Added + +- Added immutable `InputDataPart` and `ResponseOutputDataDone` for structured application data in Bridge protocol `1.0`. Existing callbacks and explicit `ResponseNone` silent completion remain application-owned. +- Added a standalone `/voice_conversation_engine` WebSocket route to the experimental `VoiceAgentServerHost`, reusing the existing typed Bridge event relay alongside `/invocations_ws`. Existing `invocations_ws` behavior and generic `InvocationAgentServerHost` raw WebSocket handlers are unchanged. +- Aligned the experimental Voice caller-interruption contract with `user.barge_in`, `UserBargeIn`, `UserBargeInCallback`, and `VoiceAgentServerHost.on_user_barge_in`, preserving playback snapshots and application-owned cancellation/history. Voice Live senders must use the same event contract. + +### Bugs Fixed + +### Other Changes + ## 1.2.0 (2026-09-29) ### Other Changes diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/README.md b/sdk/agentserver/azure-ai-agentserver-invocations/README.md index 89decb5a7772..738f40cb7529 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/README.md +++ b/sdk/agentserver/azure-ai-agentserver-invocations/README.md @@ -4,7 +4,7 @@ The `azure-ai-agentserver-invocations` package provides the invocation protocol - **HTTP** (`invocations` protocol) — `POST /invocations`, `GET /invocations/{id}`, `POST /invocations/{id}/cancel`, `GET /invocations/docs/openapi.json`, `GET /invocations/docs/asyncapi.{json,yaml}`. - **WebSocket** (`invocations_ws` protocol) — full-duplex streaming at `/invocations_ws`, registered with `@app.ws_handler`. -- **Voice Live Bridge** — an experimental typed event relay in the `azure.ai.agentserver.invocations.voice` submodule, layered on `invocations_ws`. +- **Voice Live Bridge** — an experimental typed event relay in the `azure.ai.agentserver.invocations.voice` submodule, available at both `/voice_conversation_engine` and the existing `/invocations_ws` endpoint. ## Getting started @@ -308,9 +308,23 @@ The handler receives a Starlette [`WebSocket`][starlette-ws] and returns `None`. ## Typed Voice Live Bridge submodule (preview) -`VoiceAgentServerHost` provides typed `on_` decorators over the existing -`invocations_ws` transport. Each callback receives an immutable event and a -send-only `Session`: +`VoiceAgentServerHost` provides typed `on_` decorators at both `/invocations_ws` and `/voice_conversation_engine`, using the same `VoiceAgentServerHost()` construction. Existing legacy protocol declarations and metadata do not need migration. To use standalone CE, declare `voice_conversation_engine` version `1.0.0` on the deployed hosted agent. Neither legacy Bridge metadata flag is required for CE. The SDK does not create or modify hosted agent protocol declarations; registering the container route alone does not enable the public Foundry CE endpoint. + +The Voice Agent configuration field `conversation_engine` is separate from the Hosted Agent protocol name and remains unchanged. + +Both endpoints reuse the same typed Bridge messages, callbacks, transport limits, +tracing, and application-owned lifecycle. The message handshake remains +`session.start.protocol_version="1.0"`, independent of the container protocol +version `1.0.0`. The generic `InvocationAgentServerHost.ws_handler` and independent +`invocations_ws` routes are unchanged. The typed host reserves both paths, applying +the existing same-scope conflict detection and Host/Mount authority rules to each. +Use a locally built SDK containing CE support +until a release containing it is available; enabling CE also requires the Foundry +CE route and CE-aware Voice Live to be deployed. + +Each callback receives an immutable event and a send-only `Session`: + +Caller interruptions use `user.barge_in`, the `UserBargeIn` event model, `UserBargeInCallback`, and `@app.on_user_barge_in`. Voice Live senders must use the same event contract. Generic raw WebSocket handlers and application-owned cancellation/history are unchanged. ```python import asyncio @@ -417,6 +431,8 @@ reconnect state. ### Voice tracing +Bridge protocol remains `1.0`. `UserMessage.content` contains ordered `InputTextPart` and `InputDataPart` values. `InputDataPart.data` is a deeply immutable application JSON object. Applications can send `ResponseOutputDataDone(response_id=..., item_id=..., data=...)` after `ResponseCreated`, then explicitly finish with `ResponseDone`. Each data item is complete in one frame and cannot interrupt an unfinished text item; it produces no speech. After a successful operation requiring no output, explicitly send `ResponseNone(in_reply_to=(event.item_id,), reason="acknowledged")` only after required persistence finishes. The relay never infers business completion from callback return. Update both the Bridge and SDK before using these additions; there is no version change or runtime negotiation. + The typed Voice endpoint extracts W3C context from each WebSocket upgrade and creates one `agentserver.connection` span for the physical connection. Each registered event dispatch creates a sibling `voice.callback` span. Application @@ -477,7 +493,7 @@ code catches cancellation and returns normally, recovery is outside the SDK contract; the SDK does not forcibly terminate or retain that callback. For full-duplex streaming, the agent creates and owns a generation task, returns -from `on_user_message`, and cancels that task from `on_barge_in`, +from `on_user_message`, and cancels that task from `on_user_barge_in`, `on_response_cancelled`, `on_response_timeout`, or `on_connection_terminating`. Each task remains responsible for its own asynchronous resource cleanup. See the complete diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/api.md b/sdk/agentserver/azure-ai-agentserver-invocations/api.md index 983c360ddca3..abebbbf084ed 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/api.md +++ b/sdk/agentserver/azure-ai-agentserver-invocations/api.md @@ -76,13 +76,12 @@ namespace azure.ai.agentserver.invocations.voice @experimental @dataclass(frozen=True, kw_only=True, repr=False) - class azure.ai.agentserver.invocations.voice.BargeIn(_InboundMessage): - heard_text: str + class azure.ai.agentserver.invocations.voice.EndCall(_OutboundMessage): id: str - item_id: Optional[str] - response_id: str + mode: EndCallMode = EndCallMode.DRAIN + reason: str ts: str - type: ClassVar[str] = barge_in + type: ClassVar[str] = end_call def __delattr__() -> None: ... @@ -91,11 +90,10 @@ namespace azure.ai.agentserver.invocations.voice def __hash__() -> None: ... def __init__( - id: str, - ts: str, - response_id: str, - heard_text: str, - item_id: str | None = None + id: str = ..., + ts: str = ..., + reason: str, + mode: EndCallMode = ... ) -> None: ... def __setattr__() -> None: ... @@ -103,14 +101,17 @@ namespace azure.ai.agentserver.invocations.voice def _voice_model_repr(self: Any) -> str: ... + @experimental + class azure.ai.agentserver.invocations.voice.EndCallMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAIN = "drain" + IMMEDIATE = "immediate" + + @experimental @dataclass(frozen=True, kw_only=True, repr=False) - class azure.ai.agentserver.invocations.voice.EndCall(_OutboundMessage): - id: str - mode: EndCallMode = EndCallMode.DRAIN - reason: str - ts: str - type: ClassVar[str] = end_call + class azure.ai.agentserver.invocations.voice.InputDataPart: + data: Mapping[str, Any] + type: Literal["input_data"] = input_data def __delattr__() -> None: ... @@ -118,24 +119,15 @@ namespace azure.ai.agentserver.invocations.voice def __hash__() -> None: ... - def __init__( - id: str = ..., - ts: str = ..., - reason: str, - mode: EndCallMode = ... - ) -> None: ... + def __init__(data: Mapping) -> None: ... + + def __post_init__(self) -> None: ... def __setattr__() -> None: ... def _voice_model_repr(self: Any) -> str: ... - @experimental - class azure.ai.agentserver.invocations.voice.EndCallMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DRAIN = "drain" - IMMEDIATE = "immediate" - - @experimental @dataclass(frozen=True, kw_only=True, repr=False) class azure.ai.agentserver.invocations.voice.InputTextPart: @@ -346,6 +338,37 @@ namespace azure.ai.agentserver.invocations.voice def _voice_model_repr(self: Any) -> str: ... + @experimental + @dataclass(frozen=True, kw_only=True, repr=False) + class azure.ai.agentserver.invocations.voice.ResponseOutputDataDone(_OutboundMessage): + data: Mapping[str, Any] + id: str + item_id: str + response_id: str + ts: str + type: ClassVar[str] = response.output_data.done + + def __delattr__() -> None: ... + + def __eq__() -> None: ... + + def __hash__() -> None: ... + + def __init__( + id: str = ..., + ts: str = ..., + response_id: str, + item_id: str, + data: Mapping + ) -> None: ... + + def __post_init__(self) -> None: ... + + def __setattr__() -> None: ... + + def _voice_model_repr(self: Any) -> str: ... + + @experimental @dataclass(frozen=True, kw_only=True, repr=False) class azure.ai.agentserver.invocations.voice.ResponseOutputTextDelta(_OutboundMessage): @@ -662,10 +685,39 @@ namespace azure.ai.agentserver.invocations.voice TRANSPORT_ERROR = "transport_error" + @experimental + @dataclass(frozen=True, kw_only=True, repr=False) + class azure.ai.agentserver.invocations.voice.UserBargeIn(_InboundMessage): + heard_text: str + id: str + item_id: Optional[str] + response_id: str + ts: str + type: ClassVar[str] = user.barge_in + + def __delattr__() -> None: ... + + def __eq__() -> None: ... + + def __hash__() -> None: ... + + def __init__( + id: str, + ts: str, + response_id: str, + heard_text: str, + item_id: str | None = None + ) -> None: ... + + def __setattr__() -> None: ... + + def _voice_model_repr(self: Any) -> str: ... + + @experimental @dataclass(frozen=True, kw_only=True, repr=False) class azure.ai.agentserver.invocations.voice.UserMessage(_InboundMessage): - content: tuple[InputTextPart, Ellipsis] + content: tuple[Union[InputTextPart, InputDataPart], Ellipsis] id: str item_id: str ts: str @@ -769,8 +821,6 @@ namespace azure.ai.agentserver.invocations.voice def invoke_handler(self, fn: Callable[[Request], Awaitable[Response]]) -> Callable[[Request], Awaitable[Response]]: ... - def on_barge_in(self, callback: BargeInCallback) -> BargeInCallback: ... - def on_connection_terminating(self, callback: ConnectionTerminatingCallback) -> ConnectionTerminatingCallback: ... def on_disconnect(self, callback: DisconnectCallback) -> DisconnectCallback: ... @@ -787,6 +837,8 @@ namespace azure.ai.agentserver.invocations.voice def on_session_start(self, callback: SessionStartCallback) -> SessionStartCallback: ... + def on_user_barge_in(self, callback: UserBargeInCallback) -> UserBargeInCallback: ... + def on_user_message(self, callback: UserMessageCallback) -> UserMessageCallback: ... def on_user_no_input(self, callback: UserNoInputCallback) -> UserNoInputCallback: ... diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/api.metadata.yml b/sdk/agentserver/azure-ai-agentserver-invocations/api.metadata.yml index 964e520673bb..5ce1681e11b8 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/api.metadata.yml +++ b/sdk/agentserver/azure-ai-agentserver-invocations/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: e4e11fea9355277129dc5bea863e6c2252d8df0028b9e30dd2a29a53811389b1 -packageVersion: 1.2.0 +apiMdSha256: b1f36470262c47fc429f51e3da3e305baba09a19bd481573a3aa5f497c99f6e4 +packageVersion: 1.3.0b1 parserVersion: 0.3.31 pythonVersion: 3.11.15 diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_version.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_version.py index 61ff881fcab0..c6b49369aafa 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_version.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_version.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -VERSION = "1.2.0" +VERSION = "1.3.0b1" diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/__init__.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/__init__.py index b1ec4b3184e3..7937723e3c4e 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/__init__.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/__init__.py @@ -1,14 +1,14 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -"""Typed Voice Live Bridge event relay over ``invocations_ws``.""" +"""Typed Voice Live Bridge event relay over ``voice_conversation_engine`` or legacy ``invocations_ws``.""" from ._models import ( AgentError, - BargeIn, EndCall, EndCallMode, InboundVoiceMessage, + InputDataPart, InputTextPart, OutboundVoiceMessage, ResponseAccepted, @@ -18,6 +18,7 @@ ResponseDone, ResponseDropped, ResponseNone, + ResponseOutputDataDone, ResponseOutputTextDelta, ResponseOutputTextDone, ResponseTimeout, @@ -27,6 +28,7 @@ SessionReady, SessionRejected, SessionStart, + UserBargeIn, UserMessage, UserNoInput, UserSpeechStarted, @@ -37,7 +39,6 @@ from ._session import Session, SessionTermination from ._turn import TargetTurn, TargetTurnOrigin, TargetTurnOutcome from ._voice_host import ( - BargeInCallback, ConnectionTerminatingCallback, DisconnectCallback, ResponseAcceptedCallback, @@ -46,6 +47,7 @@ ResponseTimeoutCallback, SessionEndCallback, SessionStartCallback, + UserBargeInCallback, UserMessageCallback, UserNoInputCallback, UserSpeechStartedCallback, @@ -54,13 +56,12 @@ __all__ = [ "AgentError", - "BargeIn", - "BargeInCallback", "ConnectionTerminatingCallback", "DisconnectCallback", "EndCall", "EndCallMode", "InboundVoiceMessage", + "InputDataPart", "InputTextPart", "OutboundVoiceMessage", "ResponseAccepted", @@ -73,6 +74,7 @@ "ResponseDropped", "ResponseDroppedCallback", "ResponseNone", + "ResponseOutputDataDone", "ResponseOutputTextDelta", "ResponseOutputTextDone", "ResponseTimeout", @@ -90,6 +92,8 @@ "TargetTurn", "TargetTurnOrigin", "TargetTurnOutcome", + "UserBargeIn", + "UserBargeInCallback", "UserMessage", "UserMessageCallback", "UserNoInput", diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_codec.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_codec.py index 067e54f17e36..ff39090031ba 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_codec.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_codec.py @@ -17,10 +17,10 @@ from ._models import ( AgentError, - BargeIn, EndCall, EndCallMode, InboundVoiceMessage, + InputDataPart, InputTextPart, OutboundVoiceMessage, ResponseAccepted, @@ -30,6 +30,7 @@ ResponseDone, ResponseDropped, ResponseNone, + ResponseOutputDataDone, ResponseOutputTextDelta, ResponseOutputTextDone, ResponseTimeout, @@ -38,6 +39,7 @@ SessionReady, SessionRejected, SessionStart, + UserBargeIn, UserMessage, UserNoInput, UserSpeechStarted, @@ -134,6 +136,7 @@ "response.created", "response.done", "response.none", + "response.output_data.done", "response.output_text.delta", "response.output_text.done", "session.ready", @@ -197,8 +200,8 @@ def decode_inbound_message(frame: str) -> InboundVoiceMessage | None: # pylint: ) if message_type == "user.speech_started": return UserSpeechStarted(**common) - if message_type == "barge_in": - return BargeIn( + if message_type == "user.barge_in": + return UserBargeIn( **common, response_id=_prefixed_identifier(payload, "response_id", "r_"), item_id=_optional_prefixed_identifier(payload, "item_id", "it_"), @@ -249,6 +252,7 @@ def encode_outbound_message(message: OutboundVoiceMessage) -> str: SessionRejected, ResponseCreated, ResponseNone, + ResponseOutputDataDone, ResponseOutputTextDelta, ResponseOutputTextDone, ResponseDone, @@ -271,15 +275,7 @@ def encode_outbound_message(message: OutboundVoiceMessage) -> str: ) _put_optional_string(payload, "message", message.message) elif isinstance(message, ResponseCreated): - payload["response_id"] = _validate_prefixed_identifier_value(message.response_id, "response_id", "r_") - if message.in_reply_to is not None: - payload["in_reply_to"] = _validate_input_prefix(message.in_reply_to) - if message.admission_timeout_ms is not None or message.supersede_key is not None: - raise ValueError("reply response.created cannot contain proactive admission controls") - else: - if message.admission_timeout_ms is not None: - payload["admission_timeout_ms"] = _validate_admission_timeout_ms(message.admission_timeout_ms) - _put_optional_string(payload, "supersede_key", message.supersede_key, non_empty=True) + _put_response_created_fields(payload, message) elif isinstance(message, ResponseNone): payload["in_reply_to"] = _validate_input_prefix(message.in_reply_to) _put_optional_string(payload, "reason", message.reason) @@ -297,6 +293,12 @@ def encode_outbound_message(message: OutboundVoiceMessage) -> str: text=_validate_string_value(message.text, "text"), ) _put_optional_voice(payload, message.voice) + elif isinstance(message, ResponseOutputDataDone): + payload.update( + response_id=_validate_prefixed_identifier_value(message.response_id, "response_id", "r_"), + item_id=_validate_prefixed_identifier_value(message.item_id, "item_id", "it_"), + data=_thaw_json(message.data), + ) elif isinstance(message, ResponseDone): payload["response_id"] = _validate_prefixed_identifier_value(message.response_id, "response_id", "r_") elif isinstance(message, ResponseCancel): @@ -335,6 +337,27 @@ def encode_outbound_message(message: OutboundVoiceMessage) -> str: return frame +def _put_response_created_fields(payload: dict[str, Any], message: ResponseCreated) -> None: + """Validate response admission fields without owning response lifecycle state. + + :param payload: Outbound frame fields to populate. + :type payload: dict[str, Any] + :param message: Response creation message to validate. + :type message: ResponseCreated + :return: None. + :rtype: None + """ + payload["response_id"] = _validate_prefixed_identifier_value(message.response_id, "response_id", "r_") + if message.in_reply_to is not None: + payload["in_reply_to"] = _validate_input_prefix(message.in_reply_to) + if message.admission_timeout_ms is not None or message.supersede_key is not None: + raise ValueError("reply response.created cannot contain proactive admission controls") + return + if message.admission_timeout_ms is not None: + payload["admission_timeout_ms"] = _validate_admission_timeout_ms(message.admission_timeout_ms) + _put_optional_string(payload, "supersede_key", message.supersede_key, non_empty=True) + + def _parse_session_start(payload: Mapping[str, Any], common: Mapping[str, str]) -> SessionStart: timeout_payload = _required_mapping(payload, "response_timeouts") reconnect = payload.get("reconnect") @@ -370,13 +393,15 @@ def _parse_user_message(payload: Mapping[str, Any], common: Mapping[str, str]) - raw_content = payload.get("content") if not isinstance(raw_content, list) or not raw_content: raise VoiceProtocolError("user.message content must be a non-empty array") - content: list[InputTextPart] = [] + content: list[InputTextPart | InputDataPart] = [] for raw_part in raw_content: if not isinstance(raw_part, dict): raise VoiceProtocolError("user.message content parts must be objects") part_type = raw_part.get("type") if part_type == "input_text": content.append(InputTextPart(text=_required_string(raw_part, "text"))) + elif part_type == "input_data": + content.append(InputDataPart(data=_required_mapping(raw_part, "data"))) elif part_type == "input_image": raise VoiceUnsupportedMessageError("Image content is not supported by this profile") elif not isinstance(part_type, str): diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_models.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_models.py index 772f77464482..67930bdc7803 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_models.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_models.py @@ -189,6 +189,27 @@ class InputTextPart: __repr__ = _voice_model_repr +@experimental +@dataclass(frozen=True, kw_only=True, repr=False) +class InputDataPart: + """One immutable application JSON object in an ordered user message. + + :ivar data: Application-defined JSON object, copied and deeply frozen. + :vartype data: Mapping[str, Any] + :ivar type: Content discriminator, always ``input_data``. + :vartype type: str + """ + + data: Mapping[str, Any] + type: Literal["input_data"] = field(default="input_data", init=False) + __repr__ = _voice_model_repr + + def __post_init__(self) -> None: + if not isinstance(self.data, Mapping): + raise TypeError("data must be a JSON object") + object.__setattr__(self, "data", _freeze_json(self.data, "data", require_finite_numbers=True)) + + @experimental @dataclass(frozen=True, kw_only=True, repr=False) class SessionDisconnected: @@ -277,7 +298,7 @@ def __init__( @experimental @dataclass(frozen=True, kw_only=True, repr=False) class UserMessage(_InboundMessage): - """Completed user text turn. + """Completed user turn containing ordered text and application data. :ivar id: Wire message identifier. :vartype id: str @@ -285,13 +306,13 @@ class UserMessage(_InboundMessage): :vartype ts: str :ivar item_id: Bridge-allocated input item identifier. :vartype item_id: str - :ivar content: Supported text parts in wire order. - :vartype content: tuple[InputTextPart, ...] + :ivar content: Supported text and data parts in wire order. + :vartype content: tuple[InputTextPart | InputDataPart, ...] """ type: ClassVar[str] = "user.message" item_id: str - content: tuple[InputTextPart, ...] + content: tuple[InputTextPart | InputDataPart, ...] @experimental @@ -330,7 +351,7 @@ class UserSpeechStarted(_InboundMessage): @experimental @dataclass(frozen=True, kw_only=True, repr=False) -class BargeIn(_InboundMessage): +class UserBargeIn(_InboundMessage): """Caller interruption and playback snapshot. :ivar id: Wire message identifier. @@ -345,7 +366,7 @@ class BargeIn(_InboundMessage): :vartype item_id: str or None """ - type: ClassVar[str] = "barge_in" + type: ClassVar[str] = "user.barge_in" response_id: str heard_text: str item_id: str | None = None @@ -456,7 +477,7 @@ class SessionEnd(_InboundMessage): | UserMessage | UserNoInput | UserSpeechStarted - | BargeIn + | UserBargeIn | ResponseAccepted | ResponseDropped | ResponseCancelled @@ -618,6 +639,34 @@ def __post_init__(self) -> None: object.__setattr__(self, "voice", _freeze_json(self.voice, "voice")) +@experimental +@dataclass(frozen=True, kw_only=True, repr=False) +class ResponseOutputDataDone(_OutboundMessage): + """Complete one non-audio application-data output item. + + :ivar id: Generated wire message identifier. + :vartype id: str + :ivar ts: Generated sender timestamp. + :vartype ts: str + :ivar response_id: Owning response identifier. + :vartype response_id: str + :ivar item_id: Output item identifier. + :vartype item_id: str + :ivar data: Application-defined JSON object, copied and deeply frozen. + :vartype data: Mapping[str, Any] + """ + + type: ClassVar[str] = "response.output_data.done" + response_id: str + item_id: str + data: Mapping[str, Any] + + def __post_init__(self) -> None: + if not isinstance(self.data, Mapping): + raise TypeError("data must be a JSON object") + object.__setattr__(self, "data", _freeze_json(self.data, "data", require_finite_numbers=True)) + + @experimental @dataclass(frozen=True, kw_only=True, repr=False) class ResponseDone(_OutboundMessage): @@ -711,13 +760,14 @@ class AgentError(_OutboundMessage): _document_dataclass_defaults( ResponseTimeouts, + InputDataPart, InputTextPart, SessionDisconnected, SessionStart, UserMessage, UserNoInput, UserSpeechStarted, - BargeIn, + UserBargeIn, ResponseAccepted, ResponseDropped, ResponseCancelled, @@ -727,6 +777,7 @@ class AgentError(_OutboundMessage): SessionRejected, ResponseCreated, ResponseNone, + ResponseOutputDataDone, ResponseOutputTextDelta, ResponseOutputTextDone, ResponseDone, @@ -741,6 +792,7 @@ class AgentError(_OutboundMessage): | SessionRejected | ResponseCreated | ResponseNone + | ResponseOutputDataDone | ResponseOutputTextDelta | ResponseOutputTextDone | ResponseDone diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py index b242481eba8f..ef9b06a6bcf1 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py @@ -1,7 +1,7 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -"""Typed event relay over the existing Invocations WebSocket transport.""" +"""Typed event relay over standalone CE or legacy Invocations WebSocket transport.""" from __future__ import annotations @@ -45,7 +45,6 @@ from . import _session as _session_transport from ._codec import MAX_FRAME_BYTES, VoiceProtocolError, decode_inbound_message from ._models import ( - BargeIn, InboundVoiceMessage, ResponseAccepted, ResponseCancelled, @@ -54,6 +53,7 @@ SessionDisconnected, SessionEnd, SessionStart, + UserBargeIn, UserMessage, UserNoInput, UserSpeechStarted, @@ -71,7 +71,7 @@ UserMessageCallback = Callable[[Session, UserMessage], Awaitable[None]] UserNoInputCallback = Callable[[Session, UserNoInput], Awaitable[None]] UserSpeechStartedCallback = Callable[[Session, UserSpeechStarted], Awaitable[None]] -BargeInCallback = Callable[[Session, BargeIn], Awaitable[None]] +UserBargeInCallback = Callable[[Session, UserBargeIn], Awaitable[None]] ResponseAcceptedCallback = Callable[[Session, ResponseAccepted], Awaitable[None]] ResponseDroppedCallback = Callable[[Session, ResponseDropped], Awaitable[None]] ResponseCancelledCallback = Callable[[Session, ResponseCancelled], Awaitable[None]] @@ -129,7 +129,7 @@ def _new_voice_context() -> Any: _VOICE_TERMINATION_DEADLINE = "azure.ai.agentserver.invocations.voice.termination_deadline" _VOICE_CONNECTION_TRACE = "azure.ai.agentserver.invocations.voice.connection_trace" _VOICE_CONNECTION_CONTEXT = "azure.ai.agentserver.invocations.voice.connection_context" -_VOICE_ROUTE_CONFLICT = "VoiceAgentServerHost cannot own /invocations_ws because the route is already registered" +_VOICE_ROUTE_CONFLICT = "VoiceAgentServerHost cannot own {path} because the route is already registered" _VOICE_TRACE_PROPAGATOR = _get_voice_trace_propagator() _VOICE_BAGGAGE_KEYS = frozenset( { @@ -184,10 +184,27 @@ def _is_async_callable(callback: Callable[..., Any]) -> bool: class _VoiceWebSocketRoute(WebSocketRoute): - """Reserved Voice route that preserves matching Host and Mount authority.""" + """Reserved Voice route that preserves matching Host and Mount authority. + + :param endpoint: The typed Voice WebSocket endpoint. + :type endpoint: Callable[..., Any] + :keyword router: Router whose Host and Mount authority must be preserved. + :paramtype router: ~starlette.routing.Router + :keyword path: The typed Voice WebSocket route path. + :paramtype path: str + :keyword name: The typed Voice WebSocket route name. + :paramtype name: str + """ - def __init__(self, endpoint: Callable[..., Any], *, router: Router) -> None: - super().__init__(InvocationsWSConstants.ROUTE_PATH, endpoint, name="invocations_ws") + def __init__( + self, + endpoint: Callable[..., Any], + *, + router: Router, + path: str = InvocationsWSConstants.ROUTE_PATH, + name: str = "invocations_ws", + ) -> None: + super().__init__(path, endpoint, name=name) self._router = router def matches(self, scope: Scope) -> tuple[Match, Scope]: @@ -547,16 +564,23 @@ class VoiceAgentServerHost(InvocationAgentServerHost): Agent code owns IDs, application tasks, response lifecycle, terminal-event correlation, cancellation, history, and reconnect restoration. + Both ``/invocations_ws`` and ``/voice_conversation_engine`` expose the same typed + event relay. The legacy route and message handshake version ``1.0`` are + unchanged. Hosted agent protocol declarations are configured separately. + Default Voice observability enables sensitive Agent Framework instrumentation only when ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`` is explicitly set to ``true`` or ``1``. Pass a custom ``configure_observability`` callable in ``kwargs`` to use a different policy. - :param openapi_spec: Optional OpenAPI document inherited from Invocations. - :param asyncapi_spec_json: Optional AsyncAPI JSON document. - :param asyncapi_spec_yaml: Optional AsyncAPI YAML document. - :param kwargs: Remaining :class:`InvocationAgentServerHost` options. + :keyword openapi_spec: Optional OpenAPI document inherited from Invocations. + :paramtype openapi_spec: dict[str, Any] or None + :keyword asyncapi_spec_json: Optional AsyncAPI JSON document. + :paramtype asyncapi_spec_json: dict[str, Any] or None + :keyword asyncapi_spec_yaml: Optional AsyncAPI YAML document. + :paramtype asyncapi_spec_yaml: str or None + :keyword dict[str, Any] ``**kwargs``: Remaining :class:`InvocationAgentServerHost` options. """ def __init__( @@ -570,6 +594,7 @@ def __init__( self._voice_callbacks: dict[str, _VoiceCallback] = {} self._connection_terminating_callback: ConnectionTerminatingCallback | None = None self._voice_route: _VoiceWebSocketRoute | None = None + self._conversation_engine_route: _VoiceWebSocketRoute | None = None if "configure_observability" not in kwargs: kwargs["configure_observability"] = _configure_voice_observability super().__init__( @@ -591,17 +616,28 @@ def _ensure_ws_route_registered(self) -> None: if voice_route is None: voice_route = _VoiceWebSocketRoute(self._ws_endpoint, router=self.router) self._voice_route = voice_route + ce_route = self._conversation_engine_route + if ce_route is None: + ce_route = _VoiceWebSocketRoute( + self._ws_endpoint, + router=self.router, + path="/voice_conversation_engine", + name="voice_conversation_engine", + ) + self._conversation_engine_route = ce_route routes = self.router.routes - for route in routes: - if ( - route is not voice_route - and isinstance(route, WebSocketRoute) - and getattr(route, "path", None) == InvocationsWSConstants.ROUTE_PATH - ): - raise RuntimeError(_VOICE_ROUTE_CONFLICT) - if voice_route in routes: - routes.remove(voice_route) - routes.insert(0, voice_route) + for reserved_route in (voice_route, ce_route): + for route in routes: + if ( + route is not reserved_route + and isinstance(route, WebSocketRoute) + and getattr(route, "path", None) == reserved_route.path + ): + raise RuntimeError(_VOICE_ROUTE_CONFLICT.format(path=reserved_route.path)) + for reserved_route in (ce_route, voice_route): + if reserved_route in routes: + routes.remove(reserved_route) + routes.insert(0, reserved_route) async def _ws_endpoint(self, websocket: WebSocket) -> None: session_id = self.config.session_id or str(uuid.uuid4()) @@ -1089,15 +1125,15 @@ def on_user_speech_started(self, callback: UserSpeechStartedCallback) -> UserSpe """ return self._register_voice_callback(UserSpeechStarted.type, callback) - def on_barge_in(self, callback: BargeInCallback) -> BargeInCallback: - """Register the ``barge_in`` callback. + def on_user_barge_in(self, callback: UserBargeInCallback) -> UserBargeInCallback: + """Register the ``user.barge_in`` callback. :param callback: Async callback receiving the thin Session and event. - :type callback: BargeInCallback + :type callback: UserBargeInCallback :return: The callback, unchanged. - :rtype: BargeInCallback + :rtype: UserBargeInCallback """ - return self._register_voice_callback(BargeIn.type, callback) + return self._register_voice_callback(UserBargeIn.type, callback) def on_response_accepted(self, callback: ResponseAcceptedCallback) -> ResponseAcceptedCallback: """Register the ``response.accepted`` callback. diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml b/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml index 32e8de91646f..047d7ffbc27a 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml +++ b/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml @@ -8,7 +8,7 @@ authors = [ ] license = "MIT" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/README.md b/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/README.md index c9eb79b4bc06..7223b5072999 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/README.md +++ b/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/README.md @@ -4,6 +4,8 @@ This sample hosts a text-only agent for the Voice Live Bridge protocol `1.0`. The SDK relays typed events while the application owns response generation, task cancellation, correlation, and target-turn trace completion. +Caller interruptions arrive as `user.barge_in` and are handled by `@app.on_user_barge_in` with a `UserBargeIn` event. Voice Live senders must use the same event contract. Interruption cancellation and `heard_text` remain part of the same Bridge message contract. + ## Prerequisites - Python 3.10 or later @@ -11,23 +13,31 @@ task cancellation, correlation, and target-turn trace completion. ## Install -Create and activate a virtual environment, then install the sample dependency: +This sample requires `azure-ai-agentserver-invocations>=1.3.0b1,<2.0.0` for +`UserBargeIn` and `on_user_barge_in`. Version `1.2.x` cannot run this sample. + +Create and activate a virtual environment: ```bash python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate -python -m pip install -r requirements.txt ``` -For local SDK development, install the sibling packages or their wheels instead -of the published dependency: +Until a release containing these APIs and the CE route is published, you must +install a matching local SDK build. Replace the paths below with Core and +Invocations wheels built from the same SDK checkout: ```bash python -m pip install \ - /path/to/azure_ai_agentserver_core-2.1.0b1-py3-none-any.whl \ - /path/to/azure_ai_agentserver_invocations-1.2.0b1-py3-none-any.whl + /path/to/azure_ai_agentserver_core-2.3.0b1-py3-none-any.whl \ + /path/to/azure_ai_agentserver_invocations-1.3.0b1-py3-none-any.whl +python -m pip install -r requirements.txt ``` +After a matching release is available, `python -m pip install -r requirements.txt` +can install the dependency directly from the package feed. The version constraint +alone does not publish the new APIs or make them available in older SDK builds. + ## Run ```bash @@ -35,16 +45,56 @@ python basic_voice_agent.py ``` The server listens on `0.0.0.0` and uses the `PORT` environment variable when -set; otherwise it listens on port `8088`. The hosted platform connects to the -`/invocations_ws` route. +set; otherwise it listens on port `8088`. Foundry selects the container route +from the hosted agent's protocol declaration: `invocations_ws` forwards to +`/invocations_ws`, while `voice_conversation_engine` forwards to `/voice_conversation_engine`. ## Deploy Use the accompanying `agent.manifest.yaml` when configuring the hosted agent. -The three declarations are required together: `invocations_ws`, +For the legacy endpoint, the three declarations are required together: `invocations_ws`, `voiceLiveCompatible: "true"`, and exact `bridgeProtocolVersion: "1.0"`. Omitting the version selects the previously shipped non-Bridge integration. +### Standalone Conversation Engine + +With an SDK build that includes standalone CE support, keep the existing +`app = VoiceAgentServerHost()` construction and declare CE in the hosted agent +definition. Use the field matching the agent's existing schema; enabling CE does +not require a schema migration. + +For new-schema definitions using `container_configuration` or `code_configuration`: + +```yaml +protocol_versions: + - protocol: voice_conversation_engine + version: "1.0.0" +``` + +For legacy definitions using `image`: + +```yaml +container_protocol_versions: + - protocol: voice_conversation_engine + version: "1.0.0" +``` + +These are hosted agent definition fragments, not complete deployment manifests +or replacements for `agent.manifest.yaml`. If the agent must also serve legacy +Bridge calls, retain its existing `invocations_ws` declaration and Bridge metadata. + +The typed host exposes both `/voice_conversation_engine` and `/invocations_ws`, but the +Foundry protocol declaration determines which public endpoint can invoke it. +For CE, no `invocations_ws` declaration, +`voiceLiveCompatible`, or `bridgeProtocolVersion` metadata is required. The existing +callbacks, IDs, cancellation and cleanup code are unchanged, and the message +handshake still uses `protocol_version="1.0"`. The SDK does not modify the +Foundry registration. Existing legacy deployments can keep their manifest and +metadata unchanged. Rebuild the container +with the new SDK before publishing a CE-declaring version. Foundry CE routing and +CE-aware Voice Live must be deployed before enabling this registration; local SDK +tests alone do not prove that the end-to-end route is ready. + The sample intentionally uses a simulated model stream. Replace `generate_answer` with the application's model call while preserving the application-owned task cleanup shown by the event callbacks. diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/basic_voice_agent.py b/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/basic_voice_agent.py index d2a4483ae267..2923e4322887 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/basic_voice_agent.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/basic_voice_agent.py @@ -12,7 +12,6 @@ from dataclasses import dataclass from azure.ai.agentserver.invocations.voice import ( - BargeIn, InputTextPart, ResponseCancel, ResponseCancelled, @@ -32,6 +31,7 @@ TargetTurn, TargetTurnOrigin, TargetTurnOutcome, + UserBargeIn, UserMessage, VoiceAgentServerHost, new_item_id, @@ -321,8 +321,8 @@ def on_generation_finished(completed: asyncio.Task[None]) -> None: raise -@app.on_barge_in -async def on_barge_in(session: Session, event: BargeIn) -> None: +@app.on_user_barge_in +async def on_user_barge_in(session: Session, event: UserBargeIn) -> None: """Stop generation and reconcile history from the playback snapshot.""" cancel_generation(session, event.response_id, TargetTurnOutcome.CANCELLED) logger.info("Voice response interrupted") diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/requirements.txt b/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/requirements.txt index e0009d4236b2..99a963687c17 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/requirements.txt +++ b/sdk/agentserver/azure-ai-agentserver-invocations/samples/basic_voice_agent/requirements.txt @@ -1 +1 @@ -azure-ai-agentserver-invocations>=1.2.0b1,<2.0.0 \ No newline at end of file +azure-ai-agentserver-invocations>=1.3.0b1,<2.0.0 diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_basic_voice_agent.py b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_basic_voice_agent.py index 2fe2c527530c..a619a42159aa 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_basic_voice_agent.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_basic_voice_agent.py @@ -10,6 +10,7 @@ import pytest import yaml +from packaging.requirements import Requirement import azure.ai.agentserver.invocations.voice as voice from azure.ai.agentserver.invocations.voice import ( @@ -27,6 +28,7 @@ SessionStart, SessionTermination, TargetTurnOutcome, + UserBargeIn, UserMessage, ) @@ -185,7 +187,8 @@ def test_sample_includes_setup_run_and_bridge_manifest(): assert "python -m pip install -r requirements.txt" in readme assert "python basic_voice_agent.py" in readme assert "/invocations_ws" in readme - assert requirements == ["azure-ai-agentserver-invocations>=1.2.0b1,<2.0.0"] + assert requirements == ["azure-ai-agentserver-invocations>=1.3.0b1,<2.0.0"] + assert "azure_ai_agentserver_invocations-1.3.0b1-py3-none-any.whl" in readme manifest = yaml.safe_load((_SAMPLE_ROOT / "agent.manifest.yaml").read_text(encoding="utf-8")) assert manifest["protocols"] == ["invocations_ws"] @@ -193,6 +196,16 @@ def test_sample_includes_setup_run_and_bridge_manifest(): assert manifest["bridgeProtocolVersion"] == "1.0" +@pytest.mark.parametrize( + ("version", "supported"), + [("1.2.0b1", False), ("1.2.0", False), ("1.3.0b1", True), ("1.3.0", True), ("2.0.0", False)], +) +def test_sample_dependency_requires_user_barge_in_sdk(version, supported): + requirement = Requirement((_SAMPLE_ROOT / "requirements.txt").read_text(encoding="utf-8").strip()) + assert requirement.name == "azure-ai-agentserver-invocations" + assert requirement.specifier.contains(version) is supported + + @pytest.mark.asyncio async def test_session_start_accepts_only_the_supported_protocol(sample_module): unsupported_session = _CapturingSession() @@ -256,6 +269,35 @@ async def blocked_generation(_text): assert not sample_module.input_generations +@pytest.mark.asyncio +async def test_user_barge_in_cancels_sample_owned_generation(sample_module, monkeypatch): + started = asyncio.Event() + + async def blocked_generation(_text): + started.set() + await asyncio.Event().wait() + yield "not reached" + + monkeypatch.setattr(sample_module, "generate_answer", blocked_generation) + session = _CapturingSession() + await sample_module.on_user_message( + session, + UserMessage(id="m_user", ts="2026-10-19T00:00:00Z", item_id="in_1", content=(InputTextPart(text="hello"),)), + ) + await asyncio.wait_for(started.wait(), timeout=1) + generation = next(iter(sample_module.generations.values())) + await sample_module.on_user_barge_in( + session, + UserBargeIn(id="m_interrupt", ts="2026-10-19T00:00:01Z", response_id=generation.response_id, heard_text=""), + ) + with pytest.raises(asyncio.CancelledError): + await generation.task + assert generation.task.cancelled() + assert generation.turn.completions[0]["outcome"] == TargetTurnOutcome.CANCELLED + assert not sample_module.generations + assert not sample_module.input_generations + + @pytest.mark.asyncio @pytest.mark.parametrize( ("termination", "expected"), diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_codec.py b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_codec.py index 257c95075080..15cb10f4b48e 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_codec.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_codec.py @@ -13,7 +13,6 @@ import azure.ai.agentserver.invocations.voice as voice from azure.ai.agentserver.invocations.voice import ( AgentError, - BargeIn, EndCall, InputTextPart, ResponseCancel, @@ -29,6 +28,7 @@ SessionReady, SessionRejected, SessionStart, + UserBargeIn, UserMessage, ) from azure.ai.agentserver.invocations.voice._codec import ( @@ -51,6 +51,57 @@ def _frame(message_type: str, **fields): ) +class TestDataPassthrough: + def test_decode_preserves_mixed_content_and_freezes_data(self) -> None: + event = decode_inbound_message( + _frame( + "user.message", + item_id="in_data", + content=[ + {"type": "input_text", "text": "hello"}, + {"type": "input_data", "data": {"nested": [1, True, None, {"key": "value"}]}}, + ], + ) + ) + assert isinstance(event, UserMessage) + assert len(event.content) == 2 + assert event.content[1].data["nested"] == (1, True, None, {"key": "value"}) + with pytest.raises(TypeError): + event.content[1].data["nested"][3]["key"] = "changed" + + @pytest.mark.parametrize("payload", [None, [], "text", 1]) + def test_decode_rejects_non_object_data(self, payload: object) -> None: + with pytest.raises(VoiceProtocolError): + decode_inbound_message( + _frame( + "user.message", + item_id="in_data", + content=[{"type": "input_data", "data": payload}], + ) + ) + + def test_encode_data_item_copies_payload_and_redacts_repr(self) -> None: + payload = {"type": "hubagent.metadata", "data": {"secret": ["private-value"]}} + message = voice.ResponseOutputDataDone(response_id="r_data", item_id="it_data", data=payload) + payload["data"]["secret"].append("mutated") + encoded = json.loads(encode_outbound_message(message)) + assert encoded["type"] == "response.output_data.done" + assert encoded["data"]["data"]["secret"] == ["private-value"] + assert "private-value" not in repr(message) + + def test_empty_data_object_is_valid(self) -> None: + event = decode_inbound_message( + _frame( + "user.message", + item_id="in_data", + content=[{"type": "input_data", "data": {}}], + ) + ) + assert event.content[0].data == {} + message = voice.ResponseOutputDataDone(response_id="r_data", item_id="it_data", data={}) + assert json.loads(encode_outbound_message(message))["data"] == {} + + @pytest.mark.parametrize( "frame", [ @@ -63,7 +114,7 @@ def _frame(message_type: str, **fields): _frame("user.message", item_id="in_1", content=[{"type": "input_text", "text": "hello"}]), _frame("user.no_input", item_id="in_2", count=1), _frame("user.speech_started"), - _frame("barge_in", response_id="r_1", heard_text="heard"), + _frame("user.barge_in", response_id="r_1", heard_text="heard"), _frame("response.accepted", response_id="r_2"), _frame("response.dropped", response_id="r_3", reason="queue_full"), _frame("response.cancelled", response_id="r_4", heard_text="heard"), @@ -78,6 +129,26 @@ def test_decode_all_selected_inbound_messages(frame): assert event.id == "m_1" +def test_user_barge_in_decodes_with_playback_snapshot(): + event = decode_inbound_message(_frame("user.barge_in", response_id="r_1", item_id="it_1", heard_text="heard")) + assert event is not None + assert isinstance(event, UserBargeIn) + assert event.type == "user.barge_in" + assert event.response_id == "r_1" + assert event.item_id == "it_1" + assert event.heard_text == "heard" + + +def test_legacy_barge_in_is_not_a_supported_event(): + assert decode_inbound_message(_frame("barge_in", response_id="r_1", heard_text="heard")) is None + + +def test_old_barge_in_public_names_are_not_retained(): + assert not hasattr(voice, "BargeIn") + assert not hasattr(voice, "BargeInCallback") + assert not hasattr(voice.VoiceAgentServerHost, "on_barge_in") + + def test_session_start_caller_is_deeply_read_only(): event = decode_inbound_message( _frame( @@ -338,13 +409,14 @@ def test_session_start_reconnect_rejects_present_greeting(): ) -def test_selected_registry_is_exactly_ten_each_direction(): +def test_selected_registry_includes_data_output() -> None: inbound = InboundVoiceMessage.__args__ outbound = OutboundVoiceMessage.__args__ assert len(inbound) == 10 - assert len(outbound) == 10 + assert len(outbound) == 11 + assert voice.ResponseOutputDataDone in outbound assert len({message.type for message in inbound}) == 10 - assert len({message.type for message in outbound}) == 10 + assert len({message.type for message in outbound}) == 11 def test_all_public_voice_callables_are_experimental(): @@ -388,7 +460,7 @@ def test_voice_model_repr_redacts_sensitive_payloads(): item_id="in_1", content=(InputTextPart(text=sensitive),), ), - BargeIn( + UserBargeIn( id="m_3", ts="2026-08-12T00:00:00Z", response_id="r_1", diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_host.py b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_host.py index e69de29bb2d1..7d9e4d600144 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_host.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_host.py @@ -0,0 +1,245 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Standalone CE endpoint registration and legacy transport isolation tests.""" + +import re + +import pytest +from starlette.applications import Starlette +from starlette.routing import Host, Mount, WebSocketRoute +from starlette.testclient import TestClient +from starlette.websockets import WebSocket, WebSocketDisconnect + +from azure.ai.agentserver.invocations import InvocationAgentServerHost +from azure.ai.agentserver.invocations.voice import ( + ResponseCreated, + ResponseDone, + ResponseOutputTextDone, + Session, + SessionReady, + SessionStart, + UserMessage, + VoiceAgentServerHost, +) + + +@pytest.fixture(name="session_start_frame") +def _session_start_frame() -> dict[str, object]: + return { + "type": "session.start", + "id": "m_start", + "ts": "2026-10-15T00:00:00Z", + "protocol_version": "1.0", + "reconnect": False, + "response_timeouts": {"first_output_ms": 1000, "idle_ms": 1000, "max_duration_ms": 3000}, + } + + +class TestVoiceEndpointRoutes: + """Keep both endpoints independent of the unchanged typed Bridge wire contract.""" + + def test_host_adds_ce_without_replacing_legacy_route(self) -> None: + app = VoiceAgentServerHost(configure_observability=None) + routes = [(route.path, route.name) for route in app.routes if isinstance(route, WebSocketRoute)] + assert routes == [ + ("/invocations_ws", "invocations_ws"), + ("/voice_conversation_engine", "voice_conversation_engine"), + ] + assert app.url_path_for("invocations_ws") == "/invocations_ws" + assert app.url_path_for("voice_conversation_engine") == "/voice_conversation_engine" + + def test_typed_host_does_not_expose_superseded_ce_route(self) -> None: + app = VoiceAgentServerHost(configure_observability=None) + + with TestClient(app) as client: + with pytest.raises(WebSocketDisconnect): + with client.websocket_connect("/conversation_engine"): + pytest.fail("The superseded CE route must not be accepted") + + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + def test_both_endpoints_relay_existing_bridge_messages(self, protocol: str, session_start_frame) -> None: + app = VoiceAgentServerHost(configure_observability=None) + paths = [route.path for route in app.routes if isinstance(route, WebSocketRoute)] + assert paths == ["/invocations_ws", "/voice_conversation_engine"] + + @app.on_session_start + async def start(session: Session, event: SessionStart) -> None: + assert event.protocol_version == "1.0" + await session.send(SessionReady()) + + @app.on_user_message + async def respond(session: Session, event: UserMessage) -> None: + await session.send(ResponseCreated(response_id="r_reply", in_reply_to=(event.item_id,))) + await session.send(ResponseOutputTextDone(response_id="r_reply", item_id="it_reply", text="Hello.")) + await session.send(ResponseDone(response_id="r_reply")) + + with TestClient(app).websocket_connect(f"/{protocol}") as websocket: + websocket.send_json(session_start_frame) + assert websocket.receive_json()["type"] == "session.ready" + websocket.send_json( + { + "type": "user.message", + "id": "m_input", + "ts": "2026-10-15T00:00:01Z", + "item_id": "in_question", + "content": [{"type": "input_text", "text": "Hello"}], + } + ) + created = websocket.receive_json() + assert created["type"] == "response.created" + assert created["in_reply_to"] == ["in_question"] + assert websocket.receive_json()["text"] == "Hello." + assert websocket.receive_json()["type"] == "response.done" + + def test_endpoints_keep_connection_sessions_separate(self, session_start_frame) -> None: + app = VoiceAgentServerHost(configure_observability=None) + sessions = [] + + @app.on_session_start + async def start(session: Session, _event: SessionStart) -> None: + sessions.append(session) + await session.send(SessionReady()) + + @app.on_user_message + async def respond(session: Session, event: UserMessage) -> None: + await session.send(ResponseCreated(response_id=f"r_{event.item_id}", in_reply_to=(event.item_id,))) + await session.send(ResponseDone(response_id=f"r_{event.item_id}")) + + with TestClient(app) as client: + with client.websocket_connect("/invocations_ws") as legacy: + legacy.send_json(session_start_frame) + assert legacy.receive_json()["type"] == "session.ready" + with client.websocket_connect("/voice_conversation_engine") as ce: + ce.send_json(session_start_frame) + assert ce.receive_json()["type"] == "session.ready" + ce.send_json( + { + "type": "user.message", + "id": "m_ce", + "ts": "2026-10-15T00:00:01Z", + "item_id": "in_ce", + "content": [{"type": "input_text", "text": "CE"}], + } + ) + assert ce.receive_json()["response_id"] == "r_in_ce" + assert ce.receive_json()["type"] == "response.done" + # Closing a CE connection must not close or replace the legacy session. + legacy.send_json( + { + "type": "user.message", + "id": "m_legacy", + "ts": "2026-10-15T00:00:02Z", + "item_id": "in_legacy", + "content": [{"type": "input_text", "text": "Legacy"}], + } + ) + assert legacy.receive_json()["response_id"] == "r_in_legacy" + assert legacy.receive_json()["type"] == "response.done" + assert len(sessions) == 2 + assert sessions[0] is not sessions[1] + + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + def test_both_routes_reject_same_scope_conflicts(self, protocol: str) -> None: + async def conflicting_endpoint(websocket: WebSocket) -> None: + await websocket.accept() + + path = f"/{protocol}" + with pytest.raises(RuntimeError, match=re.escape(f"cannot own {path}")): + VoiceAgentServerHost( + routes=[WebSocketRoute(path, conflicting_endpoint)], + configure_observability=None, + ) + + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + def test_both_routes_recheck_live_conflicts(self, protocol: str) -> None: + app = VoiceAgentServerHost(configure_observability=None) + + async def conflicting_endpoint(websocket: WebSocket) -> None: + await websocket.accept() + + path = f"/{protocol}" + app.router.routes.append(WebSocketRoute(path, conflicting_endpoint)) + with pytest.raises(RuntimeError, match=re.escape(f"cannot own {path}")): + with TestClient(app).websocket_connect(path): + pytest.fail("A conflicting route must not be accepted") + + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + @pytest.mark.parametrize("authority_kind", ["host", "mount"]) + def test_both_routes_preserve_host_and_mount_authority(self, protocol: str, authority_kind: str) -> None: + async def authority_endpoint(websocket: WebSocket) -> None: + await websocket.accept() + await websocket.send_text("authority") + + path = f"/{protocol}" + nested = Starlette(routes=[WebSocketRoute(path, authority_endpoint)]) + authority = Host("tenant.example", app=nested) if authority_kind == "host" else Mount("/", app=nested) + app = VoiceAgentServerHost(routes=[authority], configure_observability=None) + headers = {"host": "tenant.example"} if authority_kind == "host" else {} + with TestClient(app).websocket_connect(path, headers=headers) as websocket: + assert websocket.receive_text() == "authority" + + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + def test_both_routes_precede_live_catch_all(self, protocol: str, session_start_frame) -> None: + async def catch_all(websocket: WebSocket) -> None: + await websocket.accept() + await websocket.send_text("catch_all") + + app = VoiceAgentServerHost(configure_observability=None) + app.router.routes.insert(0, WebSocketRoute("/{path:path}", catch_all)) + + @app.on_session_start + async def start(session: Session, _event: SessionStart) -> None: + await session.send(SessionReady()) + + with TestClient(app) as client: + with client.websocket_connect(f"/{protocol}") as websocket: + websocket.send_json(session_start_frame) + assert websocket.receive_json()["type"] == "session.ready" + with client.websocket_connect("/other") as websocket: + assert websocket.receive_text() == "catch_all" + paths = [route.path for route in app.routes if isinstance(route, WebSocketRoute)] + assert paths == ["/invocations_ws", "/voice_conversation_engine", "/{path:path}"] + + def test_generic_invocations_host_still_exposes_only_raw_ws(self) -> None: + app = InvocationAgentServerHost(configure_observability=None) + + @app.ws_handler + async def raw_ws(websocket: WebSocket) -> None: + await websocket.send_text("raw protocol") + + with TestClient(app) as client: + with client.websocket_connect("/invocations_ws") as websocket: + assert websocket.receive_text() == "raw protocol" + with pytest.raises(WebSocketDisconnect): + with client.websocket_connect("/voice_conversation_engine"): + pytest.fail("A raw WS handler must not enable CE") + + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + def test_both_endpoints_preserve_reconnect_contract(self, protocol: str, session_start_frame) -> None: + app = VoiceAgentServerHost(configure_observability=None) + reconnects = [] + + @app.on_session_start + async def start(session: Session, event: SessionStart) -> None: + reconnects.append(event.reconnect) + assert event.protocol_version == "1.0" + await session.send(SessionReady()) + + with TestClient(app) as client: + for reconnect in (False, True): + with client.websocket_connect(f"/{protocol}") as websocket: + websocket.send_json({**session_start_frame, "reconnect": reconnect}) + assert websocket.receive_json()["type"] == "session.ready" + assert reconnects == [False, True] + + def test_typed_host_keeps_legacy_raw_handler_replacement_error(self) -> None: + app = VoiceAgentServerHost(configure_observability=None) + + async def raw_ws(_websocket: WebSocket) -> None: + pass + + with pytest.raises( + RuntimeError, match="^VoiceAgentServerHost owns /invocations_ws; use on_ decorators$" + ): + app.ws_handler(raw_ws) diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_protocol_findings.py b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_protocol_findings.py index 86a343eb821c..3d0476b19179 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_protocol_findings.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/tests/voice/test_voice_protocol_findings.py @@ -14,11 +14,19 @@ from azure.ai.agentserver.invocations.voice import _voice_host as voice_host_module from azure.ai.agentserver.invocations.voice import ( + InputDataPart, ResponseCreated, + ResponseDone, + ResponseNone, + ResponseOutputDataDone, + Session, SessionEnd, SessionReady, + SessionStart, SessionTermination, + UserBargeIn, UserSpeechStarted, + UserMessage, VoiceAgentServerHost, ) from azure.ai.agentserver.invocations.voice._codec import MAX_FRAME_BYTES, encode_outbound_message @@ -26,6 +34,113 @@ from conftest import _records_with_ws_extras +class TestUserBargeInDispatch: + @pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) + def test_only_user_barge_in_reaches_callback_with_playback_snapshot(self, protocol: str) -> None: + app = VoiceAgentServerHost(configure_observability=None) + interruptions: list[UserBargeIn] = [] + + @app.on_session_start + async def start(session: Session, _event: SessionStart) -> None: + await session.send(SessionReady()) + + @app.on_user_barge_in + async def interrupted(_session: Session, event: UserBargeIn) -> None: + interruptions.append(event) + + @app.on_user_message + async def barrier(session: Session, event: UserMessage) -> None: + await session.send(ResponseNone(in_reply_to=(event.item_id,))) + + with TestClient(app).websocket_connect(f"/{protocol}") as websocket: + websocket.send_text( + _voice_frame( + "session.start", + "m_start", + protocol_version="1.0", + reconnect=False, + response_timeouts={"first_output_ms": 1000, "idle_ms": 1000, "max_duration_ms": 5000}, + )["text"] + ) + assert websocket.receive_json()["type"] == "session.ready" + for message_type in ("barge_in", "user.barge_in"): + websocket.send_text( + _voice_frame( + message_type, + f"m_{message_type}", + response_id="r_reply", + item_id="it_reply", + heard_text="heard prefix", + )["text"] + ) + websocket.send_text( + _voice_frame( + "user.message", + "m_barrier", + item_id="in_barrier", + content=[{"type": "input_text", "text": "next"}], + )["text"] + ) + assert websocket.receive_json()["type"] == "response.none" + assert len(interruptions) == 1 + interruption = interruptions[0] + assert interruption.type == "user.barge_in" + assert interruption.response_id == "r_reply" + assert interruption.item_id == "it_reply" + assert interruption.heard_text == "heard prefix" + + +@pytest.mark.parametrize("silent", [False, True]) +@pytest.mark.parametrize("protocol", ["invocations_ws", "voice_conversation_engine"]) +def test_data_and_silent_completion_over_websocket(silent: bool, protocol: str) -> None: + app = VoiceAgentServerHost(configure_observability=None) + + @app.on_session_start + async def start(session: Session, event: SessionStart) -> None: + assert event.protocol_version == "1.0" + await session.send(SessionReady()) + + @app.on_user_message + async def data(session: Session, event: UserMessage) -> None: + if silent: + await session.send(ResponseNone(in_reply_to=(event.item_id,), reason="acknowledged")) + return + await session.send(ResponseCreated(response_id="r_data", in_reply_to=(event.item_id,))) + part = event.content[0] + assert isinstance(part, InputDataPart) + await session.send(ResponseOutputDataDone(response_id="r_data", item_id="it_data", data=part.data)) + await session.send(ResponseDone(response_id="r_data")) + + with TestClient(app).websocket_connect(f"/{protocol}") as websocket: + websocket.send_text( + _voice_frame( + "session.start", + "m_start", + protocol_version="1.0", + reconnect=False, + response_timeouts={"first_output_ms": 1000, "idle_ms": 1000, "max_duration_ms": 5000}, + )["text"] + ) + assert websocket.receive_json()["type"] == "session.ready" + payload = {"type": "hubagent.metadata", "data": [True, None, {"key": "value"}]} + websocket.send_text( + _voice_frame( + "user.message", + "m_data", + item_id="in_data", + content=[{"type": "input_data", "data": payload}], + )["text"] + ) + first = websocket.receive_json() + if silent: + assert first["type"] == "response.none" + assert first["in_reply_to"] == ["in_data"] + else: + assert first["type"] == "response.created" + assert websocket.receive_json()["data"] == payload + assert websocket.receive_json()["type"] == "response.done" + + def _voice_frame(message_type, message_id, **fields): return { "type": "websocket.receive", From cd8fb947640017c49a5752765aa1891786f1309d Mon Sep 17 00:00:00 2001 From: Sanskriti Date: Thu, 22 Oct 2026 17:51:03 +0530 Subject: [PATCH 20/35] [ML] Fix registry model get returning None system_metadata (#49620) * [ML] Fix registry model get dropping system_metadata Registry model GETs are deserialized into the arm hybrid ModelVersion, whose properties have no typed system_metadata attribute. The value was only present as a raw mapping key (snake_case at the registry data-plane api-version, camelCase at newer api-versions), so Model._from_rest_object always returned None. Read it from the raw mapping, matching the existing handling of intellectualProperty and deployment templates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [ML] Preserve empty registry model system_metadata Use a None check instead of truthiness when falling back between the snake_case and camelCase system_metadata keys, so an explicitly empty mapping is not turned into None. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: santyagi Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 + .../ml/entities/_assets/_artifacts/model.py | 11 ++- .../model/unittests/test_model_schema.py | 72 +++++++++++++++++++ 3 files changed, 81 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index 38b48935f0ac..492270f837dc 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -6,6 +6,7 @@ - Added Spark runtime 3.5 support for model monitoring serverless Spark compute while retaining runtime 3.4 support. ### Bugs Fixed +- Fixed `MLClient.models.get()` for registry models returning `system_metadata` as `None` even when the model has system metadata. ## 1.35.1 (2026-09-30) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index ed2c131ce6bd..7c467f147672 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -151,9 +151,14 @@ def _from_rest_object(cls, model_rest_object: ModelVersion) -> "Model": rest_model_version: ModelVersionProperties = model_rest_object.properties arm_id = AMLVersionedArmId(arm_id=model_rest_object.id) model_stage = rest_model_version.stage if hasattr(rest_model_version, "stage") else None - model_system_metadata = ( - rest_model_version.system_metadata if hasattr(rest_model_version, "system_metadata") else None - ) + # system_metadata is an attribute on msrest models. On arm hybrid models it is only present as a raw mapping + # key: the registry data-plane api-version returns it snake_case, newer api-versions return it camelCase. + model_system_metadata = getattr(rest_model_version, "system_metadata", None) + if model_system_metadata is None and isinstance(rest_model_version, Mapping): + # Compare against None rather than truthiness so an explicitly empty mapping is preserved. + model_system_metadata = rest_model_version.get("system_metadata") + if model_system_metadata is None: + model_system_metadata = rest_model_version.get("systemMetadata") if hasattr(rest_model_version, "flavors"): flavors = {key: flavor.data for key, flavor in rest_model_version.flavors.items()} diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py index 0454920b4d37..1acefa8b3d3f 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py @@ -53,6 +53,78 @@ def test_deserialize_with_system_metadata(self) -> None: assert model_version_resource.properties.system_metadata["publisher"] == "Contoso" assert model_version_resource.properties.system_metadata["license"] == "MIT License" + @pytest.mark.parametrize("wire_key", ["system_metadata", "systemMetadata"]) + def test_system_metadata_from_rest_object(self, wire_key: str) -> None: + rest_model = { + "id": "azureml://registries/fake_registry/models/fake_model/versions/1", + "name": "fake_model", + "type": "models", + "properties": { + "description": "a description", + "tags": {}, + "properties": {}, + "isArchived": False, + "isAnonymous": False, + "flavors": {}, + "modelType": "custom_model", + "modelUri": "azureml://datastore/fake_datastore/paths/fake_model_uri", + wire_key: { + "publisher": "Contoso", + "modelCapabilities": ["agentsV2"], + "deprecation": {"date": "2026-01-01"}, + }, + }, + "systemData": {}, + } + + # The registry data-plane api-version returns system_metadata snake_case; newer api-versions use camelCase. + # Neither is a typed attribute on the arm hybrid model, so it must be read from the raw mapping. + from_rest_model = Model._from_rest_object(ModelVersion._deserialize(rest_model, [])) + + assert from_rest_model._system_metadata == { + "publisher": "Contoso", + "modelCapabilities": ["agentsV2"], + "deprecation": {"date": "2026-01-01"}, + } + + @pytest.mark.parametrize("wire_key", ["system_metadata", "systemMetadata"]) + def test_system_metadata_from_rest_object_empty_mapping(self, wire_key: str) -> None: + rest_model = { + "id": "azureml://registries/fake_registry/models/fake_model/versions/1", + "name": "fake_model", + "type": "models", + "properties": { + "description": "a description", + "flavors": {}, + "modelType": "custom_model", + "modelUri": "azureml://datastore/fake_datastore/paths/fake_model_uri", + wire_key: {}, + }, + "systemData": {}, + } + + from_rest_model = Model._from_rest_object(ModelVersion._deserialize(rest_model, [])) + + assert from_rest_model._system_metadata == {} + + def test_system_metadata_from_rest_object_absent(self) -> None: + rest_model = { + "id": "azureml://registries/fake_registry/models/fake_model/versions/1", + "name": "fake_model", + "type": "models", + "properties": { + "description": "a description", + "flavors": {}, + "modelType": "custom_model", + "modelUri": "azureml://datastore/fake_datastore/paths/fake_model_uri", + }, + "systemData": {}, + } + + from_rest_model = Model._from_rest_object(ModelVersion._deserialize(rest_model, [])) + + assert from_rest_model._system_metadata is None + def test_ipp_model(self) -> None: rest_ipp_model = { "id": "azureml://registries/fake_registry/models/fake_ipp_model/versions/611575", From 615db41d7a3614f5e7c51bcf214e695c5a6993c3 Mon Sep 17 00:00:00 2001 From: Nathandrake229 <39689729+Nathandrake229@users.noreply.github.com> Date: Thu, 22 Oct 2026 21:05:13 +0530 Subject: [PATCH 21/35] [agentserver] Separate Invocations and Responses task-runtime activation (#49616) * [agentserver] Scope task activation to protocol feature controls Keep the explicit task switch for Invocations and derive Responses activation from resilient_background or steerable_conversations. Scope runtime access by host and protocol without changing persistent backends, request mode semantics, or recovery dispositions. Add activation/request matrices, mixed-host and WebSocket isolation coverage, startup failure checks, and feature-driven crash conformance. Update minimum core requirements and related samples/docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b3f38ee6-97fe-4707-8f3d-5a1169666792 * [agentserver] Clarify task activation in Responses sample guide Describe feature-driven startup, steering-only recovery, and the lack of task-based locking/crash cleanup when both Responses flags are disabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b3f38ee6-97fe-4707-8f3d-5a1169666792 * [agentserver] Align unreleased changelogs with package versions Use versioned preview headings so version-specific release-note extraction includes the protocol activation and dependency changes. Preserve released history and align runtime/API metadata versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b3f38ee6-97fe-4707-8f3d-5a1169666792 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b3f38ee6-97fe-4707-8f3d-5a1169666792 --- .../azure-ai-agentserver-core/CHANGELOG.md | 15 + .../azure/ai/agentserver/core/_base.py | 103 +++--- .../azure/ai/agentserver/core/_middleware.py | 70 +++- .../ai/agentserver/core/tasks/_decorator.py | 78 +++-- .../ai/agentserver/core/tasks/_enablement.py | 47 +-- .../ai/agentserver/core/tasks/_manager.py | 125 ++++++- .../docs/tasks-guide.md | 44 +-- .../tests/tasks/test_recovery_filter.py | 82 +++++ .../test_task_manager_not_initialized.py | 133 ++++++- .../tests/test_snapshot_lifecycle.py | 25 +- .../CHANGELOG.md | 11 + .../ai/agentserver/invocations/_invocation.py | 66 ++-- .../agentserver/invocations/_invocation_ws.py | 34 +- .../invocations/voice/_voice_host.py | 15 +- .../pyproject.toml | 2 +- .../tests/test_protocol_task_enablement.py | 328 ++++++++++++++++++ .../tests/test_recovery_restart_identity.py | 117 +++++++ .../CHANGELOG.md | 32 ++ .../azure-ai-agentserver-responses/README.md | 27 +- .../api.metadata.yml | 2 +- .../ai/agentserver/responses/_version.py | 2 +- .../responses/hosting/_orchestrator.py | 8 +- .../hosting/_resilient_orchestrator.py | 49 ++- .../agentserver/responses/hosting/_routing.py | 32 +- .../docs/resilience-contract.md | 64 +++- .../resilient-responses-developer-guide.md | 89 +++-- .../pyproject.toml | 4 +- .../samples/README.md | 22 +- .../samples/sample_19_resilient_streaming.py | 7 - .../samples/sample_20_resilient_steering.py | 13 +- .../samples/sample_21_resilient_langgraph.py | 66 +--- .../samples/sample_22_resilient_multiturn.py | 22 +- .../contract/test_resilient_start_failure.py | 12 +- .../resilience_contract/_steering_handler.py | 6 - .../e2e/resilience_contract/_test_handler.py | 14 +- .../tests/e2e/resilience_contract/conftest.py | 4 +- .../resilience_contract/test_row_2_path_a.py | 1 + .../resilience_contract/test_row_2_path_b.py | 1 + .../resilience_contract/test_row_2_path_c.py | 30 +- .../test_protocol_task_enablement.py | 279 +++++++++++++++ .../test_steering_input_handoff.py | 2 +- .../unit/test_response_delete_recovery.py | 1 + .../unit/test_stream_lifecycle_cleanup.py | 3 +- 43 files changed, 1651 insertions(+), 436 deletions(-) create mode 100644 sdk/agentserver/azure-ai-agentserver-invocations/tests/test_protocol_task_enablement.py create mode 100644 sdk/agentserver/azure-ai-agentserver-invocations/tests/test_recovery_restart_identity.py create mode 100644 sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_protocol_task_enablement.py diff --git a/sdk/agentserver/azure-ai-agentserver-core/CHANGELOG.md b/sdk/agentserver/azure-ai-agentserver-core/CHANGELOG.md index 239666ca2a18..a1d49cd8be1d 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/CHANGELOG.md +++ b/sdk/agentserver/azure-ai-agentserver-core/CHANGELOG.md @@ -4,10 +4,25 @@ ### Features Added +- Added protocol-scoped task-runtime startup requests so protocol hosts can + obtain scoped `TaskManager` access without mutating the process-wide + resilient-task switch. This prevents one protocol's enablement from + activating another protocol in a mixed host. + ### Breaking Changes ### Bugs Fixed +- Preserve host-owned recovery callbacks and task options when loading + process-wide task descriptors at startup. +- Exclude protocol-disabled task functions before startup, periodic or inline + recovery can reclaim their leases or dispatch their handlers. +- Require explicit owning-host registration for protocol-internal recovery + callbacks instead of importing them into unrelated managers. +- Treat a persisted task function identity as authoritative before recovery + cleanup or reclaim. Legacy callback fallback applies only when that + identity is absent. + ### Other Changes ## 2.3.0b1 (2026-10-15) diff --git a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_base.py b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_base.py index e0a45a337319..92847fcb6dc0 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_base.py +++ b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_base.py @@ -13,7 +13,7 @@ Awaitable, Callable, ) -from typing import Any, MutableMapping, Optional +from typing import TYPE_CHECKING, Any, MutableMapping, Optional from starlette.applications import Starlette from starlette.middleware import Middleware @@ -25,7 +25,7 @@ from . import _config, _tracing from ._errors import create_error_response from ._lifecycle import AgentSessionContext, _LifecycleState -from ._middleware import InboundRequestLoggingMiddleware +from ._middleware import InboundRequestLoggingMiddleware, _TaskManagerMiddleware from ._request_context import ( FoundryAgentRequestContext, get_request_context, @@ -37,6 +37,9 @@ from ._types import MiddlewareFactory, P from ._version import VERSION as _CORE_VERSION +if TYPE_CHECKING: + from .tasks._manager import TaskManager + logger = logging.getLogger("azure.ai.agentserver") # Pre-built health-check response to avoid per-request allocation. @@ -273,6 +276,11 @@ def __init__( # pylint: disable=too-many-statements self._shutdown_fn: Optional[Callable[[], Awaitable[None]]] = None self._readiness_fn: Optional[Callable[[Request], Awaitable[Response]]] = None self._lifecycle = _LifecycleState() + # Protocol mixins contribute independent startup requirements via cooperative init. + task_manager_requirements: list[Callable[[], bool]] = kwargs.pop( + "_task_manager_requirements", [_resilient_tasks_enabled] + ) + self._task_manager: Any = None # Pre-shutdown callbacks invoked SYNCHRONOUSLY from the # SIGTERM signal handler — before Hypercorn's graceful drain # begins. Used by responses to set ``_shutdown_requested`` early so @@ -316,7 +324,7 @@ def __init__( # pylint: disable=too-many-statements # Build lifespan context manager @contextlib.asynccontextmanager - async def _lifespan(_app: Starlette) -> AsyncGenerator[None, None]: # noqa: RUF029 + async def _run_lifespan(_app: Starlette) -> AsyncGenerator[None, None]: # noqa: RUF029 logger.info("AgentServerHost started") # --- Startup configuration logging --- @@ -345,26 +353,10 @@ async def _lifespan(_app: Starlette) -> AsyncGenerator[None, None]: # noqa: RUF protocols, ) - # --- Resilient task manager initialization --- - # - # The resilient ``TaskManager`` is CONSTRUCTED ONLY when resilient - # tasks were explicitly enabled via - # ``set_resilient_tasks_enabled(True)``. Recovery (and the durable - # task subsystem as a whole) is strictly opt-in: a host that does - # not set the switch pays nothing — no manager, no provider client, - # no task-store call, no recovery loop. - # - # When the switch is OFF the manager is NOT installed, so - # ``get_task_manager()`` raises ``TaskManagerNotInitialized``. - # Callers that route through the manager (e.g. the responses - # protocol's ``store=true`` path) are expected to SWALLOW that - # signal and degrade to non-durable, in-process execution — the - # response still runs and persists, it simply is not crash- - # recoverable. Declaring a durable task (``@task`` / - # ``@multi_turn_task``) does NOT implicitly turn the subsystem on; - # an app that wants durable tasks / recovery must set the switch. + # Invocations uses the core switch; Responses contributes its own + # feature flags. Merely registering task callbacks is not an opt-in. task_manager: Any = None - if _resilient_tasks_enabled(): + if any(required() for required in task_manager_requirements): # Resilient tasks were explicitly enabled. Construct the manager # and run startup recovery. If EITHER fails, durability was # explicitly requested, so fail the lifespan (fail-fast at boot) @@ -381,8 +373,10 @@ async def _lifespan(_app: Starlette) -> AsyncGenerator[None, None]: # noqa: RUF shutdown_event=asyncio.Event(), shutdown_grace_seconds=_read_task_manager_shutdown_grace(), ) + self._task_manager = task_manager set_task_manager(task_manager) try: + self._register_task_callbacks(task_manager) await task_manager.startup() except BaseException: # ``set_task_manager`` above already installed the manager @@ -395,14 +389,17 @@ async def _lifespan(_app: Starlette) -> AsyncGenerator[None, None]: # noqa: RUF await task_manager.shutdown() except Exception: # pylint: disable=broad-exception-caught logger.warning("Error shutting down TaskManager after startup failure", exc_info=True) - set_task_manager(None) + from .tasks._manager import _clear_task_manager # pylint: disable=import-outside-toplevel + + _clear_task_manager(task_manager) + self._task_manager = None task_manager = None raise logger.info("TaskManager initialized with startup recovery") else: logger.info( - "TaskManager NOT initialized (resilient tasks disabled; enable via " - "set_resilient_tasks_enabled(True)). Durable tasks and crash recovery " + "TaskManager NOT initialized (no protocol requested task execution). " + "Durable tasks and crash recovery " "are inactive; store=true work degrades to non-durable execution. " "tasks_declared=%s", _has_registered_tasks(), @@ -445,15 +442,24 @@ async def _lifespan(_app: Starlette) -> AsyncGenerator[None, None]: # noqa: RUF if task_manager is not None: try: await task_manager.shutdown() - from .tasks._manager import ( # pylint: disable=import-outside-toplevel - set_task_manager as _clear_manager, - ) - - _clear_manager(None) logger.info("TaskManager shut down") except Exception: # pylint: disable=broad-exception-caught logger.warning("Error shutting down TaskManager", exc_info=True) + @contextlib.asynccontextmanager + async def _lifespan(app: Starlette) -> AsyncGenerator[None, None]: + from .tasks._manager import _task_manager_scope # pylint: disable=import-outside-toplevel + + with _task_manager_scope(lambda: self._task_manager): + try: + async with _run_lifespan(app): + yield + finally: + from .tasks._manager import _clear_task_manager # pylint: disable=import-outside-toplevel + + _clear_task_manager(self._task_manager) + self._task_manager = None + async def _before_snapshot_route(request: Request) -> Response: return await AgentServerHost._before_snapshot_endpoint(self, request) @@ -498,6 +504,7 @@ async def _after_restore_route(request: Request) -> Response: routes=all_routes, lifespan=_lifespan, middleware=[ + Middleware(_TaskManagerMiddleware, get_manager=lambda: self._task_manager), Middleware(InboundRequestLoggingMiddleware), # type: ignore[arg-type] Middleware( # type: ignore[arg-type] _PlatformHeaderMiddleware, @@ -516,6 +523,13 @@ async def _after_restore_route(request: Request) -> Response: self.add_middleware(TraceContextMiddleware) + def _register_task_callbacks(self, manager: "TaskManager") -> None: + """Bind protocol recovery callbacks before the manager's startup scan. + + :param manager: This host's task manager. + :type manager: ~azure.ai.agentserver.core.tasks._manager.TaskManager + """ + def add_middleware( self, middleware_class: MiddlewareFactory[P], @@ -737,14 +751,10 @@ def _parse_session_context(payload: dict[str, Any]) -> AgentSessionContext: if not isinstance(restore_id, str) or not restore_id: raise ValueError("restore_id must be a non-empty string") if not isinstance(raw_overrides, dict) or any( - not isinstance(key, str) or not isinstance(value, str) - for key, value in raw_overrides.items() + not isinstance(key, str) or not isinstance(value, str) for key, value in raw_overrides.items() ): raise ValueError("session_env_overrides must map strings to strings") - if any( - not key or "=" in key or "\0" in key or "\0" in value - for key, value in raw_overrides.items() - ): + if any(not key or "=" in key or "\0" in key or "\0" in value for key, value in raw_overrides.items()): raise ValueError("session_env_overrides contains an invalid environment entry") override_session_id = raw_overrides.get(_SESSION_ID_ENV) if override_session_id is not None and override_session_id != session_id: @@ -780,8 +790,7 @@ async def _before_snapshot_endpoint(self, request: Request) -> Response: status_code=500, ) self._lifecycle.captured_environment_values = { - key: os.environ.get(key) - for key in self._lifecycle.applied_environment_variables + key: os.environ.get(key) for key in self._lifecycle.applied_environment_variables } self._lifecycle.before_snapshot_completed = True return JSONResponse({"status": "ok"}) @@ -815,20 +824,12 @@ async def _after_restore_endpoint(self, request: Request) -> Response: effective_environment = dict(context.session_env_overrides) effective_environment.setdefault(_SESSION_ID_ENV, context.session_id) - environment_variables = ( - self._lifecycle.applied_environment_variables - | effective_environment.keys() - ) - previous_environment = { - key: os.environ.get(key, _MISSING_ENV) - for key in environment_variables - } + environment_variables = self._lifecycle.applied_environment_variables | effective_environment.keys() + previous_environment = {key: os.environ.get(key, _MISSING_ENV) for key in environment_variables} captured_environment = dict(self._lifecycle.captured_environment_values) for key, value in previous_environment.items(): if key not in captured_environment: - captured_environment[key] = ( - None if value is _MISSING_ENV else str(value) - ) + captured_environment[key] = None if value is _MISSING_ENV else str(value) previous_config = vars(self.config).copy() task_manager = _get_active_task_manager() @@ -842,9 +843,7 @@ async def _after_restore_endpoint(self, request: Request) -> Response: restored_config = _config.AgentConfig.from_env() vars(self.config).update(vars(restored_config)) if task_manager is not None: - task_manager._rehydrate_session_state( # pylint: disable=protected-access - context.restore_id - ) + task_manager._rehydrate_session_state(context.restore_id) # pylint: disable=protected-access current_request_context = get_request_context() request_context_token = set_request_context( diff --git a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_middleware.py b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_middleware.py index 4fb3fe78a9cd..29ecf3e7a335 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_middleware.py +++ b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/_middleware.py @@ -20,13 +20,64 @@ import logging import time -from typing import Any, MutableMapping +from typing import Any, Callable, MutableMapping from starlette.types import ASGIApp, Receive, Scope, Send +from starlette.middleware import Middleware logger = logging.getLogger("azure.ai.agentserver") +class _TaskManagerMiddleware: + """Scope task access to the host and protocol serving this request.""" + + def __init__(self, app: ASGIApp, *, get_manager: Callable[[], Any]) -> None: + self.app = app + self._get_manager = get_manager + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + from .tasks._manager import _task_manager_scope # pylint: disable=import-outside-toplevel + + with _task_manager_scope(self._get_manager): + await self.app(scope, receive, send) + + +def _task_access_middleware(host: Any, enabled: Callable[[], bool]) -> list[Middleware]: + """Scope task access to this host only when its protocol is enabled. + + :param host: The owning protocol host. + :type host: Any + :param enabled: Whether the protocol permits task execution. + :type enabled: Callable[[], bool] + :return: Protocol-scoped task middleware. + :rtype: list[~starlette.middleware.Middleware] + """ + return [ + Middleware( + _TaskManagerMiddleware, + get_manager=lambda: host._task_manager if enabled() else None, # pylint: disable=protected-access + ) + ] + + +def _task_runtime_middleware(host: Any, kwargs: dict[str, Any], enabled: Callable[[], bool]) -> list[Middleware]: + """Register protocol activation and scope its routes to the host's runtime. + + :param host: The protocol host being constructed. + :type host: Any + :param kwargs: Cooperative host-constructor arguments. + :type kwargs: dict[str, Any] + :param enabled: Whether this protocol requests task execution. + :type enabled: Callable[[], bool] + :return: Middleware for this protocol's routes. + :rtype: list[~starlette.middleware.Middleware] + """ + requirements = list(kwargs.pop("_task_manager_requirements", [])) + requirements.append(enabled) + kwargs["_task_manager_requirements"] = requirements + return _task_access_middleware(host, enabled) + + def _extract_header(headers: list[tuple[bytes, bytes]], name: bytes) -> str | None: """Extract a header value from raw ASGI headers. @@ -147,7 +198,10 @@ async def _send_wrapper(message: MutableMapping[str, Any]) -> None: elapsed_ms = (time.monotonic() - start) * 1000 logger.warning( "Inbound %s %s failed with status 500 in %.1fms%s", - method, path, elapsed_ms, extra_str, + method, + path, + elapsed_ms, + extra_str, ) raise @@ -156,10 +210,18 @@ async def _send_wrapper(message: MutableMapping[str, Any]) -> None: if status_code is not None and status_code >= 400: logger.warning( "Inbound %s %s completed with status %d in %.1fms%s", - method, path, status_code, elapsed_ms, extra_str, + method, + path, + status_code, + elapsed_ms, + extra_str, ) else: logger.info( "Inbound %s %s completed with status %s in %.1fms%s", - method, path, status_code, elapsed_ms, extra_str, + method, + path, + status_code, + elapsed_ms, + extra_str, ) diff --git a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_decorator.py b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_decorator.py index 141de90362a7..ca16ea56a2d6 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_decorator.py +++ b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_decorator.py @@ -20,7 +20,9 @@ async def my_task(ctx: TaskContext[MyInput]) -> MyOutput: import asyncio # pylint: disable=do-not-import-asyncio import inspect import logging as _logging -from collections.abc import Awaitable, Callable +from collections.abc import Awaitable, Callable, Iterator +from contextlib import contextmanager +from contextvars import ContextVar from datetime import timedelta from typing import ( TYPE_CHECKING, @@ -36,6 +38,7 @@ async def my_task(ctx: TaskContext[MyInput]) -> MyOutput: from ._client import TransportClassifiedError as _TransportClassifiedError from ._context import TaskContext +from ._exceptions import TaskManagerNotInitialized from ._exceptions_internal import _HostedConflict, _translate_hosted_conflict from ._retry import RetryPolicy from ._run import TaskRun @@ -142,6 +145,23 @@ def _validate_input_id(input_id: str) -> None: # Global registry of resilient task descriptors for recovery purposes. # Populated at import time when @task decorates a function. _REGISTERED_DESCRIPTORS: list[tuple[str, Callable[..., Any], "TaskOptions"]] = [] +# Recognize protocol identities even when their callbacks are not owned locally. +_HOST_BOUND_TASK_NAMES: set[str] = set() +_host_bound_registration: ContextVar[bool] = ContextVar("host_bound_task_registration", default=False) + + +@contextmanager +def _host_bound_task_registration() -> Iterator[None]: + """Require explicit owning-host registration for protocol task callbacks. + + :return: Registration scope for protocol-owned task definitions. + :rtype: Iterator[None] + """ + token = _host_bound_registration.set(True) + try: + yield + finally: + _host_bound_registration.reset(token) def _strip_reserved_tags(tags: dict[str, str]) -> dict[str, str]: @@ -415,6 +435,7 @@ class TaskOptions: # pylint: disable=too-many-instance-attributes "retry", "steerable", "_is_multi_turn", # — True when wrapped by @multi_turn_task + "_requires_host_registration", ) def __init__( @@ -436,6 +457,7 @@ def __init__( self.retry = retry self.steerable = steerable self._is_multi_turn = _is_multi_turn + self._requires_host_registration = _host_bound_registration.get() def __repr__(self) -> str: return ( @@ -472,14 +494,20 @@ def __init__( self._output_type = output_type self.name = opts.name # Register for recovery — manager picks these up at startup + if opts._requires_host_registration: + _HOST_BOUND_TASK_NAMES.add(opts.name) _REGISTERED_DESCRIPTORS.append((opts.name, fn, opts)) + if opts._requires_host_registration: + return # — if a TaskManager is already initialised (decorators # declared after startup, e.g. in tests), eagerly push into its # resume tables so _recover_stale_tasks / get_active_run can pick # up the multi-turn opts (_is_multi_turn). try: - from ._manager import _manager as _live_manager # pylint: disable=import-outside-toplevel - except ImportError: # pragma: no cover + from ._manager import get_task_manager # pylint: disable=import-outside-toplevel + + _live_manager = get_task_manager() + except (ImportError, TaskManagerNotInitialized): _live_manager = None # type: ignore[assignment] if _live_manager is not None: try: @@ -1798,28 +1826,28 @@ def multi_turn_task( ) -> Any: """Decorator producing a multi-turn resilient chain. - Multi-turn chains accept inputs across many turns against the same - ``task_id``. The handler's ``return X`` is the implicit-suspend - signal — there is no ``ctx.suspend``. The chain stays - alive across handler raises. - - :param fn: The handler to decorate (parameterized form only; the bare - ``@multi_turn_task`` form is rejected because it cannot supply a - ``name``). - :type fn: Callable[..., Any] | None - :keyword name: **Required** stable chain-identity anchor (no - function-derived default; omitting it raises ``ValueError``). - :keyword title: Static human-readable string. Callable-factory form is - not supported. - :keyword timeout: Per-turn cooperative timeout. Defaults to 1 day when - unset; 7 days is a hard ceiling (larger/negative rejected at - decoration). This is a per-turn cap, not a chain-lifetime bound. - :keyword retry: Default retry policy. - :keyword steerable: When True, ``start()`` against an in-flight chain - queues the new input instead of raising ``TaskConflictError``. - :return: A :class:`MultiTurnTask` instance (distinct public class from - :class:`Task`). - :rtype: Any + Multi-turn chains accept inputs across many turns against the same + ``task_id``. The handler's ``return X`` is the implicit-suspend + signal — there is no ``ctx.suspend``. The chain stays + alive across handler raises. + + :param fn: The handler to decorate (parameterized form only; the bare + ``@multi_turn_task`` form is rejected because it cannot supply a + ``name``). + :type fn: Callable[..., Any] | None + :keyword name: **Required** stable chain-identity anchor (no + function-derived default; omitting it raises ``ValueError``). + :keyword title: Static human-readable string. Callable-factory form is + not supported. + :keyword timeout: Per-turn cooperative timeout. Defaults to 1 day when + unset; 7 days is a hard ceiling (larger/negative rejected at + decoration). This is a per-turn cap, not a chain-lifetime bound. + :keyword retry: Default retry policy. + :keyword steerable: When True, ``start()`` against an in-flight chain + queues the new input instead of raising ``TaskConflictError``. + :return: A :class:`MultiTurnTask` instance (distinct public class from + :class:`Task`). + :rtype: Any """ # — reject unknown kwargs at decoration time _validate_multi_turn_task_kwargs(**_extra_kwargs) diff --git a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_enablement.py b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_enablement.py index f2ee13727c73..0fadb67b0793 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_enablement.py +++ b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_enablement.py @@ -1,24 +1,18 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -"""Explicit opt-in switch for the resilient task subsystem. +"""Explicit task-runtime opt-in for the Invocations protocol. -The resilient ``TaskManager`` is constructed by ``AgentServerHost`` **only when -this switch is on**. It is the single source of truth for the durable task -subsystem: when the switch is off, no ``TaskManager`` is installed, so -``get_task_manager()`` raises -:class:`~azure.ai.agentserver.core.tasks.TaskManagerNotInitialized` and -``.run()`` / ``.start()`` cannot run a task. When on, the manager is -constructed and the startup crash-recovery scan (plus the periodic recovery -loop) runs. +The switch defaults to ``False`` and is evaluated before Invocations lifespan +startup. Declaring ``@task`` or ``@multi_turn_task`` does not enable execution. +The low-level ``AgentServerHost`` also uses this switch when no protocol has +provided its own activation requirements. -Recovery — and durable tasks as a whole — is therefore strictly opt-in. Merely -declaring a durable task (``@task`` / ``@multi_turn_task``) does **not** turn -the subsystem on; you must set this switch (directly, or via a protocol option -that maps to it, e.g. the responses ``resilient_background`` server option). +Responses does not read or change this switch. Its task runtime is enabled by +``ResponsesServerOptions.resilient_background`` or ``steerable_conversations``. +Protocol request scopes prevent one protocol's opt-in from enabling another. -The switch is process-global and defaults to ``False``. Set it before -``AgentServerHost`` lifespan startup (typically at import time):: +Set the switch before Invocations lifespan startup:: from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled @@ -29,18 +23,13 @@ def set_resilient_tasks_enabled(value: bool = True) -> None: - """Opt in to (or clear) the resilient task subsystem process-wide. + """Enable or disable task execution for Invocations hosts. - This gates whether ``AgentServerHost`` constructs the ``TaskManager`` at - lifespan startup. Setting it to ``True`` constructs the manager, runs the - startup crash-recovery scan, and starts the periodic recovery loop. When it - is ``False`` no manager is installed: ``get_task_manager()`` raises - :class:`~azure.ai.agentserver.core.tasks.TaskManagerNotInitialized` and a - durable task cannot run (callers such as the responses ``store=true`` path - swallow that and degrade to non-durable in-process execution). - - Must be called before ``AgentServerHost`` lifespan startup (typically at - import time) to take effect. Defaults to enabling when called with no + Enabled hosts initialize a persistent task manager, perform startup recovery + and run the periodic recovery loop. Set this before lifespan startup. + Responses hosts use their own feature options independently, including on + cooperative multi-protocol hosts. This setting remains process-global for + Invocations configuration and defaults to enabling when called without an argument. :param value: ``True`` to enable the resilient task subsystem, ``False`` to @@ -52,11 +41,9 @@ def set_resilient_tasks_enabled(value: bool = True) -> None: def resilient_tasks_enabled() -> bool: - """Return whether the resilient task subsystem is enabled. + """Return the Invocations task-runtime opt-in setting. - This is the authoritative gate: a ``False`` return means no ``TaskManager`` - is constructed and durable tasks / crash recovery are inactive (declaring a - task does NOT change this — the subsystem is opt-in). + This does not report whether a Responses host has enabled its own runtime. :return: ``True`` if :func:`set_resilient_tasks_enabled` turned it on. :rtype: bool diff --git a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_manager.py b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_manager.py index 5218ec4f6c83..bfb13be53708 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_manager.py +++ b/sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/tasks/_manager.py @@ -14,7 +14,9 @@ import logging import os import traceback -from collections.abc import Awaitable, Callable, Mapping +from collections.abc import Awaitable, Callable, Iterator, Mapping +from contextlib import contextmanager +from contextvars import ContextVar from typing import Any, TypeVar from .._config import AgentConfig @@ -283,15 +285,38 @@ def _lease_is_dead( return True +_scoped_task_manager: ContextVar[Callable[[], TaskManager | None] | None] = ContextVar( + "agentserver_task_manager", default=None +) + + +@contextmanager +def _task_manager_scope(get_manager: Callable[[], TaskManager | None]) -> Iterator[None]: + """Bind task access to the current host/protocol, including a disabled runtime. + + :param get_manager: Resolve the current runtime, or None for disabled access. + :type get_manager: Callable[[], TaskManager | None] + :return: The scoped task access context. + :rtype: Iterator[None] + """ + token = _scoped_task_manager.set(get_manager) + try: + yield + finally: + _scoped_task_manager.reset(token) + + def get_task_manager() -> TaskManager: - """Return the active TaskManager singleton. + """Return the current protocol's manager, or the installed standalone manager. :raises ~azure.ai.agentserver.core.tasks.TaskManagerNotInitialized: If no manager has been initialized. :return: The active manager. :rtype: TaskManager """ - if _manager is None: + scoped = _scoped_task_manager.get() + manager = scoped() if scoped is not None else _manager + if manager is None: from ._exceptions import ( # pylint: disable=import-outside-toplevel TaskManagerNotInitialized, ) @@ -299,11 +324,11 @@ def get_task_manager() -> TaskManager: raise TaskManagerNotInitialized( "TaskManager not initialized: the resilient task subsystem is not enabled. " "Durable tasks and crash recovery are opt-in - call " - "set_resilient_tasks_enabled(True) before host startup (e.g. at import time), " - "or, for the responses protocol, construct the host with " - "ResponsesServerOptions(resilient_background=True)." # pylint: disable=implicit-str-concat + "set_resilient_tasks_enabled(True) for Invocations before host startup, " + "or enable resilient_background or steerable_conversations on " + "ResponsesServerOptions, and run the host lifespan." ) - return _manager + return manager def set_task_manager(manager: TaskManager | None) -> None: @@ -318,6 +343,17 @@ def set_task_manager(manager: TaskManager | None) -> None: _manager = manager +def _clear_task_manager(manager: TaskManager | None) -> None: + """Clear only the compatibility singleton owned by this manager. + + :param manager: The host's task manager. + :type manager: TaskManager | None + :rtype: None + """ + if _manager is manager: + set_task_manager(None) + + class _ActiveTask: # pylint: disable=too-many-instance-attributes """In-memory tracking for a running task.""" @@ -423,6 +459,8 @@ def __init__( self._active_tasks: dict[str, _ActiveTask] = {} self._resume_callbacks: dict[str, Callable[..., Any]] = {} self._resume_opts: dict[str, TaskOptions] = {} + self._disabled_recovery_names: set[str] = set() + self._host_bound_callback_names: set[str] = set() self._lease_owner = derive_lease_owner( config.agent_name or "unknown-agent", config.session_id or "local", @@ -584,6 +622,16 @@ def register_resume_callback( self._resume_callbacks[fn_name] = fn if opts is not None: self._resume_opts[fn_name] = opts + if opts._requires_host_registration: + self._host_bound_callback_names.add(fn_name) + + def _disable_recovery_for(self, *fn_names: str) -> None: + """Exclude protocol task functions from this manager's recovery. + + :param fn_names: Persisted task function names disabled by their protocol. + :type fn_names: str + """ + self._disabled_recovery_names.update(fn_names) async def list_tasks( self, @@ -756,9 +804,16 @@ async def startup(self) -> None: _REGISTERED_DESCRIPTORS, ) + registered_callbacks = self._resume_callbacks.copy() + registered_opts = self._resume_opts.copy() for fn_name, fn, opts in _REGISTERED_DESCRIPTORS: + if opts._requires_host_registration: + continue self._resume_callbacks[fn_name] = fn self._resume_opts[fn_name] = opts + # Explicit host bindings must win over process-wide import order. + self._resume_callbacks.update(registered_callbacks) + self._resume_opts.update(registered_opts) await self._recover_stale_tasks() @@ -895,7 +950,7 @@ async def shutdown(self) -> None: active.execution_task.cancel() self._active_tasks.clear() - set_task_manager(None) + _clear_task_manager(self) async def create_and_run( self, @@ -2983,8 +3038,10 @@ async def _recover_stale_tasks(self) -> None: return for task_info in stale_tasks: - # Skip if we're already tracking this task - if task_info.id in self._active_tasks: + # Check owning-host authorization before any recovery writes. + if task_info.id in self._active_tasks or not self._recovery_is_authorized( + self._find_resume_callback_name(task_info) + ): continue # (Spec 038) One-time legacy cleanup: delete pre-schema tasks @@ -3086,28 +3143,60 @@ async def _recover_stale_tasks(self) -> None: def _find_resume_callback(self, task_info: TaskInfo) -> Callable[..., Any] | None: """Find a registered resume callback for a task. - Matches by ``source.name`` (auto-stamped function name) first, - then falls back to title prefix match or single-callback default. + An explicit ``source.name`` must match a registered callback. + Title-prefix and single-callback fallback apply only to legacy + records without a source identity. :param task_info: The task record to match. :type task_info: TaskInfo :return: A matching resume callback, or None. :rtype: Callable[..., Any] | None """ - # Preferred: match by source.name (framework auto-stamped fn name) + name = self._find_resume_callback_name(task_info) + if name is None or not self._recovery_is_authorized(name): + return None + return self._resume_callbacks.get(name) + + def _recovery_is_authorized(self, name: str | None) -> bool: + """Check protocol opt-in and explicit ownership of internal callbacks. + + :param name: Persisted or legacy-resolved callback name. + :type name: str | None + :return: Whether recovery may touch and dispatch this task. + :rtype: bool + """ + from ._decorator import _HOST_BOUND_TASK_NAMES # pylint: disable=import-outside-toplevel + + return ( + name in self._resume_callbacks + and name not in self._disabled_recovery_names + and (name not in _HOST_BOUND_TASK_NAMES or name in self._host_bound_callback_names) + ) + + def _find_resume_callback_name(self, task_info: TaskInfo) -> str | None: + """Read explicit identity or resolve an identity-free legacy record. + + :param task_info: The persisted task record. + :type task_info: TaskInfo + :return: Persisted function identity or a legacy callback name. + :rtype: str | None + """ + # Never substitute another callback for an explicit persisted identity. if task_info.source and "name" in task_info.source: source_name = task_info.source["name"] - if source_name in self._resume_callbacks: - return self._resume_callbacks[source_name] + if not isinstance(source_name, str): + logger.warning("Skipping task %s with invalid source.name", task_info.id) + return None + return source_name # Fallback: title prefix match - for name, fn in self._resume_callbacks.items(): + for name in self._resume_callbacks: if task_info.title and task_info.title.startswith(name): - return fn + return name # Last resort: single registered callback if len(self._resume_callbacks) == 1: - return next(iter(self._resume_callbacks.values())) + return next(iter(self._resume_callbacks)) return None # --------------------------------------------------------------- # diff --git a/sdk/agentserver/azure-ai-agentserver-core/docs/tasks-guide.md b/sdk/agentserver/azure-ai-agentserver-core/docs/tasks-guide.md index 686482afc2fc..01279fb58de4 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/docs/tasks-guide.md +++ b/sdk/agentserver/azure-ai-agentserver-core/docs/tasks-guide.md @@ -115,10 +115,11 @@ What this primitive deliberately does **not** do: ### Enabling resilient tasks -The resilient task subsystem is **opt-in**. The `TaskManager` is constructed — -and its **startup recovery scan** (a network round-trip to the hosted task store -that reclaims tasks left in-flight by a crashed prior instance) plus the -periodic recovery loop run — **only when the switch is on**: +For direct Core task APIs and the Invocations protocol, the resilient task +subsystem is **opt-in**. The host requests a `TaskManager` — including its +**startup recovery scan** (a network round-trip to the hosted task store that +reclaims tasks left in-flight by a crashed prior instance) and periodic +recovery loop — when the switch is on: ```python from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled @@ -126,20 +127,25 @@ from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled set_resilient_tasks_enabled(True) # opt in BEFORE host startup (e.g. at import) ``` -Use `resilient_tasks_enabled()` to read the current switch state. +Use `resilient_tasks_enabled()` to read the current switch state. This +process-wide switch controls direct Core task use and is the opt-in used by the +Invocations protocol. Merely declaring a durable task (`@task` / `@multi_turn_task`) does **not** turn -the subsystem on. When the switch is off, no `TaskManager` is installed: -`get_task_manager()` raises `TaskManagerNotInitialized` and `.run()` / `.start()` -cannot run a task. A server that does not set the switch (e.g. an -invocations-only host) constructs no manager and pays none of the recovery-scan -latency. - -> **Protocol note:** the responses protocol exposes a `resilient_background` -> server option that maps to this switch — constructing a -> `ResponsesAgentServerHost(options=ResponsesServerOptions(resilient_background=True))` -> enables the subsystem automatically, so responses apps typically don't call -> `set_resilient_tasks_enabled` directly. +the subsystem on. Without this switch or a protocol-scoped startup request, no +`TaskManager` is installed: `get_task_manager()` raises +`TaskManagerNotInitialized` and `.run()` / `.start()` cannot run a task. A +plain host that requests neither path constructs no manager and pays none of +the recovery-scan latency. + +> **Protocol note:** the Responses protocol does not read or change this +> process-wide switch. A `ResponsesAgentServerHost` requests protocol-scoped +> `TaskManager` access at startup when either `resilient_background=True` or +> `steerable_conversations=True`. When both options are `False`, calling +> `set_resilient_tasks_enabled(True)` elsewhere cannot force Responses onto its +> task runtime. This keeps mixed-protocol hosts isolated: enabling Responses +> does not activate Invocations, and enabling Invocations does not activate +> Responses. ### One-shot @@ -147,8 +153,7 @@ latency. import asyncio from azure.ai.agentserver.core.tasks import task, TaskContext, set_resilient_tasks_enabled -# Optional: force-enable recovery even before the first task is declared. -# Declaring the @task below already enables recovery on its own. +# Required for direct Core task use; call before host startup. set_resilient_tasks_enabled(True) @task(name="summarize") @@ -171,8 +176,7 @@ asyncio.run(main()) import asyncio from azure.ai.agentserver.core.tasks import multi_turn_task, TaskContext, set_resilient_tasks_enabled -# Optional: force-enable recovery even before the first task is declared. -# Declaring the @multi_turn_task below already enables recovery on its own. +# Required for direct Core task use; call before host startup. set_resilient_tasks_enabled(True) @multi_turn_task(name="chat") diff --git a/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_recovery_filter.py b/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_recovery_filter.py index 6470ecc8fb2d..3c0b533d5dd1 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_recovery_filter.py +++ b/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_recovery_filter.py @@ -14,6 +14,7 @@ from __future__ import annotations +import asyncio import datetime from pathlib import Path @@ -164,3 +165,84 @@ async def my_task(ctx: TaskContext[str]) -> str: mgr_mod._manager = None # Silence unused-arg warning on the helper. _ = foreign_record + + +@pytest.mark.parametrize("recovery_path", ["startup", "periodic", "inline"]) +@pytest.mark.asyncio +async def test_disabled_recovery_does_not_mutate_task( + captured_local, monkeypatch: pytest.MonkeyPatch, recovery_path: str +) -> None: + from azure.ai.agentserver.core.tasks import _decorator + from azure.ai.agentserver.core.tasks._manager import _SCHEMA_VERSION, _SCHEMA_VERSION_KEY + + monkeypatch.setattr(_decorator, "_REGISTERED_DESCRIPTORS", []) + monkeypatch.setattr(mgr_mod, "_manager", None) + if recovery_path == "periodic": + monkeypatch.setattr(mgr_mod, "_PERIODIC_RECOVERY_INTERVAL_SECONDS", 0.01) + eligible_ran = asyncio.Event() + excluded_calls = [] + + @task(name="protocol_disabled") + async def excluded(ctx: TaskContext[str]) -> str: + excluded_calls.append(ctx.input) + return "must not execute" + + @task(name="protocol_enabled") + async def eligible(ctx: TaskContext[str]) -> str: + eligible_ran.set() + return "recovered" + + manager = TaskManager(config=_config_stub(), provider=captured_local) + manager._disable_recovery_for(excluded.name) + started = False + try: + if recovery_path != "startup": + await manager.startup() + started = True + for primitive in (excluded, eligible): + info = await captured_local.create( + TaskCreateRequest( + id=primitive.name, + agent_name="test-agent", + session_id="test-session", + status="in_progress", + title=primitive.name, + payload={"input": "persisted", _SCHEMA_VERSION_KEY: _SCHEMA_VERSION}, + tags={"task_name": primitive.name}, + source=TaskManager._build_source(primitive.name), + lease_owner="test-agent|session:test-session", + lease_instance_id="interrupted-instance", + lease_duration_seconds=60, + ) + ) + info.lease.expires_at = ( + datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(minutes=10) + ).isoformat() + captured_local._delegate._write_task(info) + before = await captured_local.get(excluded.name) + captured_local.update_calls.clear() + if recovery_path == "startup": + await manager.startup() + started = True + elif recovery_path == "inline": + assert await manager.get_active_run(excluded.name) is None + assert await manager.get_active_run(eligible.name) is not None + await asyncio.wait_for(eligible_ran.wait(), timeout=5) + if recovery_path == "periodic": + + async def wait_for_another_scan(): + while len(captured_local.list_calls) < 3: + await asyncio.sleep(0.01) + + await asyncio.wait_for(wait_for_another_scan(), timeout=5) + after = await captured_local.get(excluded.name) + assert excluded_calls == [] + assert after.status == before.status == "in_progress" + assert after.etag == before.etag + assert after.lease.instance_id == before.lease.instance_id == "interrupted-instance" + assert after.lease.generation == before.lease.generation + assert after.payload == before.payload + assert not [call for call in captured_local.update_calls if call[0] == excluded.name] + finally: + if started: + await manager.shutdown() diff --git a/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_task_manager_not_initialized.py b/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_task_manager_not_initialized.py index b9ba5d8a8b8a..830f08ed054d 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_task_manager_not_initialized.py +++ b/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_task_manager_not_initialized.py @@ -13,7 +13,7 @@ import pytest -from azure.ai.agentserver.core.tasks import TaskManagerNotInitialized +from azure.ai.agentserver.core.tasks import TaskContext, TaskManagerNotInitialized from azure.ai.agentserver.core.tasks._manager import ( TaskManager, get_task_manager, @@ -68,3 +68,134 @@ def test_get_task_manager_returns_installed_manager(tmp_path) -> None: ) set_task_manager(mgr) assert get_task_manager() is mgr + + +def test_scoped_manager_masks_other_host_and_receives_late_registration(tmp_path) -> None: + from azure.ai.agentserver.core.tasks import task + from azure.ai.agentserver.core.tasks._manager import _task_manager_scope + + first = TaskManager(config=_config_stub(), provider=LocalFileTaskProvider(tmp_path / "first")) + second = TaskManager(config=_config_stub(), provider=LocalFileTaskProvider(tmp_path / "second")) + set_task_manager(second) + with _task_manager_scope(lambda: first): + assert get_task_manager() is first + + @task(name="scoped_late_registration") + async def late(ctx: TaskContext[dict]) -> dict: + return ctx.input + + assert first._resume_callbacks[late.name] is late._fn + assert late.name not in second._resume_callbacks + with _task_manager_scope(lambda: None): + with pytest.raises(TaskManagerNotInitialized): + get_task_manager() + assert get_task_manager() is first + assert get_task_manager() is second + + +@pytest.mark.parametrize("explicit_registration", [False, True]) +@pytest.mark.asyncio +async def test_startup_preserves_explicit_callbacks_over_imported_descriptors( + tmp_path, monkeypatch: pytest.MonkeyPatch, explicit_registration: bool +) -> None: + from azure.ai.agentserver.core.tasks import _decorator, task + + monkeypatch.setattr(_decorator, "_REGISTERED_DESCRIPTORS", []) + + @task(name="startup_callback_owner") + async def owned(ctx: TaskContext[str]) -> str: + return "owned" + + @task(name="startup_callback_owner") + async def later_import(ctx: TaskContext[str]) -> str: + return "later import" + + manager = TaskManager(config=_config_stub(), provider=LocalFileTaskProvider(tmp_path / "tasks")) + if explicit_registration: + manager.register_resume_callback(owned.name, owned._fn, owned._opts) + await manager.startup() + try: + expected = owned if explicit_registration else later_import + assert manager._resume_callbacks[expected.name] is expected._fn + assert manager._resume_opts[expected.name] is expected._opts + finally: + await manager.shutdown() + + +@pytest.mark.parametrize("explicit_registration", [False, True]) +@pytest.mark.asyncio +async def test_host_bound_callbacks_require_explicit_registration( + tmp_path, monkeypatch: pytest.MonkeyPatch, explicit_registration: bool +) -> None: + from azure.ai.agentserver.core.tasks import _decorator, task + from azure.ai.agentserver.core.tasks._models import TaskInfo + + monkeypatch.setattr(_decorator, "_REGISTERED_DESCRIPTORS", []) + monkeypatch.setattr(_decorator, "_HOST_BOUND_TASK_NAMES", set()) + with _decorator._host_bound_task_registration(): + + @task(name="host_bound") + async def owned(ctx: TaskContext[str]) -> str: + return ctx.input + + @task(name="ordinary_core") + async def ordinary(ctx: TaskContext[str]) -> str: + return ctx.input + + manager = TaskManager(config=_config_stub(), provider=LocalFileTaskProvider(tmp_path / "tasks")) + if explicit_registration: + manager.register_resume_callback(owned.name, owned._fn, owned._opts) + await manager.startup() + try: + assert manager._resume_callbacks[ordinary.name] is ordinary._fn + info = TaskInfo( + id="persisted", agent_name="a", session_id="s", status="in_progress", source={"name": owned.name} + ) + assert manager._recovery_is_authorized(owned.name) is explicit_registration + assert (manager._find_resume_callback(info) is owned._fn) is explicit_registration + assert (owned.name in manager._resume_callbacks) is explicit_registration + finally: + await manager.shutdown() + + +def test_late_host_bound_registration_does_not_publish_into_live_manager( + tmp_path, monkeypatch: pytest.MonkeyPatch +) -> None: + from azure.ai.agentserver.core.tasks import _decorator, task + from azure.ai.agentserver.core.tasks._models import TaskInfo + + monkeypatch.setattr(_decorator, "_HOST_BOUND_TASK_NAMES", set()) + manager = TaskManager(config=_config_stub(), provider=LocalFileTaskProvider(tmp_path / "tasks")) + set_task_manager(manager) + with _decorator._host_bound_task_registration(): + + @task(name="late_host_bound") + async def owned(ctx: TaskContext[str]) -> str: + return ctx.input + + assert owned.name not in manager._resume_callbacks + assert not manager._recovery_is_authorized(owned.name) + info = TaskInfo(id="persisted", agent_name="a", session_id="s", status="in_progress", source={"name": owned.name}) + assert manager._find_resume_callback(info) is None + + +@pytest.mark.parametrize("source", [None, {}, {"name": "identity_target"}, {"name": "unknown"}, {"name": None}]) +@pytest.mark.parametrize("matching_title", [False, True]) +def test_explicit_identity_never_uses_legacy_fallback(tmp_path, source, matching_title: bool) -> None: + from azure.ai.agentserver.core.tasks._models import TaskInfo + + async def target(ctx: TaskContext[str]) -> str: + return ctx.input + + manager = TaskManager(config=_config_stub(), provider=LocalFileTaskProvider(tmp_path / "tasks")) + manager.register_resume_callback("identity_target", target) + info = TaskInfo( + id="persisted", + agent_name="a", + session_id="s", + status="in_progress", + title="identity_target old" if matching_title else "unrelated", + source=source, + ) + expected = target if source in (None, {}, {"name": "identity_target"}) else None + assert manager._find_resume_callback(info) is expected diff --git a/sdk/agentserver/azure-ai-agentserver-core/tests/test_snapshot_lifecycle.py b/sdk/agentserver/azure-ai-agentserver-core/tests/test_snapshot_lifecycle.py index 16766a51097a..5c49eafe4dde 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/tests/test_snapshot_lifecycle.py +++ b/sdk/agentserver/azure-ai-agentserver-core/tests/test_snapshot_lifecycle.py @@ -451,6 +451,7 @@ async def test_after_restore_rehydrates_task_manager_session_state_and_rolls_bac monkeypatch.setenv("FOUNDRY_AGENT_SESSION_ID", "captured-session") agent = AgentServerHost() task_manager = TaskManager(config=agent.config, provider=mock.Mock()) + agent._task_manager = task_manager # pylint: disable=protected-access set_task_manager(task_manager) captured_instance_id = task_manager._instance_id # pylint: disable=protected-access restored_instance_ids: list[str] = [] @@ -464,9 +465,7 @@ async def after_restore(context: AgentSessionContext) -> None: "test-agent", context.session_id, ) - restored_instance_ids.append( - task_manager._instance_id # pylint: disable=protected-access - ) + restored_instance_ids.append(task_manager._instance_id) # pylint: disable=protected-access if callback_count == 1: raise RuntimeError("restore failed") @@ -539,9 +538,7 @@ async def after_restore(context: AgentSessionContext) -> None: transport=httpx.ASGITransport(app=agent), base_url="http://testserver", ) as lifecycle_client: - assert ( - await lifecycle_client.post("/_agent/before-snapshot", json={}) - ).status_code == 200 + assert (await lifecycle_client.post("/_agent/before-snapshot", json={})).status_code == 200 assert ( await lifecycle_client.post( "/_agent/after-restore", @@ -867,12 +864,8 @@ async def before_snapshot() -> None: transport=httpx.ASGITransport(app=agent), base_url="http://testserver", ) as lifecycle_client: - assert ( - await lifecycle_client.post("/_agent/before-snapshot", json={}) - ).status_code == 200 - assert ( - await lifecycle_client.post("/_agent/before-snapshot", json={}) - ).status_code == 200 + assert (await lifecycle_client.post("/_agent/before-snapshot", json={})).status_code == 200 + assert (await lifecycle_client.post("/_agent/before-snapshot", json={})).status_code == 200 assert callback_count == 1 assert ( @@ -881,9 +874,7 @@ async def before_snapshot() -> None: json=_after_restore_payload(), ) ).status_code == 200 - assert ( - await lifecycle_client.post("/_agent/before-snapshot", json={}) - ).status_code == 200 + assert (await lifecycle_client.post("/_agent/before-snapshot", json={})).status_code == 200 assert callback_count == 2 @@ -1044,9 +1035,7 @@ async def after_restore( transport=httpx.ASGITransport(app=agent), base_url="http://testserver", ) as lifecycle_client: - before_task = asyncio.create_task( - lifecycle_client.post("/_agent/before-snapshot", json={}) - ) + before_task = asyncio.create_task(lifecycle_client.post("/_agent/before-snapshot", json={})) await before_started.wait() after_task = asyncio.create_task( lifecycle_client.post( diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md b/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md index 4aa7e5931bcb..21391ec62d75 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md +++ b/sdk/agentserver/azure-ai-agentserver-invocations/CHANGELOG.md @@ -10,8 +10,19 @@ ### Bugs Fixed +- Apply the Invocations task-runtime switch to both typed Voice WebSocket + endpoints, including composed Voice/Responses hosts where Responses + independently enables the task manager. + ### Other Changes +- Raised the minimum `azure-ai-agentserver-core` dependency to `2.3.0b2` for + protocol-scoped task-runtime support. +- Invocations continues to opt into resilient tasks with + `set_resilient_tasks_enabled(True)` before host startup. Responses + protocol-scoped task-runtime activation does not change that global switch, + so enabling Responses does not implicitly activate Invocations. + ## 1.2.0 (2026-09-29) ### Other Changes diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation.py index d1d58ae697c0..87bbd4806822 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation.py @@ -35,6 +35,8 @@ PLATFORM_ERROR_TAG, USER_ID, ) +from azure.ai.agentserver.core._middleware import _task_runtime_middleware +from azure.ai.agentserver.core.tasks import resilient_tasks_enabled from ._constants import InvocationConstants from ._invocation_ws import _WSHandlerMixin @@ -88,6 +90,7 @@ def _classify_error(exc: BaseException) -> tuple[str, Optional[str]]: return _ERROR_SOURCE_PLATFORM, detail return _ERROR_SOURCE_UPSTREAM, None + # Maximum length and allowed characters for user-provided IDs (defense in depth). _MAX_ID_LENGTH = 256 _VALID_ID_RE = re.compile(r"^[a-zA-Z0-9\-_.:]+$") @@ -238,13 +241,9 @@ def __init__( # preserve backward-compat with existing callers passing dict-like # Mapping subclasses; consider unifying in a future release. if asyncapi_spec_json is not None and not isinstance(asyncapi_spec_json, dict): - raise TypeError( - f"asyncapi_spec_json must be dict, got {type(asyncapi_spec_json).__name__}" - ) + raise TypeError(f"asyncapi_spec_json must be dict, got {type(asyncapi_spec_json).__name__}") if asyncapi_spec_yaml is not None and not isinstance(asyncapi_spec_yaml, str): - raise TypeError( - f"asyncapi_spec_yaml must be str, got {type(asyncapi_spec_yaml).__name__}" - ) + raise TypeError(f"asyncapi_spec_yaml must be str, got {type(asyncapi_spec_yaml).__name__}") self._openapi_spec = openapi_spec self._asyncapi_spec_json = asyncapi_spec_json self._asyncapi_spec_yaml = asyncapi_spec_yaml @@ -253,6 +252,7 @@ def __init__( # interval lives on ``AgentConfig`` and is wired into Hypercorn # by ``AgentServerHost._build_hypercorn_config``). self._init_ws_state() + task_middleware = _task_runtime_middleware(self, kwargs, resilient_tasks_enabled) # Build invocation routes and pass to parent via routes kwarg invocation_routes: list[Any] = [ @@ -279,18 +279,21 @@ def __init__( self._create_invocation_endpoint, methods=["POST"], name="create_invocation", + middleware=task_middleware, ), Route( "/invocations/{invocation_id}", self._get_invocation_endpoint, methods=["GET"], name="get_invocation", + middleware=task_middleware, ), Route( "/invocations/{invocation_id}/cancel", self._cancel_invocation_endpoint, methods=["POST"], name="cancel_invocation", + middleware=task_middleware, ), ] @@ -311,9 +314,7 @@ def __init__( # Handler decorators # ------------------------------------------------------------------ - def invoke_handler( - self, fn: Callable[[Request], Awaitable[Response]] - ) -> Callable[[Request], Awaitable[Response]]: + def invoke_handler(self, fn: Callable[[Request], Awaitable[Response]]) -> Callable[[Request], Awaitable[Response]]: """Register a function as the invoke handler. Usage:: @@ -381,15 +382,14 @@ def cancel_invocation_handler( async def _dispatch_invoke(self, request: Request) -> Response: if self._invoke_fn is not None: return await self._invoke_fn(request) - raise NotImplementedError( - "No invoke handler registered. Use the @invocations.invoke_handler decorator." - ) + raise NotImplementedError("No invoke handler registered. Use the @invocations.invoke_handler decorator.") async def _dispatch_get_invocation(self, request: Request) -> Response: if self._get_invocation_fn is not None: return await self._get_invocation_fn(request) return create_error_response( - "not_found", "get_invocation not implemented", + "not_found", + "get_invocation not implemented", status_code=404, headers=_apply_error_source_headers({}, _ERROR_SOURCE_UPSTREAM), ) @@ -398,7 +398,8 @@ async def _dispatch_cancel_invocation(self, request: Request) -> Response: if self._cancel_invocation_fn is not None: return await self._cancel_invocation_fn(request) return create_error_response( - "not_found", "cancel_invocation not implemented", + "not_found", + "cancel_invocation not implemented", status_code=404, headers=_apply_error_source_headers({}, _ERROR_SOURCE_UPSTREAM), ) @@ -427,7 +428,8 @@ async def _get_openapi_spec_endpoint(self, request: Request) -> Response: # pyl spec = self.get_openapi_spec() if spec is None: return create_error_response( - "not_found", "No OpenAPI spec registered", + "not_found", + "No OpenAPI spec registered", status_code=404, headers=_apply_error_source_headers({}, _ERROR_SOURCE_UPSTREAM), ) @@ -437,7 +439,8 @@ async def _get_asyncapi_spec_json_endpoint(self, request: Request) -> Response: spec = self.get_asyncapi_spec_json() if spec is None: return create_error_response( - "not_found", "No AsyncAPI (JSON) spec registered", + "not_found", + "No AsyncAPI (JSON) spec registered", status_code=404, headers=_apply_error_source_headers({}, _ERROR_SOURCE_UPSTREAM), ) @@ -447,7 +450,8 @@ async def _get_asyncapi_spec_yaml_endpoint(self, request: Request) -> Response: spec = self.get_asyncapi_spec_yaml() if spec is None: return create_error_response( - "not_found", "No AsyncAPI (YAML) spec registered", + "not_found", + "No AsyncAPI (YAML) spec registered", status_code=404, headers=_apply_error_source_headers({}, _ERROR_SOURCE_UPSTREAM), ) @@ -480,16 +484,16 @@ async def _wrapped_body() -> AsyncIterator[Any]: # Re-establish the invocation context for the streaming task. stream_inv_token = _invocation_id_var.set(invocation_id) stream_session_token = _session_id_var.set(session_id) - stream_ctx_token = ( - set_request_context(platform_context) if platform_context is not None else None - ) + stream_ctx_token = set_request_context(platform_context) if platform_context is not None else None try: async for chunk in original_iterator: yield chunk except Exception as exc: # pylint: disable=broad-exception-caught logger.error( "Error processing invocation %s: %s", - invocation_id, exc, exc_info=True, + invocation_id, + exc, + exc_info=True, ) # Record the exception on the current span. span = trace.get_current_span() @@ -532,10 +536,14 @@ async def _create_invocation_endpoint(self, request: Request) -> Response: # Add protocol-specific baggage entries for this invocation. ctx = _otel_context.get_current() ctx = _otel_baggage.set_baggage( - "azure.ai.agentserver.invocation_id", invocation_id, context=ctx, + "azure.ai.agentserver.invocation_id", + invocation_id, + context=ctx, ) ctx = _otel_baggage.set_baggage( - "azure.ai.agentserver.session_id", session_id, context=ctx, + "azure.ai.agentserver.session_id", + session_id, + context=ctx, ) baggage_token = _otel_context.attach(ctx) @@ -596,9 +604,7 @@ async def _create_invocation_endpoint(self, request: Request) -> Response: # Wrap streaming response body so exceptions during iteration are # recorded on the current trace span and logged as invocation errors. if isinstance(response, StreamingResponse): - response = self._wrap_streaming_response( - response, invocation_id, session_id, platform_ctx - ) + response = self._wrap_streaming_response(response, invocation_id, session_id, platform_ctx) return response @@ -656,11 +662,7 @@ async def _traced_invocation_endpoint( reset_request_context(ctx_token) async def _get_invocation_endpoint(self, request: Request) -> Response: - return await self._traced_invocation_endpoint( - request, "get_invocation", self._dispatch_get_invocation - ) + return await self._traced_invocation_endpoint(request, "get_invocation", self._dispatch_get_invocation) async def _cancel_invocation_endpoint(self, request: Request) -> Response: - return await self._traced_invocation_endpoint( - request, "cancel_invocation", self._dispatch_cancel_invocation - ) + return await self._traced_invocation_endpoint(request, "cancel_invocation", self._dispatch_cancel_invocation) diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation_ws.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation_ws.py index 2eb7ce28053c..c27642800e86 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation_ws.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/_invocation_ws.py @@ -168,6 +168,12 @@ def _ensure_ws_route_registered(self) -> None: until ``@ws_handler`` is called is safe. """ from starlette.routing import WebSocketRoute # pylint: disable=import-outside-toplevel + from azure.ai.agentserver.core._middleware import ( # pylint: disable=import-outside-toplevel + _task_access_middleware, + ) + from azure.ai.agentserver.core.tasks import ( # pylint: disable=import-outside-toplevel + resilient_tasks_enabled, + ) for route in self.router.routes: if isinstance(route, WebSocketRoute) and getattr(route, "path", None) == InvocationsWSConstants.ROUTE_PATH: @@ -177,6 +183,7 @@ def _ensure_ws_route_registered(self) -> None: InvocationsWSConstants.ROUTE_PATH, self._ws_endpoint, name="invocations_ws", + middleware=_task_access_middleware(self, resilient_tasks_enabled), ) ) @@ -221,7 +228,9 @@ async def _ws_endpoint(self, websocket: WebSocket) -> None: ) logger.error( "WebSocket accept failed for session %s: %s", - session_id, exc, exc_info=True, + session_id, + exc, + exc_info=True, ) return @@ -258,7 +267,9 @@ async def _ws_endpoint(self, websocket: WebSocket) -> None: ) async def _invoke_user_handler( - self, websocket: WebSocket, session_id: str, + self, + websocket: WebSocket, + session_id: str, ) -> tuple[int, Optional[BaseException]]: """Run the registered user handler and classify the outcome. @@ -291,7 +302,9 @@ async def _invoke_user_handler( except Exception as exc: # pylint: disable=broad-exception-caught logger.error( "WebSocket handler raised for session %s: %s", - session_id, exc, exc_info=True, + session_id, + exc, + exc_info=True, ) return InvocationsWSConstants.CLOSE_INTERNAL_ERROR, exc @@ -326,21 +339,16 @@ async def _finalize_session( # application hasn't already done so (e.g. the user handler # may have called ``websocket.close`` itself, or the client # may have disconnected). - if ( - websocket is not None - and websocket.application_state != WebSocketState.DISCONNECTED - ): - reason = ( - "Internal server error" - if close_code == InvocationsWSConstants.CLOSE_INTERNAL_ERROR - else "" - ) + if websocket is not None and websocket.application_state != WebSocketState.DISCONNECTED: + reason = "Internal server error" if close_code == InvocationsWSConstants.CLOSE_INTERNAL_ERROR else "" try: await websocket.close(code=close_code, reason=reason) except Exception: # pylint: disable=broad-exception-caught # Connection already gone — nothing to recover here. logger.debug( - "Error closing WebSocket session %s", session_id, exc_info=True, + "Error closing WebSocket session %s", + session_id, + exc_info=True, ) self._emit_close_event( diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py index ef9b06a6bcf1..fc9a0e0b163d 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/azure/ai/agentserver/invocations/voice/_voice_host.py @@ -23,6 +23,7 @@ ) from opentelemetry.propagators.textmap import Getter from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from starlette.middleware import Middleware from starlette.routing import Host, Match, Mount, Router, WebSocketRoute from starlette.types import Receive, Scope, Send from starlette.websockets import WebSocket, WebSocketDisconnect, WebSocketState @@ -33,12 +34,14 @@ experimental, set_request_context, ) +from azure.ai.agentserver.core._middleware import _task_access_middleware from azure.ai.agentserver.core._platform_headers import ( # pylint: disable=import-error,no-name-in-module FOUNDRY_CALL_ID, REQUEST_ID, SERVER_VERSION, USER_ID, ) +from azure.ai.agentserver.core.tasks import resilient_tasks_enabled from .._constants import InvocationsWSConstants, _classify_websocket_close_code from .._invocation import InvocationAgentServerHost @@ -194,6 +197,8 @@ class _VoiceWebSocketRoute(WebSocketRoute): :paramtype path: str :keyword name: The typed Voice WebSocket route name. :paramtype name: str + :keyword middleware: Middleware applied to the Voice endpoint. + :paramtype middleware: list[~starlette.middleware.Middleware] | None """ def __init__( @@ -203,8 +208,9 @@ def __init__( router: Router, path: str = InvocationsWSConstants.ROUTE_PATH, name: str = "invocations_ws", + middleware: list[Middleware] | None = None, ) -> None: - super().__init__(path, endpoint, name=name) + super().__init__(path, endpoint, name=name, middleware=middleware) self._router = router def matches(self, scope: Scope) -> tuple[Match, Scope]: @@ -614,7 +620,11 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: def _ensure_ws_route_registered(self) -> None: voice_route = self._voice_route if voice_route is None: - voice_route = _VoiceWebSocketRoute(self._ws_endpoint, router=self.router) + voice_route = _VoiceWebSocketRoute( + self._ws_endpoint, + router=self.router, + middleware=_task_access_middleware(self, resilient_tasks_enabled), + ) self._voice_route = voice_route ce_route = self._conversation_engine_route if ce_route is None: @@ -623,6 +633,7 @@ def _ensure_ws_route_registered(self) -> None: router=self.router, path="/voice_conversation_engine", name="voice_conversation_engine", + middleware=_task_access_middleware(self, resilient_tasks_enabled), ) self._conversation_engine_route = ce_route routes = self.router.routes diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml b/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml index 047d7ffbc27a..a1720f6cb81d 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml +++ b/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ keywords = ["azure", "azure sdk", "agent", "agentserver", "invocations"] dependencies = [ - "azure-ai-agentserver-core>=2.1.0,<3.0.0", + "azure-ai-agentserver-core>=2.3.0b2,<3.0.0", "azure-core>=1.37.0,<2.0.0", "opentelemetry-api>=1.43.0,<2.0.0", # Constraint on the transitive aiohttp: the `--pre` CI install otherwise diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/tests/test_protocol_task_enablement.py b/sdk/agentserver/azure-ai-agentserver-invocations/tests/test_protocol_task_enablement.py new file mode 100644 index 000000000000..aa42c48a632a --- /dev/null +++ b/sdk/agentserver/azure-ai-agentserver-invocations/tests/test_protocol_task_enablement.py @@ -0,0 +1,328 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +"""Invocations enablement must remain independent of Responses features.""" + +from __future__ import annotations + +import asyncio +from datetime import datetime, timedelta, timezone + +import pytest +from starlette.responses import JSONResponse +from starlette.testclient import TestClient + +from azure.ai.agentserver.core.tasks import ( + TaskContext, + TaskManagerNotInitialized, + resilient_tasks_enabled, + set_resilient_tasks_enabled, + task, +) +from azure.ai.agentserver.core.tasks._manager import get_task_manager, set_task_manager +from azure.ai.agentserver.invocations import InvocationAgentServerHost + + +@pytest.fixture(autouse=True) +def isolated_tasks(monkeypatch: pytest.MonkeyPatch, tmp_path): + from azure.ai.agentserver.core.tasks import _manager + + previous_flag = resilient_tasks_enabled() + previous_manager = _manager._manager + monkeypatch.delenv("FOUNDRY_HOSTING_ENVIRONMENT", raising=False) + monkeypatch.setenv("AGENTSERVER_TASKS_BACKEND", "local") + monkeypatch.setenv("AGENTSERVER_STATE_ROOT", str(tmp_path)) + set_resilient_tasks_enabled(False) + set_task_manager(None) + try: + yield + finally: + set_resilient_tasks_enabled(previous_flag) + set_task_manager(previous_manager) + + +def manager_available() -> bool: + try: + get_task_manager() + return True + except TaskManagerNotInitialized: + return False + + +@pytest.mark.parametrize("path", ["/invocations_ws", "/voice_conversation_engine"]) +@pytest.mark.parametrize("responses_first", [False, True]) +@pytest.mark.parametrize("resilient,steerable", [(False, False), (False, True), (True, False), (True, True)]) +@pytest.mark.parametrize("enabled", [False, True]) +def test_composed_voice_routes_mask_disabled_invocations_tasks( + path: str, responses_first: bool, resilient: bool, steerable: bool, enabled: bool +) -> None: + responses = pytest.importorskip("azure.ai.agentserver.responses") + from azure.ai.agentserver.invocations.voice import SessionReady, VoiceAgentServerHost + + response_host = responses.ResponsesAgentServerHost + if responses_first: + + class CombinedHost(response_host, VoiceAgentServerHost): + pass + + else: + + class CombinedHost(VoiceAgentServerHost, response_host): + pass + + set_resilient_tasks_enabled(enabled) + host = CombinedHost( + options=responses.ResponsesServerOptions(resilient_background=resilient, steerable_conversations=steerable), + configure_observability=None, + ) + voice_seen = [] + responses_seen = [] + executed = [] + + @task(name="voice_protocol_probe") + async def probe(ctx: TaskContext[str]) -> str: + executed.append(ctx.input) + return ctx.input + + @host.on_session_start + async def start(session, event): + voice_seen.append(manager_available()) + if manager_available(): + run = await probe.start(task_id="voice-probe", input="ran") + assert await run.result() == "ran" + else: + with pytest.raises(TaskManagerNotInitialized): + await probe.start(task_id="voice-probe", input="must not run") + await session.send(SessionReady()) + + @host.response_handler + async def response_handler(request, context, cancellation_signal): + responses_seen.append(manager_available()) + events = responses.ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + yield events.emit_completed() + + with TestClient(host) as client: + with client.websocket_connect(path) as websocket: + websocket.send_json( + { + "type": "session.start", + "id": "m_start", + "ts": "2026-10-15T00:00:00Z", + "protocol_version": "1.0", + "reconnect": False, + "response_timeouts": {"first_output_ms": 1000, "idle_ms": 1000, "max_duration_ms": 3000}, + } + ) + assert websocket.receive_json()["type"] == "session.ready" + assert voice_seen == [enabled] + assert executed == (["ran"] if enabled else []) + response = client.post("/responses", json={"input": "hello", "store": False}) + assert response.status_code == 200, response.text + assert responses_seen == [resilient or steerable] + + +@pytest.mark.parametrize("enabled", [False, True]) +def test_invocations_switch_controls_http_and_websocket(enabled: bool) -> None: + set_resilient_tasks_enabled(enabled) + host = InvocationAgentServerHost(configure_observability=None) + + @host.invoke_handler + async def invoke(request): + return JSONResponse({"task_runtime": manager_available()}) + + @host.ws_handler + async def websocket_handler(websocket): + await websocket.send_json({"task_runtime": manager_available()}) + + with TestClient(host) as client: + assert client.post("/invocations", json={}).json() == {"task_runtime": enabled} + with client.websocket_connect("/invocations_ws") as websocket: + assert websocket.receive_json() == {"task_runtime": enabled} + + +@pytest.mark.parametrize("enabled", [False, True]) +@pytest.mark.parametrize("resilient,steerable", [(False, False), (False, True), (True, False), (True, True)]) +@pytest.mark.parametrize("responses_first", [False, True]) +def test_composed_protocols_use_independent_enablement( + enabled: bool, resilient: bool, steerable: bool, responses_first: bool +) -> None: + responses = pytest.importorskip("azure.ai.agentserver.responses") + response_host = responses.ResponsesAgentServerHost + if responses_first: + + class CombinedHost(response_host, InvocationAgentServerHost): + pass + + else: + + class CombinedHost(InvocationAgentServerHost, response_host): + pass + + set_resilient_tasks_enabled(enabled) + host = CombinedHost( + options=responses.ResponsesServerOptions(resilient_background=resilient, steerable_conversations=steerable), + configure_observability=None, + ) + assert resilient_tasks_enabled() is enabled + observed: list[bool] = [] + + @host.invoke_handler + async def invoke(request): + return JSONResponse({"task_runtime": manager_available()}) + + @host.response_handler + async def response_handler(request, context, cancellation_signal): + observed.append(context._task_context is not None) + assert manager_available() is (resilient or steerable) + events = responses.ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + yield events.emit_completed() + + with TestClient(host) as client: + assert (host._task_manager is not None) is (enabled or resilient or steerable) + assert client.post("/invocations", json={}).json() == {"task_runtime": enabled} + result = client.post("/responses", json={"input": "hello", "store": True}) + assert result.status_code == 200, result.text + assert observed == [resilient or steerable] + assert client.post("/invocations", json={}).json() == {"task_runtime": enabled} + + +@pytest.mark.parametrize("responses_first", [False, True]) +@pytest.mark.parametrize("resilient,steerable", [(False, False), (False, True), (True, False), (True, True)]) +@pytest.mark.parametrize("multi_turn", [False, True]) +@pytest.mark.parametrize("separate_hosts", [False, True]) +@pytest.mark.asyncio +async def test_protocol_recovery_requires_enabled_owning_host( + monkeypatch: pytest.MonkeyPatch, + tmp_path, + responses_first: bool, + resilient: bool, + steerable: bool, + multi_turn: bool, + separate_hosts: bool, +) -> None: + responses = pytest.importorskip("azure.ai.agentserver.responses") + from azure.ai.agentserver.core.tasks._lease import derive_lease_owner + from azure.ai.agentserver.core.tasks._local_provider import LocalFileTaskProvider + from azure.ai.agentserver.core.tasks._manager import TaskManager, _SCHEMA_VERSION, _SCHEMA_VERSION_KEY + from azure.ai.agentserver.core.tasks._models import TaskCreateRequest + from azure.ai.agentserver.responses import PlatformContext + from azure.ai.agentserver.responses.hosting._resilient_input import ResilientResponseInput + from azure.ai.agentserver.responses.hosting._task_id import derive_lifecycle_id + from azure.ai.agentserver.responses.models._generated import CreateResponse, ResponseObject + from azure.ai.agentserver.responses.store._file import FileResponseStore + + response_host = responses.ResponsesAgentServerHost + if responses_first: + + class CombinedHost(response_host, InvocationAgentServerHost): + pass + + else: + + class CombinedHost(InvocationAgentServerHost, response_host): + pass + + task_store = LocalFileTaskProvider(tmp_path / "tasks") + store = FileResponseStore(storage_dir=tmp_path / "responses") + monkeypatch.setattr(TaskManager, "_create_provider", staticmethod(lambda _: task_store)) + set_resilient_tasks_enabled(True) + host_type = response_host if separate_hosts else CombinedHost + host = host_type( + options=responses.ResponsesServerOptions(resilient_background=resilient, steerable_conversations=steerable), + store=store, + configure_observability=None, + ) + active_host = InvocationAgentServerHost(configure_observability=None) if separate_hosts else host + invocation_ran = asyncio.Event() + observed = [] + + @task(name="invocations_recovery_control") + async def invocation_work(ctx: TaskContext[str]) -> str: + assert ctx.entry_mode == "recovered" + assert get_task_manager() is active_host._task_manager + invocation_ran.set() + return "invocations still recover" + + @host.response_handler + async def handler(request, context, cancellation_signal): + observed.append((context.is_recovery, get_task_manager() is active_host._task_manager)) + events = responses.ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + yield events.emit_completed() + + response_id = "resp_disabled_protocol_recovery" + platform_context = PlatformContext(user_id_key="owner") + await store.create_response( + ResponseObject( + { + "id": response_id, + "object": "response", + "status": "in_progress", + "background": True, + "model": "m", + "output": [], + } + ), + [], + None, + context=platform_context, + ) + orchestrator = host._endpoint._orchestrator._resilient_orchestrator + primitive = orchestrator._multi_turn_task_fn if multi_turn else orchestrator._one_shot_task_fn + params = ResilientResponseInput( + request=CreateResponse(model="m", input="old work", store=True, background=True, stream=False), + response_id=response_id, + disposition="re-invoke", + user_id_key="owner", + ).to_task_input() + response_task_id = derive_lifecycle_id(response_id, "owner") + for name, task_id, task_input in ( + (primitive.name, response_task_id, params), + (invocation_work.name, "invocations-recovery-control", "continue"), + ): + payload = {"input": task_input, _SCHEMA_VERSION_KEY: _SCHEMA_VERSION} + if multi_turn and name == primitive.name: + payload["last_input_id"] = derive_lifecycle_id(response_id, "owner") + info = await task_store.create( + TaskCreateRequest( + id=task_id, + agent_name=host.config.agent_name or "default", + session_id=host.config.session_id or "local", + status="in_progress", + title=name, + payload=payload, + tags={"task_name": name}, + source=TaskManager._build_source(name), + lease_owner=derive_lease_owner( + host.config.agent_name or "unknown-agent", host.config.session_id or "local" + ), + lease_instance_id="interrupted-instance", + lease_duration_seconds=60, + ) + ) + info.lease.expires_at = (datetime.now(timezone.utc) - timedelta(minutes=10)).isoformat() + task_store._write_task(info) + before = await task_store.get(response_task_id) + async with active_host.router.lifespan_context(active_host): + await asyncio.wait_for(invocation_ran.wait(), timeout=5) + if (resilient or steerable) and not separate_hosts: + + async def wait_for_terminal(): + while (await store.get_response(response_id, context=platform_context))["status"] == "in_progress": + await asyncio.sleep(0.01) + + await asyncio.wait_for(wait_for_terminal(), timeout=5) + assert observed == [(True, True)] + assert (await store.get_response(response_id, context=platform_context))["status"] == "completed" + else: + assert observed == [] + if separate_hosts: + assert host._task_manager is None + after = await task_store.get(response_task_id) + assert after.status == before.status == "in_progress" + assert after.etag == before.etag + assert after.lease.instance_id == before.lease.instance_id == "interrupted-instance" + assert after.lease.generation == before.lease.generation + assert after.payload == before.payload + assert (await store.get_response(response_id, context=platform_context))["status"] == "in_progress" diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/tests/test_recovery_restart_identity.py b/sdk/agentserver/azure-ai-agentserver-invocations/tests/test_recovery_restart_identity.py new file mode 100644 index 000000000000..8d61555cfeaf --- /dev/null +++ b/sdk/agentserver/azure-ai-agentserver-invocations/tests/test_recovery_restart_identity.py @@ -0,0 +1,117 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +"""Persisted function identity must survive a fresh Invocations-only process.""" + +from __future__ import annotations + +import json +import os +from pathlib import Path +import subprocess +import sys +import textwrap + +import pytest + + +_RESTART_PROBE = textwrap.dedent( + """ + import asyncio + from datetime import datetime, timedelta, timezone + import json + import os + from pathlib import Path + from unittest.mock import patch + + from azure.ai.agentserver.core.tasks import TaskContext, set_resilient_tasks_enabled, task + from azure.ai.agentserver.core.tasks._decorator import _HOST_BOUND_TASK_NAMES, _REGISTERED_DESCRIPTORS + from azure.ai.agentserver.core.tasks._lease import derive_lease_owner + from azure.ai.agentserver.core.tasks._local_provider import LocalFileTaskProvider + from azure.ai.agentserver.core.tasks._manager import TaskManager, _SCHEMA_VERSION, _SCHEMA_VERSION_KEY + from azure.ai.agentserver.core.tasks._models import TaskCreateRequest + from azure.ai.agentserver.invocations import InvocationAgentServerHost + + assert not _HOST_BOUND_TASK_NAMES + assert not _REGISTERED_DESCRIPTORS + seen = [] + + @task(name="ordinary_invocations_work") + async def work(ctx: TaskContext[dict]) -> None: + seen.append(ctx.task_id) + + async def main(): + store = LocalFileTaskProvider(Path(os.environ["AGENTSERVER_STATE_ROOT"]) / "tasks") + set_resilient_tasks_enabled(True) + with patch.object(TaskManager, "_create_provider", staticmethod(lambda _: store)): + host = InvocationAgentServerHost(configure_observability=None) + for task_id, name in ( + ("known", work.name), + ("responses", "responses_resilient_one_shot"), + ("legacy", None), + ): + payload = {"input": {"original_task": task_id}, _SCHEMA_VERSION_KEY: _SCHEMA_VERSION} + if task_id == "responses" and os.environ["PROBE_PRE_SCHEMA"] == "true": + payload.pop(_SCHEMA_VERSION_KEY) + source = TaskManager._build_source(name) if name else {"type": "agentserver.task"} + info = await store.create( + TaskCreateRequest( + id=task_id, + agent_name=host.config.agent_name or "default", + session_id=host.config.session_id or "local", + status="in_progress", + title="unrelated title", + payload=payload, + source=source, + lease_owner=derive_lease_owner( + host.config.agent_name or "unknown-agent", host.config.session_id or "local" + ), + lease_instance_id="interrupted-instance", + lease_duration_seconds=60, + ) + ) + info.lease.expires_at = (datetime.now(timezone.utc) - timedelta(minutes=10)).isoformat() + store._write_task(info) + before = await store.get("responses") + async with host.router.lifespan_context(host): + executions = [ + active.execution_task + for active in host._task_manager._active_tasks.values() + if active.execution_task is not None + ] + await asyncio.wait_for(asyncio.gather(*executions), timeout=5) + after = await store.get("responses") + print(json.dumps({"seen": seen, "responses_record_exists": after is not None})) + assert set(seen) == {"known", "legacy"}, seen + assert after is not None + assert after.status == before.status == "in_progress" + assert after.etag == before.etag + assert after.lease.instance_id == before.lease.instance_id == "interrupted-instance" + assert after.lease.generation == before.lease.generation + assert after.payload == before.payload + + asyncio.run(main()) + """ +) + + +@pytest.mark.parametrize("pre_schema", [False, True]) +def test_restart_preserves_unregistered_responses_identity(tmp_path: Path, pre_schema: bool) -> None: + env = {key: value for key, value in os.environ.items() if not key.startswith("FOUNDRY_")} + env.update( + AGENTSERVER_TASKS_BACKEND="local", + AGENTSERVER_STATE_ROOT=str(tmp_path), + PROBE_PRE_SCHEMA=str(pre_schema).lower(), + ) + result = subprocess.run( + [sys.executable, "-c", _RESTART_PROBE], + cwd=Path(__file__).resolve().parents[1], + env=env, + capture_output=True, + text=True, + timeout=20, + check=False, + ) + assert result.returncode == 0, f"{result.stdout}\n{result.stderr}" + evidence = json.loads(result.stdout.splitlines()[-1]) + assert set(evidence["seen"]) == {"known", "legacy"} + assert evidence["responses_record_exists"] diff --git a/sdk/agentserver/azure-ai-agentserver-responses/CHANGELOG.md b/sdk/agentserver/azure-ai-agentserver-responses/CHANGELOG.md index 4565a5c901d0..ab4e746d2777 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/CHANGELOG.md +++ b/sdk/agentserver/azure-ai-agentserver-responses/CHANGELOG.md @@ -1,5 +1,37 @@ # Release History +## 2.4.0b2 (Unreleased) + +### Features Added + +- Responses hosts now request the task runtime when either + `resilient_background` or `steerable_conversations` is enabled. Steering-only + hosts receive persistent queue/cancel behavior; after a crash the interrupted + response is marked failed without re-running its handler, while persisted + queued turns may continue as new steered turns. + +### Bugs Fixed + +- Bind recovery callbacks and task options to their owning Responses host so + constructing another host cannot redirect recovered work to its handler or + response provider. +- Do not recover Responses tasks when both Responses features are disabled, + including when Invocations enables a shared task manager. +- Keep eager Responses task registration host-bound so a separate + Invocations-only host cannot recover another host's Responses work. + +### Breaking Changes + +- Responses task-runtime activation is now protocol-scoped. The Core + `set_resilient_tasks_enabled` switch no longer force-enables Responses when + both Responses options are disabled, and Responses activation does not + activate another protocol in a mixed host. + +### Other Changes + +- Raised the minimum `azure-ai-agentserver-core` dependency to `2.3.0b2` for + protocol-scoped task-runtime support. + ## 2.4.0b1 (2026-10-15) ### Bugs Fixed diff --git a/sdk/agentserver/azure-ai-agentserver-responses/README.md b/sdk/agentserver/azure-ai-agentserver-responses/README.md index 875f0d565969..0f5829ad0f08 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/README.md +++ b/sdk/agentserver/azure-ai-agentserver-responses/README.md @@ -191,7 +191,32 @@ For detailed handler implementation guidance, see [docs/handler-implementation-g ### Resilience -Crash recovery is **opt-in** via `ResponsesServerOptions(resilient_background=True)`. When opted in, background responses with `store=True` are crash-recoverable: the handler is re-invoked on restart and the recovered context exposes `context.is_recovery == True`. Stream events are persisted incrementally so clients can reconnect and resume from where they left off. Without the opt-in (the default), a crash mid-handler marks the response `failed` instead of re-invoking the handler. For advanced scenarios (metadata checkpointing, multi-turn steering), see the [Resilient Responses Developer Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/agentserver/azure-ai-agentserver-responses/docs/resilient-responses-developer-guide.md). +Responses requests its task runtime at host startup when either +`ResponsesServerOptions(resilient_background=True)` or +`steerable_conversations=True`. This activation is protocol-scoped: Responses +does not read or change Core's process-wide `set_resilient_tasks_enabled` +switch. That switch remains the opt-in for direct Core tasks and Invocations, +and cannot force-enable Responses when both Responses options are `False`. + +With both options at their default `False`, stored responses run non-durably; +there is no Responses recovery-time mark-failed or handler re-invocation. +`steerable_conversations=True` alone enables the persistent steering +queue/cancel backend: after a crash, the interrupted response is marked +`failed` with `code=server_error` and its handler is not re-run, while persisted +queued turns may be promoted as new steered turns. With +`resilient_background=True`, stored background handlers are re-invoked after a +crash; steering remains disabled unless its option is also enabled. Foreground +stored responses are never re-invoked. + +File-backed SSE replay, resilient-provider startup validation, response +checkpoints, and shutdown preservation remain tied to +`resilient_background=True` (with `store=true, background=true` where +applicable); steering alone uses in-memory SSE replay. Request validation and +connection behavior are unchanged: `background=true, store=false` is rejected, +foreground disconnects cancel foreground work, and accepted background work +survives client disconnect. For the complete request matrix and advanced +recovery guidance, see +the [Resilient Responses Developer Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/agentserver/azure-ai-agentserver-responses/docs/resilient-responses-developer-guide.md). ## Examples diff --git a/sdk/agentserver/azure-ai-agentserver-responses/api.metadata.yml b/sdk/agentserver/azure-ai-agentserver-responses/api.metadata.yml index fc8c0cdebf32..20436425af03 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/api.metadata.yml +++ b/sdk/agentserver/azure-ai-agentserver-responses/api.metadata.yml @@ -1,4 +1,4 @@ apiMdSha256: 60b58bad23b78dc734ab88b4a97f8b9502a69c3c3751c7b48c019c731513ca4f -packageVersion: 2.4.0b1 +packageVersion: 2.4.0b2 parserVersion: 0.3.31 pythonVersion: 3.11.16 diff --git a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/_version.py b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/_version.py index 31132b6e543c..04bc7019645f 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/_version.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/_version.py @@ -4,4 +4,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -VERSION = "2.4.0b1" +VERSION = "2.4.0b2" diff --git a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_orchestrator.py b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_orchestrator.py index e4212591b9ad..7f9467d5e92a 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_orchestrator.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_orchestrator.py @@ -4386,6 +4386,10 @@ async def _start_resilient_background( (``TaskManagerNotInitialized``) is NOT raised — it is swallowed and handled via the in-process fallback (see above). """ + if not (self._runtime_options.resilient_background or self._runtime_options.steerable_conversations): + record.execution_task = asyncio.create_task(fallback_runner()) + return + from ._resilient_orchestrator import ( ResilientResponseOrchestrator, ) # pylint: disable=import-outside-toplevel @@ -4445,8 +4449,8 @@ async def _start_resilient_background( # failure. logger.info( "Resilient task subsystem not enabled for response %s; running handler " - "in-process (non-durable). Enable via set_resilient_tasks_enabled(True) " - "(or resilient_background) for crash recovery.", + "in-process (non-durable). Run the host lifespan to initialize " + "the requested Responses task runtime.", ctx.response_id, ) record.execution_task = asyncio.create_task(fallback_runner()) diff --git a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_resilient_orchestrator.py b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_resilient_orchestrator.py index 4789da2fa583..f2c8b6780618 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_resilient_orchestrator.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_resilient_orchestrator.py @@ -33,6 +33,7 @@ task, ) from azure.ai.agentserver.core.streaming import EventStreamClosedError, EventStreamNotFoundError, streams +from azure.ai.agentserver.core.tasks._decorator import _host_bound_task_registration from .._options import ResponsesServerOptions from .._response_context import ResponseExitForRecovery @@ -44,6 +45,8 @@ from ..streaming._internals import materialize_wire_payload if TYPE_CHECKING: + from azure.ai.agentserver.core.tasks._manager import TaskManager + from .._response_context import PlatformContext, ResponseContext from ..models.runtime import ResponseExecution @@ -448,32 +451,8 @@ def __init__( # function and does not need this reference. self._parent_orchestrator = parent_orchestrator - # Opting into resilient background responses implies the durable task - # subsystem must be constructed (and recovery enabled) for this - # deployment. The subsystem is gated SOLELY on the process-global switch - # (``AgentServerHost`` constructs the ``TaskManager`` only when it is - # set), so translate the explicit ``resilient_background`` opt-in into - # that switch here, at host construction time (before the ASGI lifespan - # runs). - # - # NOTE: only ``resilient_background`` auto-enables the subsystem — - # ``steerable_conversations`` intentionally does NOT. Recovery is tied to - # ``resilient_background`` alone; a steerable host that wants durability - # must set ``resilient_background=True`` (or call - # ``set_resilient_tasks_enabled(True)`` explicitly). The two-switch UX is - # a known rough edge to smooth over post-Public-Preview. - # - # A host that leaves ``resilient_background`` off (and does not set the - # switch) constructs no ``TaskManager``: ``store=true`` work degrades to - # non-durable in-process execution (``_start_resilient_background`` - # swallows ``TaskManagerNotInitialized``). - if options.resilient_background: - from azure.ai.agentserver.core.tasks import ( # pylint: disable=import-outside-toplevel - set_resilient_tasks_enabled, - ) - - set_resilient_tasks_enabled(True) - + # The host owns runtime activation. Register callbacks before startup + # recovery without changing the independent Invocations enablement switch. # Spec 023 — per-request primitive dispatch (SOT §6.6). # Two task primitives are registered per deployment; ``_pick_primitive`` # selects per request based on (conversation_id, previous_response_id, @@ -483,10 +462,26 @@ def __init__( # at __init__ time. If the core wheel does not expose both ``@task`` # and ``@multi_turn_task`` symbols, the failure surfaces at server # startup instead of per-request. - one_shot, multi_turn = self._create_task_fns() + # Construction must not publish this host's callbacks into another live host. + with _host_bound_task_registration(): + one_shot, multi_turn = self._create_task_fns() self._one_shot_task_fn: Task[dict[str, Any], None] = one_shot self._multi_turn_task_fn: MultiTurnTask[dict[str, Any], None] = multi_turn + def _register_task_callbacks(self, manager: "TaskManager") -> None: + """Register this orchestrator's callbacks and options on its own manager. + + :param manager: The owning host's task manager. + :type manager: ~azure.ai.agentserver.core.tasks._manager.TaskManager + """ + # pylint: disable=protected-access + primitives = (self._one_shot_task_fn, self._multi_turn_task_fn) + if not (self._options.resilient_background or self._options.steerable_conversations): + manager._disable_recovery_for(*(primitive.name for primitive in primitives)) + return + for primitive in primitives: + manager.register_resume_callback(primitive.name, primitive._fn, primitive._opts) + @property def task_fn(self) -> Task[dict[str, Any], None]: """Deprecated single-task accessor — use ``_one_shot_task_fn`` / diff --git a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_routing.py b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_routing.py index 988f42adafe1..cf811e3d2abf 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_routing.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_routing.py @@ -12,7 +12,7 @@ import logging import types from collections.abc import AsyncIterable, Awaitable -from typing import Any, AsyncIterator, Callable, Optional, Union +from typing import TYPE_CHECKING, Any, AsyncIterator, Callable, Optional, Union from starlette.routing import Route @@ -20,6 +20,7 @@ AgentServerHost, build_server_version, ) +from azure.ai.agentserver.core._middleware import _task_runtime_middleware from .._options import ResponsesServerOptions from .._response_context import ResponseContext @@ -33,6 +34,9 @@ from ._orchestrator import _ResponseOrchestrator, _close_iterator from ._runtime_state import _RuntimeState +if TYPE_CHECKING: + from azure.ai.agentserver.core.tasks._manager import TaskManager + CreateHandlerEvent = Union["_generated_models.ResponseStreamEvent", ResponseCheckpointEvent, dict[str, Any]] CreateHandlerFn = Callable[ @@ -202,11 +206,7 @@ def _log_startup_configuration( runtime_options.shutdown_grace_period_seconds, ) - from azure.ai.agentserver.core.tasks import ( # pylint: disable=import-outside-toplevel - resilient_tasks_enabled, - ) - - if resilient_tasks_enabled(): + if runtime_options.resilient_background or runtime_options.steerable_conversations: logger.info( "Responses resilience: ENABLED - store=true responses run inside durable " "tasks with crash recovery (in-flight responses are recovered/marked failed " @@ -217,7 +217,7 @@ def _log_startup_configuration( "Responses resilience: DISABLED - store=true responses run in-process and are " "NOT durable across an ungraceful crash: a response in-flight when the process " "is hard-killed stays in_progress on a later GET (no mark-failed/recovery). " - "Enable durability via resilient_background, or set_resilient_tasks_enabled(True)." + "Enable the Responses task runtime with resilient_background or steerable_conversations." ) @@ -337,6 +337,9 @@ def __init__( # Build internal components runtime_options = options or ResponsesServerOptions() + task_middleware = _task_runtime_middleware( + self, kwargs, lambda: bool(runtime_options.resilient_background or runtime_options.steerable_conversations) + ) # Server version string — the responses segment is built once and # registered on the host. The full x-platform-server value is @@ -475,30 +478,35 @@ def __init__( endpoint.handle_create, methods=["POST"], name="create_response", + middleware=task_middleware, ), Route( f"{normalized_prefix}/responses/{{response_id}}", endpoint.handle_get, methods=["GET"], name="get_response", + middleware=task_middleware, ), Route( f"{normalized_prefix}/responses/{{response_id}}", endpoint.handle_delete, methods=["DELETE"], name="delete_response", + middleware=task_middleware, ), Route( f"{normalized_prefix}/responses/{{response_id}}/cancel", endpoint.handle_cancel, methods=["POST"], name="cancel_response", + middleware=task_middleware, ), Route( f"{normalized_prefix}/responses/{{response_id}}/input_items", endpoint.handle_input_items, methods=["GET"], name="get_input_items", + middleware=task_middleware, ), ] @@ -535,6 +543,16 @@ def __init__( # --- Responses startup configuration + durability-mode logging --- _log_startup_configuration(resolved_provider, runtime_options) + def _register_task_callbacks(self, manager: "TaskManager") -> None: + """Bind this host's Responses callbacks before recovery starts. + + :param manager: The owning host's task manager. + :type manager: ~azure.ai.agentserver.core.tasks._manager.TaskManager + """ + # pylint: disable=protected-access + super()._register_task_callbacks(manager) + self._endpoint._orchestrator._resilient_orchestrator._register_task_callbacks(manager) + # ------------------------------------------------------------------ # Shutdown notification # ------------------------------------------------------------------ diff --git a/sdk/agentserver/azure-ai-agentserver-responses/docs/resilience-contract.md b/sdk/agentserver/azure-ai-agentserver-responses/docs/resilience-contract.md index ea7f2de9f901..43cef228bb0d 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/docs/resilience-contract.md +++ b/sdk/agentserver/azure-ai-agentserver-responses/docs/resilience-contract.md @@ -63,12 +63,30 @@ Three boolean flags on the request select the resilience shape: delivered as SSE events on the original connection. Independent of the resilience shape; see the **Streaming sub-contract**. -### Server option +### Server options - **`resilient_background`** *(server option, default `False`)* — whether the framework engages full crash-recovery for `background=true, store=true` requests. When `True`, the supporting providers MUST be present (see **Composition rules**); the server fails loud at startup otherwise. +- **`steerable_conversations`** *(server option, default `False`)* — whether + stored conversation turns use the persistent queue/cancel steering runtime. + +The Responses host MUST request protocol-scoped `TaskManager` access when +either option is `True`. It MUST NOT read or mutate Core's process-wide +`set_resilient_tasks_enabled` switch: that switch remains the opt-in for direct +Core tasks and Invocations, and MUST NOT force Responses onto its task runtime +when both Responses options are `False`. Access is scoped so enabling one +protocol does not activate another protocol in the same process. + +The four option combinations are: + +- both `False`: no Responses task runtime; stored work executes non-durably; +- resilience only: crash-reinvoke stored background handlers, without steering; +- steering only: persistent queue/cancel; crash-fail the interrupted response + without re-running its handler, while persisted queued inputs MAY promote as + new steered turns after recovery; +- both `True`: full crash recovery plus steering. ### Termination paths @@ -84,19 +102,20 @@ per path. contract, and respond to waiting clients in this lifetime. - **Path C — crash, or a graceful shutdown whose Path-B action did not run** (SIGKILL, OOM, power loss, a hang during the shutdown loop). On the next - process lifetime the framework scans persisted state and applies the row's - restart contract. Path C is the complete fallback for Path B. + process lifetime an enabled task runtime scans persisted state and applies + the row's restart contract. Without a task runtime there is no Path-C cleanup. A single termination event is handled by exactly one path. ### Resilient record -Every accepted `store=true` request is registered with the underlying -resilient-task primitive at acceptance time. The registration carries the -response id, the row's Path-C disposition (`re-invoke` for Row 1, -`mark-failed` for Rows 2 and 3), and (for re-invocation rows) the handler -reference. `store=false` requests have no resilient record; Path C does not -apply. +When the Responses task runtime is active, every accepted `store=true` request +is registered with the underlying task primitive at acceptance time. The +registration carries the response id, the row's Path-C disposition +(`re-invoke` for Row 1, `mark-failed` for Rows 2 and 3), and (for +re-invocation rows) the handler reference. When both server options are +`False`, no such record is created and stored work runs non-durably. +`store=false` requests never have a task record; Path C does not apply. ### Recovered entry @@ -150,7 +169,14 @@ per-row contract. | 11 | `true` | `true` | `True` | all phases checkpoint + complete; final `response.output` reflects every phase | handler at a checkpoint boundary calls `await context.exit_for_recovery()`; recovery resumes from the last checkpointed snapshot | SIGKILL at a checkpoint boundary; recovery resumes from the last checkpointed snapshot | Read every cell as a MUST for the framework. Path A is identical across Rows -1–4 because no framework intervention is needed. +1–4 because no framework intervention is needed. Rows 2 and 3 Path C cells +apply only when the Responses task runtime is active: Row 2 therefore requires +`steerable_conversations=True`, while Row 3 requires either +`resilient_background=True` or `steerable_conversations=True`. If both server +options are `False`, ordinary stored work is non-durable and has no Path-C +action. Path B still best-effort persists the failed response during graceful +shutdown even without a task runtime. The request matrix and its +`resilient_background` column remain otherwise unchanged. --- @@ -184,7 +210,10 @@ with `context.is_recovery == True`. ### Row 2 — Marked failed (`store=true, background=true, resilient_background=False`) -A stored, observable response without crash recovery. +A stored, observable response without handler crash recovery. This row's +manager-backed Path B/C contract applies when +`steerable_conversations=True`. With both server options `False`, the response +runs non-durably and there is no next-lifetime action. **Path A.** Handler completes within grace. Standard. @@ -206,8 +235,10 @@ from the persisted task input. A stored response observable over the original (foreground) HTTP connection. `resilient_background` is a free axis — foreground responses do not benefit from resilient handler recovery because the client connection is gone. Path A/B/C -have the same shape as Row 2; all failure markers use `code=server_error` with -the path-specific cause in `message`. +have the same shape as Row 2 when either server option has requested the task +runtime; all failure markers use `code=server_error` with the path-specific +cause in `message`. When both options are `False`, the response is non-durable +and no restart action runs. ### Row 4 — Best-effort (`store=false`, any `background`, any `resilient_background`) @@ -334,6 +365,13 @@ absent; it MUST NOT silently downgrade to a weaker row. | `store=true` requests accepted (any row) | `ResponseStore` | Startup error | | `stream=true` requests accepted (any row) | A streaming-capable transport configuration | Startup error | +`steerable_conversations=True` alone requests the normal persistent task +backend for queue/cancel behavior, but MUST NOT broaden the +`resilient_background=True` provider guard or select file-backed SSE replay. +SSE replay remains file-backed only for `resilient_background=True` and +in-memory otherwise. Likewise, checkpoint writes and shutdown preservation +remain gated by `resilient_background && store && background`. + The same "fail loud, never silently downgrade" rule applies at **request time**. When `resilient_background` is in effect and the resilient task cannot be started, the framework MUST fail the request rather than silently running diff --git a/sdk/agentserver/azure-ai-agentserver-responses/docs/resilient-responses-developer-guide.md b/sdk/agentserver/azure-ai-agentserver-responses/docs/resilient-responses-developer-guide.md index e2b4b01b2793..f12bf300a528 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/docs/resilient-responses-developer-guide.md +++ b/sdk/agentserver/azure-ai-agentserver-responses/docs/resilient-responses-developer-guide.md @@ -22,12 +22,15 @@ The *handler* half — making the recovered attempt resume *where it left off* and not repeat non-idempotent side effects — is optional work you take on when you want it; see [Choosing a resume strategy](#choosing-a-resume-strategy). -> **Default**: `resilient_background` defaults to `False`. Without the -> opt-in, a crash mid-handler leaves the response in the -> "crash-failed" state: the next-lifetime recovery scanner marks it -> `failed` (`error.code="server_error"`) instead -> of re-invoking the handler. Set `resilient_background=True` on -> `ResponsesServerOptions` to engage the re-invoke recovery path. +> **Defaults and activation:** both `resilient_background` and +> `steerable_conversations` default to `False`. Responses requests its +> protocol-scoped task runtime when either option is `True`; it does not read or +> mutate Core's process-wide `set_resilient_tasks_enabled` switch. With both +> options `False`, stored work runs non-durably and there is no next-lifetime +> mark-failed or handler re-invocation. With steering alone, the interrupted +> response is marked `failed` (`error.code="server_error"`) without re-running +> its handler, while persisted queued inputs may be promoted and started as new +> steered turns after recovery. ## What the Framework Provides (Zero Code) @@ -36,7 +39,7 @@ you want it; see [Choosing a resume strategy](#choosing-a-resume-strategy). | Crash recovery | Handler re-invoked on server restart (requires `resilient_background=True`) | | Stream replay | Events persisted incrementally; clients reconnect seamlessly | | Conversation lock | Prevents conflicting concurrent writes | -| Non-bg cleanup | Foreground responses marked `failed` on crash (no ghost re-invocation) | +| Non-bg cleanup | With the Responses task runtime active, foreground responses are marked `failed` on crash (no ghost re-invocation) | | TTL-based cleanup | Stream events auto-expire after 10 minutes (framework-internal) | ## Decision Tree @@ -130,36 +133,54 @@ mechanics. | Option | Default | Description | |--------|---------|-------------| -| `resilient_background` | `False` | Opt INTO crash-recoverable background responses | -| `steerable_conversations` | `False` | Enable multi-turn steering with cooperative cancel | +| `resilient_background` | `False` | Opt INTO crash-recoverable background responses and request the Responses task runtime | +| `steerable_conversations` | `False` | Request the Responses task runtime and enable persistent multi-turn queue/cancel steering | + +Responses activation is scoped to this protocol. Direct Core task APIs and the +Invocations protocol continue to use +`set_resilient_tasks_enabled(True)` before host startup. Conversely, that +process-wide setter cannot activate Responses when both options above are +`False`, so one protocol cannot accidentally enable a disabled protocol in a +mixed host. ## Configuration Matrix -Recovery semantics depend on three request flags and one server option. The -table below is a quick orientation. For the **normative** specification — the -exact behaviour you can rely on per row, per termination path, and per -stream/poll mode — see +Recovery semantics depend on three request flags and two server options. The +table keeps the existing `resilient_background` row axis; the text below it +states when `steerable_conversations` supplies the manager required for Rows 2 +and 3. For the **normative** specification — the exact behaviour you can rely +on per row, per termination path, and per stream/poll mode — see [`responses-resilience-spec.md`](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/agentserver/azure-ai-agentserver-responses/docs/responses-resilience-spec.md). That document is the source of truth; this section summarises it for developer ergonomics. | `store` | `background` | `resilient_background` | Summary | |---|---|---|---| | `true` | `true` | `True` | **Full recovery.** Handler is re-invoked with `context.is_recovery == True`. Persisted events replay to reconnecting clients. See [Crash Recovery](#crash-recovery). | -| `true` | `true` | `False` (default) | **Failed marker.** Response is marked `failed` on restart. Handler is NOT re-invoked. Pre-crash persisted events remain replayable until TTL expires. | -| `true` | `false` (foreground) | any | **Failed marker.** Response is marked `failed` with `code=server_error`. Handler is NOT re-invoked (the client's HTTP connection is already dead). Persisted events remain queryable. | +| `true` | `true` | `False` (default) | **Manager-dependent.** With `steerable_conversations=True`, the interrupted response is marked `failed` on restart and its handler is NOT re-invoked; persisted queued turns may still start as new steered turns. With both server options `False`, execution is non-durable and no restart action runs. | +| `true` | `false` (foreground) | any | **Never re-invoked.** When either server option requests the task runtime, the response is marked `failed` with `code=server_error`; with both options `False`, execution is non-durable and no restart action runs. Persisted response data remains queryable. | | `false` | any | any | **Best-effort failed marker** during shutdown grace period only. No persistence. Recovery does not apply. | -Each row × termination-path cell — Path A (handler completes within grace), -Path B (grace exhausted, in-process marker fires), Path C (crash or Path-B -failure, next-lifetime recovery fires) — is covered by a dedicated -conformance test in `tests/e2e/resilience_contract/`. If something behaves +Each manager-backed row × termination-path cell — Path A (handler completes +within grace), Path B (grace exhausted, in-process marker fires), Path C (crash +or Path-B failure, next-lifetime recovery fires) — is covered by the +conformance suite in `tests/e2e/resilience_contract/`. If something behaves differently from what the spec says, that's a bug in either the implementation or the spec — open an issue. `steerable_conversations=True` composes orthogonally: it enables multi-turn -steering on top of any row above. Recovery composes with steering — see the +steering on top of any row above and requests the normal persistent task +backend even when `resilient_background=False`. In steering-only mode, live +queue/cancel works, an interrupted current response is crash-failed without +handler re-invocation, and persisted queued turns may promote after restart. +Recovery composes with steering — see the [handler guide's Recovery × Cancellation Composition](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/agentserver/azure-ai-agentserver-responses/docs/handler-implementation-guide.md#recovery--cancellation-composition). +These server options do not change the request-level mode contract: +`background=true, store=false` is still rejected with HTTP 400; ordinary +`store=false` foreground work remains ephemeral; a foreground client +disconnect cancels foreground work; and accepted background work survives a +client disconnect. + > **`conversation_id` chains**: when a request supplies > `conversation_id`, sequential turns extend the chain even when > `steerable_conversations=False`. Only **concurrent overlap** (a new @@ -204,12 +225,15 @@ restarts. The framework defaults provide this automatically; the sections below describe what they do and how to override them for specific scenarios. -- **Resilient task store**: in a hosted environment the framework uses +- **Task store**: when either server option requests the Responses task runtime, + a hosted environment uses the Foundry task storage API; in local development it auto-selects a file-backed task store under - `${AGENTSERVER_STATE_ROOT:-~/.agentserver}/tasks/`. Either way, tasks - survive process restarts so a recovered handler re-enters its prior - task body. Operators can override the auto-selection by setting + `${AGENTSERVER_STATE_ROOT:-~/.agentserver}/tasks/`. With + `resilient_background=True`, recovered background handlers re-enter their + prior task body. With steering alone, the interrupted handler is not re-run, + but persisted queued turns may start as new steered turns. Operators can + override the auto-selection by setting `AGENTSERVER_TASKS_BACKEND=local` (to force file-backed in hosted) or `AGENTSERVER_TASKS_BACKEND=hosted` (to force the hosted API in local). @@ -236,10 +260,11 @@ owns the equivalent migration for its task store). ## Recovery + steering surface on `ResponseContext` -When `resilient_background=True`, the framework populates flat fields -on the response context for every handler invocation. The fields -mirror the underlying task primitive's classifiers and are safe to -read regardless of `is_recovery`: +When either `resilient_background=True` or +`steerable_conversations=True`, the framework populates flat task-classifier +fields on the response context for every handler invocation. They are safe to +read regardless of `is_recovery`; recovery-specific values become meaningful +only on the resilient re-invocation path: > **Recovered inputs are identical to fresh entry.** On a recovered > re-invocation the handler observes the *same* `request`, `client_headers`, @@ -570,8 +595,12 @@ final response but may render intermediate states incorrectly. When `background=false` (foreground streaming): - Response is tied to the HTTP connection lifetime. -- If the server crashes: response is marked `failed` with `code=server_error`. -- The handler is NOT re-invoked (client is already disconnected). +- The handler is never re-invoked after a crash, regardless of + `resilient_background`. +- When either server option has requested the task runtime, a crash marks the + response `failed` with `code=server_error`. +- When both options are `False`, the response runs non-durably and no + next-lifetime mark-failed action occurs. - Conversation lock still applies (prevents concurrent modifications). ## Layered Concerns diff --git a/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml b/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml index 5bfbc7dc0c5a..7586bfd26f34 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml +++ b/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml @@ -18,7 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3.14", ] dependencies = [ - "azure-ai-agentserver-core>=2.3.0b1,<3.0.0", + "azure-ai-agentserver-core>=2.3.0b2,<3.0.0", "azure-core>=1.37.0,<2.0.0", "isodate>=0.6.1,<1.0.0", "aiohttp>=3.10.0,<4.0.0a0", @@ -76,5 +76,5 @@ in_bundle = false [tool.azure-sdk-build] verifytypes = false latestdependency = false -# azure-ai-agentserver-core>=2.3.0b1 is not yet on PyPI +# Protocol-scoped task-runtime support requires the matching core preview. mindependency = false diff --git a/sdk/agentserver/azure-ai-agentserver-responses/samples/README.md b/sdk/agentserver/azure-ai-agentserver-responses/samples/README.md index 44275d72acff..98645b48cb0b 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/samples/README.md +++ b/sdk/agentserver/azure-ai-agentserver-responses/samples/README.md @@ -65,8 +65,20 @@ app = ResponsesAgentServerHost( ) ``` -Without `resilient_background=True`, a crash mid-handler leaves the -response in the "crash-failed" state (the next process lifetime marks -it `failed` instead of re-invoking the handler). Without -`steerable_conversations=True`, concurrent multi-turn requests for the -same conversation return `409 conversation_locked` instead of queueing. \ No newline at end of file +Either option initializes the Responses task runtime automatically; no +`set_resilient_tasks_enabled` call is needed. That switch controls Invocations, +not Responses. + +With `steerable_conversations=True` and `resilient_background=False`, steering +uses the normal persistent task backend. On restart, an interrupted stored +response is marked `failed` without re-invoking its handler; persisted queued +turns may still be promoted and executed. + +With both options `False`, there is no Responses task runtime or task-based +crash cleanup. An interrupted stored response can remain `in_progress` after a +hard crash. Graceful shutdown still attempts to persist a failed terminal. + +When the task runtime is active, concurrent requests for the same explicit +conversation queue with steering enabled or receive `409 conversation_locked` +with steering disabled. Without a task runtime, overlapping requests execute +independently rather than acquiring a task-backed conversation lock. \ No newline at end of file diff --git a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_19_resilient_streaming.py b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_19_resilient_streaming.py index 864ff2b26c6a..660281afce94 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_19_resilient_streaming.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_19_resilient_streaming.py @@ -62,17 +62,10 @@ ResponsesAgentServerHost, ResponsesServerOptions, ) -from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled options = ResponsesServerOptions(resilient_background=True) app = ResponsesAgentServerHost(options=options) -# Explicitly opt into resilient-task startup recovery, for parity with the -# invocations resilient samples. The Responses framework already registers its -# internal durable tasks at host construction (so recovery runs regardless); -# this call just makes the opt-in intent explicit. -set_resilient_tasks_enabled(True) - _SIMULATE_SHUTDOWN_MS = int(os.environ.get("SIMULATE_SHUTDOWN_MS", "0")) # Phases run in order. Each emits one message output item and is made diff --git a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_20_resilient_steering.py b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_20_resilient_steering.py index b89622d2dc0d..78283753b915 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_20_resilient_steering.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_20_resilient_steering.py @@ -60,7 +60,6 @@ import os from azure.ai.agentserver.core.storage import FoundryStateStore -from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled from azure.ai.agentserver.responses import ( CreateResponse, ResponseContext, @@ -75,12 +74,6 @@ ) app = ResponsesAgentServerHost(options=options) -# Explicitly opt into resilient-task startup recovery, for parity with the -# invocations resilient samples. The Responses framework already registers its -# internal durable tasks at host construction (so recovery runs regardless); -# this call just makes the opt-in intent explicit. -set_resilient_tasks_enabled(True) - _SIMULATE_SHUTDOWN_MS = int(os.environ.get("SIMULATE_SHUTDOWN_MS", "0")) @@ -136,11 +129,7 @@ async def handler( ) async with store: item = await store.get_item("state") - state = ( - dict(item.value) - if item is not None and isinstance(item.value, dict) - else {} - ) + state = dict(item.value) if item is not None and isinstance(item.value, dict) else {} if state.get("last_response_id") == context.response_id: turn_count = int(state.get("turn_count", 1)) else: diff --git a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py index 70e99eda0d9b..a86cae90c068 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py @@ -71,7 +71,6 @@ from langgraph.types import Command, interrupt from azure.ai.agentserver.core.storage import FoundryStateStore -from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled from azure.ai.agentserver.responses import ( CreateResponse, ResponseContext, @@ -93,12 +92,8 @@ class ConversationState(typing.TypedDict): # ─── Graph nodes ──────────────────────────────────────────────────────────── -_STEP_DELAY = float( - os.environ.get("LANGGRAPH_STEP_DELAY_SEC", "0.4") -) # Seconds per non-streaming node. -_TOKEN_DELAY = float( - os.environ.get("LANGGRAPH_TOKEN_DELAY_SEC", "0.08") -) # Seconds between streamed tokens. +_STEP_DELAY = float(os.environ.get("LANGGRAPH_STEP_DELAY_SEC", "0.4")) # Seconds per non-streaming node. +_TOKEN_DELAY = float(os.environ.get("LANGGRAPH_TOKEN_DELAY_SEC", "0.08")) # Seconds between streamed tokens. async def analyze_input(state: ConversationState) -> dict[str, Any]: @@ -153,11 +148,7 @@ def _should_continue(state: ConversationState) -> str: # one is configured (so all of this deployment's durable state lives together # and survives restarts); fall back to a per-user dir for local runs. _STATE_ROOT = os.environ.get("AGENTSERVER_STATE_ROOT") -_DATA_DIR = ( - Path(_STATE_ROOT) / "langgraph" - if _STATE_ROOT - else Path.home() / ".agentserver" / "langgraph-responses" -) +_DATA_DIR = Path(_STATE_ROOT) / "langgraph" if _STATE_ROOT else Path.home() / ".agentserver" / "langgraph-responses" _DATA_DIR.mkdir(parents=True, exist_ok=True) _DB_PATH = _DATA_DIR / "checkpoints.db" @@ -177,9 +168,7 @@ def _build_graph(checkpointer: Any) -> Any: builder.add_edge("analyze_input", "generate_response") builder.add_edge("generate_response", "refine_response") builder.add_edge("refine_response", "wait_for_user") - builder.add_conditional_edges( - "wait_for_user", _should_continue, {"continue": "analyze_input", "end": END} - ) + builder.add_conditional_edges("wait_for_user", _should_continue, {"continue": "analyze_input", "end": END}) return builder.compile(checkpointer=checkpointer) @@ -208,12 +197,6 @@ async def _get_graph() -> Any: ) app = ResponsesAgentServerHost(options=options) -# Explicitly opt into resilient-task startup recovery, for parity with the -# invocations resilient samples. The Responses framework already registers its -# internal durable tasks at host construction (so recovery runs regardless); -# this call just makes the opt-in intent explicit. -set_resilient_tasks_enabled(True) - # Metadata key: the LangGraph checkpoint id whose completed work matches the # response items persisted so far. Recorded in ``internal_metadata`` (persisted # atomically WITH the items on every ``stream.checkpoint()``, stripped on @@ -232,14 +215,11 @@ def _reply_already_persisted(stream: ResponseEventStream) -> bool: again. It also becomes True the moment this attempt closes a fresh reply item. """ return any( - isinstance(item, dict) and item.get("type") == "message" - for item in (stream.response.get("output") or []) + isinstance(item, dict) and item.get("type") == "message" for item in (stream.response.get("output") or []) ) -async def _fork_from_checkpoint( - graph: Any, config: dict[str, Any], checkpoint_id: str, new_message: str -) -> bool: +async def _fork_from_checkpoint(graph: Any, config: dict[str, Any], checkpoint_id: str, new_message: str) -> bool: """Fork graph state from a stable checkpoint with a new (steered) message.""" # The sqlite checkpointer requires ``checkpoint_ns`` on the config it writes # through; the resilient context only carries ``thread_id``, so seed the @@ -299,9 +279,7 @@ async def handler( # Seed from the last framework checkpoint so already-emitted items keep their # ORIGINAL ids; the in_progress below re-emits them (the reset point). if context.is_recovery and context.persisted_response is not None: - stream = ResponseEventStream( - response_id=context.response_id, response=context.persisted_response - ) + stream = ResponseEventStream(response_id=context.response_id, response=context.persisted_response) else: stream = ResponseEventStream(response_id=context.response_id, request=request) @@ -328,16 +306,8 @@ async def handler( # checkpoint, so nodes after it (incl. the token-streaming node, if its # reply was not yet persisted) re-run — re-streaming the reply exactly # when needed and nothing more. - graph_cp = ( - stream.internal_metadata.get(_GRAPH_CP_KEY) - if context.persisted_response is not None - else None - ) - run_config = ( - {"configurable": {"thread_id": chain_id, "checkpoint_id": graph_cp}} - if graph_cp - else thread_config - ) + graph_cp = stream.internal_metadata.get(_GRAPH_CP_KEY) if context.persisted_response is not None else None + run_config = {"configurable": {"thread_id": chain_id, "checkpoint_id": graph_cp}} if graph_cp else thread_config graph_input: Any = None else: input_text = await context.get_input_text() @@ -347,11 +317,7 @@ async def handler( ) async with store: item = await store.get_item("state") - conversation_state = ( - dict(item.value) - if item is not None and isinstance(item.value, dict) - else {} - ) + conversation_state = dict(item.value) if item is not None and isinstance(item.value, dict) else {} stable_cp = conversation_state.get("stable_checkpoint_id") state = await graph.aget_state(thread_config) run_config = thread_config @@ -359,9 +325,7 @@ async def handler( if stable_cp and context.is_steered_turn: # Fresh steered successor: fork from the last stable checkpoint with # the new message, then resume (input=None). - forked = await _fork_from_checkpoint( - graph, thread_config, stable_cp, input_text - ) + forked = await _fork_from_checkpoint(graph, thread_config, stable_cp, input_text) graph_input = ( None if forked @@ -378,9 +342,7 @@ async def handler( # Graph left mid-turn (e.g. a prior turn was cancelled before its # interrupt) — do NOT Command(resume) a non-interrupt node; fork a # clean turn from the last stable checkpoint instead. - forked = await _fork_from_checkpoint( - graph, thread_config, stable_cp, input_text - ) + forked = await _fork_from_checkpoint(graph, thread_config, stable_cp, input_text) graph_input = ( None if forked @@ -427,9 +389,7 @@ async def handler( # is the point at which the reply is durable. saw_generate_commit = True elif mode == "checkpoints": - checkpoint_id = ( - chunk.get("config", {}).get("configurable", {}).get("checkpoint_id") - ) + checkpoint_id = chunk.get("config", {}).get("configurable", {}).get("checkpoint_id") if reply_open and not reply_closed and saw_generate_commit: yield text.emit_text_done() yield text.emit_done() diff --git a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_22_resilient_multiturn.py b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_22_resilient_multiturn.py index 88e9fcc2223e..45d8a90f9ee8 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_22_resilient_multiturn.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_22_resilient_multiturn.py @@ -38,7 +38,6 @@ import asyncio from azure.ai.agentserver.core.storage import FoundryStateStore -from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled from azure.ai.agentserver.responses import ( CreateResponse, ResponseContext, @@ -53,12 +52,6 @@ ) app = ResponsesAgentServerHost(options=options) -# Explicitly opt into resilient-task startup recovery, for parity with the -# invocations resilient samples. The Responses framework already registers its -# internal durable tasks at host construction (so recovery runs regardless); -# this call just makes the opt-in intent explicit. -set_resilient_tasks_enabled(True) - @app.response_handler async def handler( @@ -74,15 +67,8 @@ async def handler( ) async with store: item = await store.get_item("state") - state = ( - dict(item.value) - if item is not None and isinstance(item.value, dict) - else {} - ) - if ( - state.get("terminated") - and state.get("last_response_id") != context.response_id - ): + state = dict(item.value) if item is not None and isinstance(item.value, dict) else {} + if state.get("terminated") and state.get("last_response_id") != context.response_id: state = {} if state.get("last_response_id") == context.response_id: turn_count = int(state.get("turn_count", 1)) @@ -91,9 +77,7 @@ async def handler( # Explicit session termination if input_text.strip().lower() == "done": - if state.get("last_response_id") == context.response_id and state.get( - "terminated" - ): + if state.get("last_response_id") == context.response_id and state.get("terminated"): completed_turns = int(state.get("completed_turns", 0)) else: completed_turns = max(turn_count - 1, 0) diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/contract/test_resilient_start_failure.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/contract/test_resilient_start_failure.py index 7a71295dc280..5228ff457eb3 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/contract/test_resilient_start_failure.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/contract/test_resilient_start_failure.py @@ -33,7 +33,7 @@ set_resilient_tasks_enabled, ) from azure.ai.agentserver.core.tasks._manager import get_task_manager, set_task_manager -from azure.ai.agentserver.responses import ResponsesAgentServerHost +from azure.ai.agentserver.responses import ResponsesAgentServerHost, ResponsesServerOptions from azure.ai.agentserver.responses.hosting import _resilient_orchestrator as _ro from azure.ai.agentserver.responses.streaming._event_stream import ResponseEventStream @@ -70,8 +70,8 @@ async def _events() -> AsyncIterator[Any]: return _events() -def _build_client(handler: Any = None) -> TestClient: - app = ResponsesAgentServerHost() +def _build_client(handler: Any = None, *, task_runtime: bool = False) -> TestClient: + app = ResponsesAgentServerHost(options=ResponsesServerOptions(steerable_conversations=task_runtime)) app.response_handler(handler or _noop_handler) return TestClient(app) @@ -110,7 +110,7 @@ class TestTaskStartFailureSurfacesPlatform: """Manager present + task start fails → fail immediately, platform source.""" def test_background_start_failure_returns_platform_500(self, _start_fails: None) -> None: - with _build_client() as client: # lifespan installs a real TaskManager + with _build_client(task_runtime=True) as client: # lifespan installs a real TaskManager resp = client.post( "/responses", json={"model": "test", "input": "hi", "stream": False, "store": True, "background": True}, @@ -122,7 +122,7 @@ def test_background_start_failure_returns_platform_500(self, _start_fails: None) assert "in_progress" not in resp.text def test_sync_start_failure_returns_platform_500(self, _start_fails: None) -> None: - with _build_client() as client: + with _build_client(task_runtime=True) as client: resp = client.post( "/responses", json={"model": "test", "input": "hi", "stream": False, "store": True, "background": False}, @@ -132,7 +132,7 @@ def test_sync_start_failure_returns_platform_500(self, _start_fails: None) -> No assert ERROR_DETAIL in resp.headers def test_streaming_start_failure_emits_standalone_error_event(self, _start_fails: None) -> None: - with _build_client() as client: + with _build_client(task_runtime=True) as client: resp = client.post( "/responses", json={"model": "test", "input": "hi", "stream": True, "store": True, "background": True}, diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_steering_handler.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_steering_handler.py index d5f68eda85e3..b8ae32eb4051 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_steering_handler.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_steering_handler.py @@ -41,7 +41,6 @@ import asyncio import os -from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled from azure.ai.agentserver.responses import ( CreateResponse, ResponseContext, @@ -78,11 +77,6 @@ def _env_int(name: str, default: int) -> int: steerable_conversations=True, shutdown_grace_period_seconds=_SHUTDOWN_GRACE_S, ) -# Steering (mid-turn input queuing) is implemented by the multi-turn task -# primitive and needs the TaskManager. Since only ``resilient_background`` now -# auto-enables the subsystem (steerable does not), enable it explicitly so the -# steering conformance is valid even when CONFORMANCE_RESILIENT_BACKGROUND=false. -set_resilient_tasks_enabled(True) app = ResponsesAgentServerHost(options=options) _turn_counts: dict[str, int] = {} diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_test_handler.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_test_handler.py index e7d796589285..eeebbdcdda22 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_test_handler.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/_test_handler.py @@ -29,10 +29,8 @@ (Spec 024 Phase 3a unified storage layout.) - ``CONFORMANCE_RESILIENT_BACKGROUND`` — ``"true"`` or ``"false"`` to select the server's ``resilient_background`` option. Default ``"true"``. -- ``CONFORMANCE_RESILIENT_BACKGROUND`` — ``"true"`` to set - ``ResponsesServerOptions(resilient_background=True)``. - (forces row 4 ephemeral regardless of per-request ``store`` flag). - Default ``"false"``. +- ``CONFORMANCE_STEERABLE_CONVERSATIONS`` — ``"true"`` enables steering. + Default ``"false"``. Either Responses feature initializes TaskManager. - ``CONFORMANCE_HANDLER_SLEEP_MS`` — milliseconds the handler sleeps between the pre-sleep delta burst and the post-sleep delta burst. Default ``50`` (fast natural completion). @@ -53,7 +51,6 @@ import asyncio import os -from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled from azure.ai.agentserver.responses import ( CreateResponse, ResponseContext, @@ -100,14 +97,9 @@ def _env_int(name: str, default: int) -> int: options = ResponsesServerOptions( resilient_background=_RESILIENT_BG, + steerable_conversations=_env_bool("CONFORMANCE_STEERABLE_CONVERSATIONS", False), shutdown_grace_period_seconds=_SHUTDOWN_GRACE_S, ) -# Conformance exercises the durable-response subsystem (Rows 1/2/3), which is -# gated on the resilient-tasks switch. Row 2 runs with resilient_background=False -# (which does NOT auto-enable the switch), so enable it explicitly here — the -# server must construct the TaskManager and run recovery to honour the Row 2 -# mark-failed-on-crash contract. -set_resilient_tasks_enabled(True) app = ResponsesAgentServerHost(options=options) diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/conftest.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/conftest.py index d02e7d69c432..3d6ada8bdd3c 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/conftest.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/conftest.py @@ -98,7 +98,7 @@ def make_harness(tmp_path: Path) -> Callable[..., CrashHarness]: Returns a callable that takes: - ``resilient_background`` (bool, default True) — server option. - - ```` (bool, default False) — server option. + - ``steerable_conversations`` (bool, default False) — server option. - ``handler_sleep_ms`` (int, default 50) — handler sleep before emitting completion. - ``shutdown_grace_seconds`` (int, default LONG_GRACE_S) — server's @@ -114,6 +114,7 @@ def make_harness(tmp_path: Path) -> Callable[..., CrashHarness]: def _factory( *, resilient_background: bool = True, + steerable_conversations: bool = False, handler_sleep_ms: int = 50, pre_sleep_deltas: int = 0, explicit_exit_for_recovery: bool = False, @@ -123,6 +124,7 @@ def _factory( ) -> CrashHarness: env = { "CONFORMANCE_RESILIENT_BACKGROUND": "true" if resilient_background else "false", + "CONFORMANCE_STEERABLE_CONVERSATIONS": "true" if steerable_conversations else "false", "CONFORMANCE_HANDLER_SLEEP_MS": str(handler_sleep_ms), "CONFORMANCE_PRE_SLEEP_DELTAS": str(pre_sleep_deltas), "CONFORMANCE_EXPLICIT_EXIT_FOR_RECOVERY": ("true" if explicit_exit_for_recovery else "false"), diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_a.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_a.py index fb0dc409d080..65d257c8192e 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_a.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_a.py @@ -31,6 +31,7 @@ async def test_row_2_path_a(make_harness: Callable[..., CrashHarness], stream: b """Row 2 Path A: non-resilient+bg handler completes naturally within grace.""" harness = make_harness( resilient_background=False, + steerable_conversations=True, handler_sleep_ms=50, shutdown_grace_seconds=LONG_GRACE_S, ) diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_b.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_b.py index 4a598059b316..5f825944ab82 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_b.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_b.py @@ -36,6 +36,7 @@ async def test_row_2_path_b(make_harness: Callable[..., CrashHarness], stream: b """Row 2 Path B: graceful shutdown, grace exhausted, in-process marker fires.""" harness = make_harness( resilient_background=False, + steerable_conversations=True, handler_sleep_ms=int(LONG_TIME_SECS * 1000), shutdown_grace_seconds=SHORT_GRACE_S, ) diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_c.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_c.py index 4bc157d92c14..04d163610fb1 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_c.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/e2e/resilience_contract/test_row_2_path_c.py @@ -8,14 +8,8 @@ next-lifetime recovery. The reconnecting client sees the failed terminal — NOT ``in_progress`` indefinitely. -EXPECTED today: **RED — divergence 2.** ``_orchestrator.py:2273`` gates -``_start_resilient_background`` on ``resilient_background AND store``. With -``resilient_background=False`` no resilient record is created; next-lifetime -recovery finds nothing for the response; nothing marks it failed. -The response stays ``in_progress`` indefinitely. - -Phase 4 closes this by creating a bookkeeping resilient record for every -``store=true`` response (per RD-1) with disposition ``mark-failed``. +With steering enabled this flag-off response has a durable task runtime. +With both Responses features disabled, no recovery scanner runs instead. Contract source: ``resilience-contract.md`` § Per-row contracts → Row 2. """ @@ -39,10 +33,12 @@ @pytest.mark.asyncio @pytest.mark.parametrize("stream", [False, True], ids=["stream=False", "stream=True"]) -async def test_row_2_path_c(make_harness: Callable[..., CrashHarness], stream: bool) -> None: - """Row 2 Path C: SIGKILL mid-handler, restart, response marked failed.""" +@pytest.mark.parametrize("steerable", [False, True], ids=["runtime-off", "steering-runtime"]) +async def test_row_2_path_c(make_harness: Callable[..., CrashHarness], stream: bool, steerable: bool) -> None: + """Only a feature-enabled task runtime marks an interrupted response failed.""" harness = make_harness( resilient_background=False, + steerable_conversations=steerable, handler_sleep_ms=int(LONG_TIME_SECS * 1000), pre_sleep_deltas=1 if stream else 0, shutdown_grace_seconds=LONG_GRACE_S, @@ -62,9 +58,15 @@ async def test_row_2_path_c(make_harness: Callable[..., CrashHarness], stream: b await harness.kill() await harness.restart() - terminal = await poll_until_terminal(harness.client, response_id) - assert terminal["status"] == "failed", terminal - error = terminal.get("error") or {} - assert error.get("code") in ("server_error", "server_crashed"), error + if steerable: + terminal = await poll_until_terminal(harness.client, response_id) + assert terminal["status"] == "failed", terminal + error = terminal.get("error") or {} + assert error.get("code") in ("server_error", "server_crashed"), error + else: + await asyncio.sleep(LONG_TIME_SECS + 1) + response = await harness.client.get(f"/responses/{response_id}") + assert response.status_code == 200, response.text + assert response.json()["status"] == "in_progress", response.text finally: await harness.close() diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_protocol_task_enablement.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_protocol_task_enablement.py new file mode 100644 index 000000000000..c579c55fa5b4 --- /dev/null +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_protocol_task_enablement.py @@ -0,0 +1,279 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +"""Responses feature activation is independent of the Invocations switch.""" + +from __future__ import annotations + +import asyncio +from datetime import datetime, timedelta, timezone +from pathlib import Path +from unittest.mock import AsyncMock + +import pytest +from starlette.testclient import TestClient + +from azure.ai.agentserver.core.tasks import ( + TaskManagerNotInitialized, + resilient_tasks_enabled, + set_resilient_tasks_enabled, +) +from azure.ai.agentserver.core.tasks._manager import get_task_manager +from azure.ai.agentserver.responses import ResponseEventStream, ResponsesAgentServerHost, ResponsesServerOptions + + +@pytest.mark.parametrize("switch", [False, True]) +@pytest.mark.parametrize("resilient,steerable", [(False, False), (False, True), (True, False), (True, True)]) +@pytest.mark.parametrize("store,background", [(False, False), (False, True), (True, False), (True, True)]) +@pytest.mark.parametrize("stream", [False, True]) +def test_responses_activation_and_request_mode_matrix( + monkeypatch: pytest.MonkeyPatch, + switch: bool, + resilient: bool, + steerable: bool, + store: bool, + background: bool, + stream: bool, +) -> None: + monkeypatch.delenv("FOUNDRY_HOSTING_ENVIRONMENT", raising=False) + monkeypatch.setenv("AGENTSERVER_TASKS_BACKEND", "local") + set_resilient_tasks_enabled(switch) + host = ResponsesAgentServerHost( + options=ResponsesServerOptions(resilient_background=resilient, steerable_conversations=steerable), + configure_observability=None, + ) + assert resilient_tasks_enabled() is switch + observed: list[tuple[bool, bool]] = [] + + @host.response_handler + async def handler(request, context, cancellation_signal): + try: + get_task_manager() + manager_available = True + except TaskManagerNotInitialized: + manager_available = False + observed.append((manager_available, context._task_context is not None)) + events = ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + yield events.emit_completed() + + with TestClient(host) as client: + assert (host._task_manager is not None) is (resilient or steerable) + response = client.post( + "/responses", + json={"model": "m", "input": "hello", "store": store, "background": background, "stream": stream}, + ) + if background and not store: + assert response.status_code == 400 + assert response.json()["error"]["param"] == "background" + assert observed == [] + else: + assert response.status_code == 200, response.text + assert observed == [((resilient or steerable), store and (resilient or steerable))] + assert resilient_tasks_enabled() is switch + + +@pytest.mark.parametrize("resilient,steerable", [(False, True), (True, False), (True, True)]) +@pytest.mark.asyncio +async def test_requested_runtime_startup_failure_is_not_downgraded( + monkeypatch: pytest.MonkeyPatch, resilient: bool, steerable: bool +) -> None: + from azure.ai.agentserver.core.tasks._manager import TaskManager + + set_resilient_tasks_enabled(False) + shutdown = AsyncMock() + monkeypatch.setattr(TaskManager, "startup", AsyncMock(side_effect=RuntimeError("task store unavailable"))) + monkeypatch.setattr(TaskManager, "shutdown", shutdown) + host = ResponsesAgentServerHost( + options=ResponsesServerOptions(resilient_background=resilient, steerable_conversations=steerable), + configure_observability=None, + ) + with pytest.raises(RuntimeError, match="task store unavailable"): + async with host.router.lifespan_context(host): + pytest.fail("Startup must fail") + assert host._task_manager is None + shutdown.assert_awaited_once() + + +@pytest.mark.asyncio +async def test_overlapping_hosts_do_not_share_task_manager(monkeypatch: pytest.MonkeyPatch, tmp_path) -> None: + from azure.ai.agentserver.core.tasks._local_provider import LocalFileTaskProvider + from azure.ai.agentserver.core.tasks._manager import TaskManager + + providers = iter([LocalFileTaskProvider(tmp_path / "first"), LocalFileTaskProvider(tmp_path / "second")]) + monkeypatch.setattr(TaskManager, "_create_provider", staticmethod(lambda _: next(providers))) + set_resilient_tasks_enabled(False) + first = ResponsesAgentServerHost( + options=ResponsesServerOptions(steerable_conversations=True), configure_observability=None + ) + second = ResponsesAgentServerHost( + options=ResponsesServerOptions(resilient_background=True), configure_observability=None + ) + async with first.router.lifespan_context(first): + first_manager = get_task_manager() + async with second.router.lifespan_context(second): + second_manager = get_task_manager() + assert first_manager is not second_manager + assert get_task_manager() is first_manager + assert first._task_manager is first_manager + assert first._task_manager is None + assert second._task_manager is None + + +def test_disabled_responses_does_not_use_another_hosts_manager() -> None: + set_resilient_tasks_enabled(True) + enabled = ResponsesAgentServerHost( + options=ResponsesServerOptions(resilient_background=True), configure_observability=None + ) + disabled = ResponsesAgentServerHost(configure_observability=None) + observed: list[bool] = [] + + @disabled.response_handler + async def handler(request, context, cancellation_signal): + with pytest.raises(TaskManagerNotInitialized): + get_task_manager() + observed.append(context._task_context is None) + events = ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + yield events.emit_completed() + + with TestClient(enabled), TestClient(disabled) as client: + result = client.post("/responses", json={"input": "hello", "store": True}) + assert result.status_code == 200, result.text + assert observed == [True] + + +@pytest.mark.parametrize("multi_turn", [False, True]) +@pytest.mark.parametrize("other_enabled", [False, True]) +@pytest.mark.parametrize("construct_after_startup", [False, True]) +@pytest.mark.asyncio +async def test_recovery_uses_owning_hosts_handler_provider_and_options( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + multi_turn: bool, + other_enabled: bool, + construct_after_startup: bool, +) -> None: + from azure.ai.agentserver.core.tasks._lease import derive_lease_owner + from azure.ai.agentserver.core.tasks._local_provider import LocalFileTaskProvider + from azure.ai.agentserver.core.tasks._manager import TaskManager, _SCHEMA_VERSION, _SCHEMA_VERSION_KEY + from azure.ai.agentserver.core.tasks._models import TaskCreateRequest + from azure.ai.agentserver.responses import PlatformContext + from azure.ai.agentserver.responses.hosting._resilient_input import ResilientResponseInput + from azure.ai.agentserver.responses.hosting._task_id import derive_lifecycle_id + from azure.ai.agentserver.responses.models._generated import CreateResponse, ResponseObject + from azure.ai.agentserver.responses.store._file import FileResponseStore + + monkeypatch.delenv("FOUNDRY_HOSTING_ENVIRONMENT", raising=False) + task_store = LocalFileTaskProvider(tmp_path / "tasks") + monkeypatch.setattr(TaskManager, "_create_provider", staticmethod(lambda _: task_store)) + set_resilient_tasks_enabled(False) + stores = [FileResponseStore(storage_dir=tmp_path / name) for name in ("first", "second")] + first = ResponsesAgentServerHost( + options=ResponsesServerOptions(resilient_background=True, steerable_conversations=True), + store=stores[0], + configure_observability=None, + ) + observed = [] + + @first.response_handler + async def first_handler(request, context, cancellation_signal): + observed.append(("first", context.is_recovery, get_task_manager() is first._task_manager)) + events = ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + for event in events.output_item_message("recovered by first"): + yield event + yield events.emit_completed() + + def construct_other_host() -> ResponsesAgentServerHost: + second = ResponsesAgentServerHost( + options=ResponsesServerOptions(resilient_background=other_enabled), + store=stores[1], + configure_observability=None, + ) + + @second.response_handler + async def second_handler(request, context, cancellation_signal): + observed.append(("second", context.is_recovery, get_task_manager() is first._task_manager)) + events = ResponseEventStream(response_id=context.response_id, request=request) + yield events.emit_created() + for event in events.output_item_message("recovered by second"): + yield event + yield events.emit_completed() + + return second + + response_id = "resp_host_callback_owner" + platform_context = PlatformContext(user_id_key="owner") + for store in stores: + await store.create_response( + ResponseObject( + { + "id": response_id, + "object": "response", + "status": "in_progress", + "background": True, + "model": "m", + "output": [], + } + ), + [], + None, + context=platform_context, + ) + orchestrator = first._endpoint._orchestrator._resilient_orchestrator + primitive = orchestrator._multi_turn_task_fn if multi_turn else orchestrator._one_shot_task_fn + + async def persist_interrupted_task() -> None: + request = CreateResponse(model="m", input="recover this", store=True, background=True, stream=False) + if multi_turn: + request["conversation"] = "conv_callback_owner" + params = ResilientResponseInput( + request=request, response_id=response_id, disposition="re-invoke", user_id_key="owner" + ).to_task_input() + payload = {"input": params, _SCHEMA_VERSION_KEY: _SCHEMA_VERSION} + if multi_turn: + payload["last_input_id"] = derive_lifecycle_id(response_id, "owner") + agent = first.config.agent_name or "default" + session = first.config.session_id or "local" + info = await task_store.create( + TaskCreateRequest( + id=derive_lifecycle_id("task-owner", "owner"), + agent_name=agent, + session_id=session, + status="in_progress", + title="Interrupted response for callback ownership", + payload=payload, + tags={"task_name": primitive.name}, + source=TaskManager._build_source(primitive.name), + lease_owner=derive_lease_owner(first.config.agent_name or "unknown-agent", session), + lease_instance_id="interrupted-instance", + lease_duration_seconds=60, + ) + ) + assert info.lease is not None + info.lease.expires_at = (datetime.now(timezone.utc) - timedelta(minutes=10)).isoformat() + task_store._write_task(info) + + async def wait_for_terminal(): + while True: + snapshots = [await store.get_response(response_id, context=platform_context) for store in stores] + if any(snapshot["status"] in ("completed", "failed", "cancelled") for snapshot in snapshots): + return snapshots + await asyncio.sleep(0.01) + + if not construct_after_startup: + construct_other_host() + await persist_interrupted_task() + async with first.router.lifespan_context(first): + if construct_after_startup: + construct_other_host() + await persist_interrupted_task() + await first._task_manager._recover_stale_tasks() + recovered, untouched = await asyncio.wait_for(wait_for_terminal(), timeout=10) + assert observed == [("first", True, True)] + assert recovered["status"] == "completed" + assert recovered["output"][0]["content"][0]["text"] == "recovered by first" + assert untouched["status"] == "in_progress" + assert untouched["output"] == [] + assert first._task_manager._resume_callbacks[primitive.name] is primitive._fn + assert first._task_manager._resume_opts[primitive.name] is primitive._opts diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_steering_input_handoff.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_steering_input_handoff.py index f5cd019cb23a..f7753e93d05c 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_steering_input_handoff.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/integration/test_steering_input_handoff.py @@ -30,7 +30,7 @@ def test_queued_turn_executes_after_steering_cancellation( ) -> None: monkeypatch.delenv("FOUNDRY_HOSTING_ENVIRONMENT", raising=False) monkeypatch.setenv("AGENTSERVER_TASKS_BACKEND", "local") - set_resilient_tasks_enabled(True) + set_resilient_tasks_enabled(False) host = ResponsesAgentServerHost( options=ResponsesServerOptions( resilient_background=resilient_background, diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_response_delete_recovery.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_response_delete_recovery.py index 86d264d56092..5ff83dfc9ebf 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_response_delete_recovery.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_response_delete_recovery.py @@ -2006,6 +2006,7 @@ async def events(): host.response_handler(handler) manager = TaskManager(host.config, provider=task_store) + host._task_manager = manager set_task_manager(manager) monkeypatch.setattr(lifecycle, "get_task_manager", lambda: manager) suspended = asyncio.Queue() diff --git a/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_stream_lifecycle_cleanup.py b/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_stream_lifecycle_cleanup.py index 123d938a0995..e460c11d5136 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_stream_lifecycle_cleanup.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_stream_lifecycle_cleanup.py @@ -72,7 +72,8 @@ def _request(*, user: str = "owner", background: bool = True, stream: bool = Tru def _host() -> ResponsesAgentServerHost: host = ResponsesAgentServerHost( - options=ResponsesServerOptions(resilient_background=False), store=InMemoryResponseProvider() + options=ResponsesServerOptions(resilient_background=False, steerable_conversations=True), + store=InMemoryResponseProvider(), ) async def handler(request: Any, context: Any, cancellation_signal: Any) -> Any: From 523455dfac95381e350b97039f0ed43f8ce880be Mon Sep 17 00:00:00 2001 From: Kashif Khan <361477+kashifkhan@users.noreply.github.com> Date: Thu, 22 Oct 2026 11:02:01 -0500 Subject: [PATCH 22/35] update aiohttp requirement (#49654) --- common/smoketest/requirements_async.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/smoketest/requirements_async.txt b/common/smoketest/requirements_async.txt index 3a90515a8b7e..2652def36532 100644 --- a/common/smoketest/requirements_async.txt +++ b/common/smoketest/requirements_async.txt @@ -1,3 +1,3 @@ -aiohttp==3.14.3 +aiohttp<4.0 packaging==24.2 pip==26.2.2 From 1f8bc58cecc367a25843f2537461076d68a52041 Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 11:27:16 -0700 Subject: [PATCH 23/35] [AutoPR azure-mgmt-hybridconnectivity]-generated-from-SDK Generation - Python-6732173 (#48686) * Configurations: 'specification/hybridconnectivity/HybridConnectivity.Management/tspconfig.yaml', SDK Release Type: stable, and CommitSHA: '47515ad36204e02e14c3b62414beebca92abb4a2' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6732173 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * update Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * update changelog model moves Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fully optimize changelog model moves Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update CHANGELOG.md --------- Co-authored-by: azure-sdk Co-authored-by: ChenxiJiang333 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- .../CHANGELOG.md | 75 + .../azure-mgmt-hybridconnectivity/MANIFEST.in | 9 +- .../azure-mgmt-hybridconnectivity/README.md | 6 +- .../azure-mgmt-hybridconnectivity/_meta.json | 6 - .../_metadata.json | 11 + .../azure-mgmt-hybridconnectivity/api.md | 2676 +++++++++++++++++ .../api.metadata.yml | 3 + .../apiview-properties.json | 113 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/hybridconnectivity/_client.py | 51 +- .../mgmt/hybridconnectivity/_configuration.py | 16 +- .../azure/mgmt/hybridconnectivity/_patch.py | 12 +- .../hybridconnectivity/_utils/__init__.py | 6 + .../{_model_base.py => _utils/model_base.py} | 824 ++++- .../serialization.py} | 213 +- .../mgmt/hybridconnectivity/_validation.py | 66 + .../azure/mgmt/hybridconnectivity/_version.py | 2 +- .../mgmt/hybridconnectivity/aio/_client.py | 53 +- .../hybridconnectivity/aio/_configuration.py | 16 +- .../mgmt/hybridconnectivity/aio/_patch.py | 12 +- .../aio/operations/__init__.py | 2 + .../aio/operations/_operations.py | 775 +++-- .../aio/operations/_patch.py | 12 +- .../hybridconnectivity/models/__init__.py | 18 + .../mgmt/hybridconnectivity/models/_enums.py | 30 +- .../mgmt/hybridconnectivity/models/_models.py | 451 ++- .../mgmt/hybridconnectivity/models/_patch.py | 12 +- .../hybridconnectivity/operations/__init__.py | 2 + .../operations/_operations.py | 915 ++++-- .../hybridconnectivity/operations/_patch.py | 12 +- .../azure/mgmt/hybridconnectivity/types.py | 694 +++++ ...oints_create_or_update_maximum_set_gen.py} | 6 +- ...oints_create_or_update_minimum_set_gen.py} | 21 +- .../endpoints_delete_maximum_set_gen.py | 42 + ...py => endpoints_delete_minimum_set_gen.py} | 6 +- ...om.py => endpoints_get_maximum_set_gen.py} | 6 +- ...lt.py => endpoints_get_minimum_set_gen.py} | 6 +- ...oints_list_credentials_maximum_set_gen.py} | 9 +- ...oints_list_credentials_minimum_set_gen.py} | 6 +- ...ess_gateway_credentials_maximum_set_gen.py | 43 + ...ess_gateway_credentials_minimum_set_gen.py | 43 + ..._managed_proxy_details_maximum_set_gen.py} | 8 +- ...t_managed_proxy_details_minimum_set_gen.py | 44 + ...t.py => endpoints_list_maximum_set_gen.py} | 4 +- ...s_post_list_ingress_gateway_credentials.py | 43 - .../endpoints_update_maximum_set_gen.py | 49 + .../endpoints_update_minimum_set_gen.py | 57 + ...rate_aws_template_post_maximum_set_gen.py} | 4 +- ...rate_aws_template_post_minimum_set_gen.py} | 9 +- ...erate_gcp_template_post_maximum_set_gen.py | 55 + ...rate_gcp_template_post_minimum_set_gen.py} | 10 +- .../inventory_get_maximum_set_gen.py | 44 + ..._solution_configuration_maximum_set_gen.py | 44 + ....py => operations_list_maximum_set_gen.py} | 4 +- ....py => operations_list_minimum_set_gen.py} | 8 +- ...ctors_create_or_update_maximum_set_gen.py} | 19 +- ...loud_connectors_delete_maximum_set_gen.py} | 8 +- ...c_cloud_connectors_get_maximum_set_gen.py} | 8 +- ...list_by_resource_group_maximum_set_gen.py} | 6 +- ...list_by_resource_group_minimum_set_gen.py} | 9 +- ...s_list_by_subscription_maximum_set_gen.py} | 4 +- ...rs_list_by_subscription_minimum_set_gen.py | 40 + ...ctors_test_permissions_maximum_set_gen.py} | 8 +- ...loud_connectors_update_maximum_set_gen.py} | 8 +- ...ations_create_orupdate_maximum_set_gen.py} | 18 +- ..._configurations_delete_maximum_set_gen.py} | 10 +- ...e_configurations_delete_minimum_set_gen.py | 43 + ...ice_configurations_get_maximum_set_gen.py} | 10 +- .../service_configurations_get_wac.py | 44 - ...t_by_endpoint_resource_maximum_set_gen.py} | 8 +- .../service_configurations_put_wac.py | 45 - ..._configurations_update_maximum_set_gen.py} | 10 +- ...olution_configurations_create_or_update.py | 43 - ...ations_create_or_update_maximum_set_gen.py | 50 + .../solution_configurations_delete.py | 41 - ...n_configurations_delete_maximum_set_gen.py | 42 + ...tion_configurations_get_maximum_set_gen.py | 43 + ...ion_configurations_list_maximum_set_gen.py | 43 + ...ion_configurations_list_minimum_set_gen.py | 43 + .../solution_configurations_sync_now.py | 42 - ...configurations_sync_now_maximum_set_gen.py | 43 + .../solution_configurations_update.py | 43 - ...n_configurations_update_maximum_set_gen.py | 44 + ... => solution_types_get_maximum_set_gen.py} | 8 +- ...list_by_resource_group_maximum_set_gen.py} | 6 +- ...s_list_by_subscription_maximum_set_gen.py} | 4 +- ...y_mgmt_generate_gcp_template_operations.py | 43 + ..._generate_gcp_template_operations_async.py | 44 + ...mgmt_public_cloud_connectors_operations.py | 20 +- ...ublic_cloud_connectors_operations_async.py | 20 +- .../pyproject.toml | 82 + .../sdk_packaging.toml | 12 - .../azure-mgmt-hybridconnectivity/setup.py | 83 - .../tsp-location.yaml | 2 +- 95 files changed, 7399 insertions(+), 1368 deletions(-) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/{_model_base.py => _utils/model_base.py} (56%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/{_serialization.py => _utils/serialization.py} (90%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_put_custom.py => endpoints_create_or_update_maximum_set_gen.py} (91%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_put_default.py => endpoints_create_or_update_minimum_set_gen.py} (68%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_delete_default.py => endpoints_delete_minimum_set_gen.py} (90%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_get_custom.py => endpoints_get_maximum_set_gen.py} (90%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_get_default.py => endpoints_get_minimum_set_gen.py} (90%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_patch_default.py => endpoints_list_credentials_maximum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_post_list_credentials.py => endpoints_list_credentials_minimum_set_gen.py} (89%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_post_list_managed_proxy_details.py => endpoints_list_managed_proxy_details_maximum_set_gen.py} (84%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_list.py => endpoints_list_maximum_set_gen.py} (93%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{generate_aws_template_post.py => generate_aws_template_post_maximum_set_gen.py} (91%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_configurations_get.py => generate_aws_template_post_minimum_set_gen.py} (83%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{inventory_get.py => generate_gcp_template_post_minimum_set_gen.py} (82%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{operations_list.py => operations_list_maximum_set_gen.py} (92%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_configurations_list.py => operations_list_minimum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_create_or_update.py => public_cloud_connectors_create_or_update_maximum_set_gen.py} (67%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_delete.py => public_cloud_connectors_delete_maximum_set_gen.py} (84%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_get.py => public_cloud_connectors_get_maximum_set_gen.py} (85%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_list_by_resource_group.py => public_cloud_connectors_list_by_resource_group_maximum_set_gen.py} (85%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{inventory_list_by_solution_configuration.py => public_cloud_connectors_list_by_resource_group_minimum_set_gen.py} (81%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_list_by_subscription.py => public_cloud_connectors_list_by_subscription_maximum_set_gen.py} (88%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_test_permissions.py => public_cloud_connectors_test_permissions_maximum_set_gen.py} (84%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_update.py => public_cloud_connectors_update_maximum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_put_ssh.py => service_configurations_create_orupdate_maximum_set_gen.py} (71%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_delete_ssh.py => service_configurations_delete_maximum_set_gen.py} (84%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_get_ssh.py => service_configurations_get_maximum_set_gen.py} (84%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_list.py => service_configurations_list_by_endpoint_resource_maximum_set_gen.py} (86%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_patch_ssh.py => service_configurations_update_maximum_set_gen.py} (85%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_types_get.py => solution_types_get_maximum_set_gen.py} (85%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_types_list_by_resource_group.py => solution_types_list_by_resource_group_maximum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_types_list_by_subscription.py => solution_types_list_by_subscription_maximum_set_gen.py} (89%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md index 564f71ffd601..1ab99dd8e0f7 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md @@ -1,5 +1,80 @@ # Release History +## 2.0.0 (2026-08-21) + +### Features Added + + - Client `HybridConnectivityMgmtClient` added parameter `cloud_setting` in method `__init__` + - Client `HybridConnectivityMgmtClient` added parameter `polling_interval` in method `__init__` + - Client `HybridConnectivityMgmtClient` added method `send_request` + - Client `HybridConnectivityMgmtClient` added operation group `generate_aws_template` + - Client `HybridConnectivityMgmtClient` added operation group `generate_gcp_template` + - Client `HybridConnectivityMgmtClient` added operation group `inventory` + - Client `HybridConnectivityMgmtClient` added operation group `public_cloud_connectors` + - Client `HybridConnectivityMgmtClient` added operation group `solution_configurations` + - Client `HybridConnectivityMgmtClient` added operation group `solution_types` + - Added model `AwsCloudProfile` + - Added model `AwsCloudProfileUpdate` + - Added enum `CloudNativeType` + - Added model `ExtensionResource` + - Added model `GcpCloudProfile` + - Added model `GcpCloudProfileUpdate` + - Added model `GcpOrganizationProperties` + - Added model `GcpOrganizationPropertiesUpdate` + - Added model `GcpProjectProperties` + - Added enum `GcpTemplateFormat` + - Added model `GenerateAwsTemplateRequest` + - Added model `GenerateAwsTemplateResponse` + - Added model `GenerateGcpTemplateRequest` + - Added model `GenerateGcpTemplateResponse` + - Added enum `HostType` + - Added model `InventoryProperties` + - Added model `InventoryResource` + - Added model `OperationStatusResult` + - Added model `PublicCloudConnector` + - Added model `PublicCloudConnectorProperties` + - Added model `PublicCloudConnectorPropertiesUpdate` + - Added model `PublicCloudConnectorUpdate` + - Added enum `ResourceProvisioningState` + - Added model `SolutionConfiguration` + - Added model `SolutionConfigurationProperties` + - Added model `SolutionConfigurationPropertiesUpdate` + - Added enum `SolutionConfigurationStatus` + - Added model `SolutionConfigurationUpdate` + - Added model `SolutionSettings` + - Added model `SolutionTypeProperties` + - Added model `SolutionTypeResource` + - Added model `SolutionTypeSettings` + - Added model `SolutionTypeSettingsProperties` + - Added model `TrackedResource` + - Added model `TrackedResourceUpdate` + - Added operation group `GenerateAwsTemplateOperations` + - Added operation group `GenerateGcpTemplateOperations` + - Added operation group `InventoryOperations` + - Added operation group `PublicCloudConnectorsOperations` + - Added operation group `SolutionConfigurationsOperations` + - Added operation group `SolutionTypesOperations` + +### Breaking Changes + + - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. + - For the method breakings, please refer to https://aka.ms/azsdk/python/migrate/operations for migration. + - Method `HybridConnectivityMgmtClient.__init__` inserted a `positional_or_keyword` parameter `subscription_id` + - Model `EndpointAccessResource` moved instance variable `access_key`, `expires_on`, `hybrid_connection_name`, `namespace_name`, `namespace_name_suffix` and `service_configuration_token` under property `relay` whose type is `RelayNamespaceAccessProperties` + - Model `IngressGatewayResource` moved instance variable `access_key`, `expires_on`, `hybrid_connection_name`, `namespace_name`, `namespace_name_suffix` and `service_configuration_token` under property `relay` whose type is `RelayNamespaceAccessProperties` + - Model `IngressGatewayResource` moved instance variable `hostname` under property `ingress` whose type is `IngressProfileProperties` + - Model `IngressGatewayResource` moved instance variable `server_id` and `tenant_id` under property `ingress.aad_profile` whose type is `AADProfileProperties` + - Model `ServiceConfigurationResource` moved instance variable `port`, `provisioning_state`, `resource_id` and `service_name` under property `properties` whose type is `ServiceConfigurationProperties` + - Model `ServiceConfigurationResourcePatch` moved instance variable `port` under property `properties` whose type is `ServiceConfigurationPropertiesPatch` + - Parameter `expiresin` of `EndpointsOperations.list_credentials` is now optional + - Method `EndpointsOperations.list_credentials` changed its parameter `expiresin` from `positional_or_keyword` to `keyword_only` + - Parameter `expiresin` of `EndpointsOperations.list_ingress_gateway_credentials` is now optional + - Method `EndpointsOperations.list_ingress_gateway_credentials` changed its parameter `expiresin` from `positional_or_keyword` to `keyword_only` + +### Other Changes + + - Deleted model `EndpointsList`/`OperationListResult`/`ServiceConfigurationList` which actually were not used by SDK users + ## 2.0.0b1 (2025-04-01) ### Features Added diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in index 0566f13973fc..46cd474ba840 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/hybridconnectivity/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md index d4fa95905534..c747b61b5618 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Hybridconnectivity Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json deleted file mode 100644 index 4c9201fb5386..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "commit": "3db6867b8e524ea6d1bc7a3bbb989fe50dd2f184", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/hybridconnectivity/HybridConnectivity.Management", - "@azure-tools/typespec-python": "0.41.0" -} \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json new file mode 100644 index 000000000000..8f7f7896113c --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json @@ -0,0 +1,11 @@ +{ + "apiVersion": "2027-01-01", + "apiVersions": { + "Microsoft.HybridConnectivity": "2027-01-01" + }, + "commit": "47515ad36204e02e14c3b62414beebca92abb4a2", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/hybridconnectivity/HybridConnectivity.Management", + "emitterVersion": "0.63.5", + "httpClientPythonVersion": "^0.36.0" +} \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md new file mode 100644 index 000000000000..a4c3e5505cca --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md @@ -0,0 +1,2676 @@ +```py +namespace azure.mgmt.hybridconnectivity + + class azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient: implements ContextManager + endpoints: EndpointsOperations + generate_aws_template: GenerateAwsTemplateOperations + generate_gcp_template: GenerateGcpTemplateOperations + inventory: InventoryOperations + operations: Operations + public_cloud_connectors: PublicCloudConnectorsOperations + service_configurations: ServiceConfigurationsOperations + solution_configurations: SolutionConfigurationsOperations + solution_types: SolutionTypesOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.hybridconnectivity.aio + + class azure.mgmt.hybridconnectivity.aio.HybridConnectivityMgmtClient: implements AsyncContextManager + endpoints: EndpointsOperations + generate_aws_template: GenerateAwsTemplateOperations + generate_gcp_template: GenerateGcpTemplateOperations + inventory: InventoryOperations + operations: Operations + public_cloud_connectors: PublicCloudConnectorsOperations + service_configurations: ServiceConfigurationsOperations + solution_configurations: SolutionConfigurationsOperations + solution_types: SolutionTypesOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.hybridconnectivity.aio.operations + + class azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace_async + async def delete( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> AsyncItemPaged[EndpointResource]: ... + + @overload + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + async def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + async def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + async def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + async def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + async def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + async def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.GenerateAwsTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + async def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + async def post( + self, + generate_aws_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.GenerateGcpTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + async def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + async def post( + self, + generate_gcp_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.InventoryOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + solution_configuration: str, + inventory_id: str, + **kwargs: Any + ) -> InventoryResource: ... + + @distributed_trace + def list_by_solution_configuration( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> AsyncItemPaged[InventoryResource]: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PublicCloudConnector]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PublicCloudConnector]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PublicCloudConnector]: ... + + @distributed_trace_async + async def begin_test_permissions( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> AsyncLROPoller[OperationStatusResult]: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> PublicCloudConnector: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PublicCloudConnector]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[PublicCloudConnector]: ... + + @overload + async def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + async def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + async def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace_async + async def delete( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace + def list_by_endpoint_resource( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ServiceConfigurationResource]: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_sync_now( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> AsyncLROPoller[OperationStatusResult]: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace_async + async def delete( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> AsyncItemPaged[SolutionConfiguration]: ... + + @overload + async def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def update( + self, + resource_uri: str, + solution_configuration: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + solution_type: str, + **kwargs: Any + ) -> SolutionTypeResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SolutionTypeResource]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[SolutionTypeResource]: ... + + +namespace azure.mgmt.hybridconnectivity.models + + class azure.mgmt.hybridconnectivity.models.AADProfileProperties(_Model): + server_id: str + tenant_id: str + + @overload + def __init__( + self, + *, + server_id: str, + tenant_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.hybridconnectivity.models.AwsCloudProfile(_Model): + account_id: str + excluded_accounts: Optional[list[str]] + is_organizational_account: Optional[bool] + + @overload + def __init__( + self, + *, + account_id: str, + excluded_accounts: Optional[list[str]] = ..., + is_organizational_account: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.AwsCloudProfileUpdate(_Model): + excluded_accounts: Optional[list[str]] + + @overload + def __init__( + self, + *, + excluded_accounts: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.CloudNativeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EC2 = "ec2" + + + class azure.mgmt.hybridconnectivity.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.hybridconnectivity.models.EndpointAccessResource(_Model): + relay: Optional[RelayNamespaceAccessProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + relay: Optional[RelayNamespaceAccessProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.EndpointProperties(_Model): + provisioning_state: Optional[str] + resource_id: Optional[str] + type: Union[str, Type] + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = ..., + type: Union[str, Type] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.EndpointResource(ExtensionResource): + id: str + name: str + properties: Optional[EndpointProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[EndpointProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ExtensionResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.models.GcpCloudProfile(_Model): + organization_properties: Optional[GcpOrganizationProperties] + project_properties: Optional[GcpProjectProperties] + + @overload + def __init__( + self, + *, + organization_properties: Optional[GcpOrganizationProperties] = ..., + project_properties: Optional[GcpProjectProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpCloudProfileUpdate(_Model): + organization_properties: Optional[GcpOrganizationPropertiesUpdate] + + @overload + def __init__( + self, + *, + organization_properties: Optional[GcpOrganizationPropertiesUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpOrganizationProperties(_Model): + excluded_folder_ids: Optional[list[str]] + excluded_project_numbers: Optional[list[str]] + management_project_id: str + management_project_number: str + organization_id: str + + @overload + def __init__( + self, + *, + excluded_folder_ids: Optional[list[str]] = ..., + excluded_project_numbers: Optional[list[str]] = ..., + management_project_id: str, + management_project_number: str, + organization_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpOrganizationPropertiesUpdate(_Model): + excluded_folder_ids: Optional[list[str]] + excluded_project_numbers: Optional[list[str]] + + @overload + def __init__( + self, + *, + excluded_folder_ids: Optional[list[str]] = ..., + excluded_project_numbers: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpProjectProperties(_Model): + project_id: str + project_number: str + + @overload + def __init__( + self, + *, + project_id: str, + project_number: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpTemplateFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SHELL_SCRIPT = "shellscript" + TERRAFORM = "terraform" + + + class azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest(_Model): + connector_id: str + solution_types: Optional[list[SolutionTypeSettings]] + + @overload + def __init__( + self, + *, + connector_id: str, + solution_types: Optional[list[SolutionTypeSettings]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse(_Model): + + + class azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest(_Model): + connector_id: str + gcp_cloud_profile: Optional[GcpCloudProfile] + gcp_template_format: Optional[Union[str, GcpTemplateFormat]] + solution_types: Optional[list[SolutionTypeSettings]] + + @overload + def __init__( + self, + *, + connector_id: str, + gcp_cloud_profile: Optional[GcpCloudProfile] = ..., + gcp_template_format: Optional[Union[str, GcpTemplateFormat]] = ..., + solution_types: Optional[list[SolutionTypeSettings]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse(_Model): + + + class azure.mgmt.hybridconnectivity.models.HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AWS = "AWS" + GCP = "GCP" + + + class azure.mgmt.hybridconnectivity.models.IngressGatewayResource(_Model): + ingress: Optional[IngressProfileProperties] + relay: Optional[RelayNamespaceAccessProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + ingress: Optional[IngressProfileProperties] = ..., + relay: Optional[RelayNamespaceAccessProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.IngressProfileProperties(_Model): + aad_profile: AADProfileProperties + hostname: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + aad_profile: AADProfileProperties, + hostname: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.InventoryProperties(_Model): + azure_resource_id: Optional[str] + cloud_native_resource_id: Optional[str] + cloud_native_type: Optional[Union[str, CloudNativeType]] + provisioning_state: Optional[Union[str, ResourceProvisioningState]] + status: Optional[Union[str, SolutionConfigurationStatus]] + status_details: Optional[str] + + @overload + def __init__( + self, + *, + azure_resource_id: Optional[str] = ..., + cloud_native_resource_id: Optional[str] = ..., + cloud_native_type: Optional[Union[str, CloudNativeType]] = ..., + status: Optional[Union[str, SolutionConfigurationStatus]] = ..., + status_details: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.InventoryResource(ProxyResource): + id: str + name: str + properties: Optional[InventoryProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[InventoryProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ListCredentialsRequest(_Model): + service_name: Optional[Union[str, ServiceName]] + + @overload + def __init__( + self, + *, + service_name: Optional[Union[str, ServiceName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest(_Model): + service_name: Optional[Union[str, ServiceName]] + + @overload + def __init__( + self, + *, + service_name: Optional[Union[str, ServiceName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ManagedProxyRequest(_Model): + hostname: Optional[str] + service: str + service_name: Optional[Union[str, ServiceName]] + + @overload + def __init__( + self, + *, + hostname: Optional[str] = ..., + service: str, + service_name: Optional[Union[str, ServiceName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ManagedProxyResource(_Model): + expires_on: int + proxy: str + + @overload + def __init__( + self, + *, + expires_on: int, + proxy: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.OperationStatusResult(_Model): + end_time: Optional[datetime] + error: Optional[ErrorDetail] + id: Optional[str] + name: Optional[str] + operations: Optional[list[OperationStatusResult]] + percent_complete: Optional[float] + resource_id: Optional[str] + start_time: Optional[datetime] + status: str + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + error: Optional[ErrorDetail] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + operations: Optional[list[OperationStatusResult]] = ..., + percent_complete: Optional[float] = ..., + start_time: Optional[datetime] = ..., + status: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.hybridconnectivity.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CREATING = "Creating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.hybridconnectivity.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnector(TrackedResource): + id: str + kind: Optional[Union[str, HostType]] + location: str + name: str + properties: Optional[PublicCloudConnectorProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[PublicCloudConnectorProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnectorProperties(_Model): + aws_cloud_profile: Optional[AwsCloudProfile] + connector_primary_identifier: Optional[str] + gcp_cloud_profile: Optional[GcpCloudProfile] + host_type: Union[str, HostType] + provisioning_state: Optional[Union[str, ResourceProvisioningState]] + + @overload + def __init__( + self, + *, + aws_cloud_profile: Optional[AwsCloudProfile] = ..., + gcp_cloud_profile: Optional[GcpCloudProfile] = ..., + host_type: Union[str, HostType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnectorPropertiesUpdate(_Model): + aws_cloud_profile: Optional[AwsCloudProfileUpdate] + gcp_cloud_profile: Optional[GcpCloudProfileUpdate] + + @overload + def __init__( + self, + *, + aws_cloud_profile: Optional[AwsCloudProfileUpdate] = ..., + gcp_cloud_profile: Optional[GcpCloudProfileUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate(TrackedResourceUpdate): + id: str + name: str + properties: Optional[PublicCloudConnectorPropertiesUpdate] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PublicCloudConnectorPropertiesUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.RelayNamespaceAccessProperties(_Model): + access_key: Optional[str] + expires_on: Optional[int] + hybrid_connection_name: str + namespace_name: str + namespace_name_suffix: str + service_configuration_token: Optional[str] + + @overload + def __init__( + self, + *, + expires_on: Optional[int] = ..., + hybrid_connection_name: str, + namespace_name: str, + namespace_name_suffix: str, + service_configuration_token: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.ResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationProperties(_Model): + port: Optional[int] + provisioning_state: Optional[Union[str, ProvisioningState]] + resource_id: Optional[str] + service_name: Union[str, ServiceName] + + @overload + def __init__( + self, + *, + port: Optional[int] = ..., + resource_id: Optional[str] = ..., + service_name: Union[str, ServiceName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationPropertiesPatch(_Model): + port: Optional[int] + + @overload + def __init__( + self, + *, + port: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource(ExtensionResource): + id: str + name: str + properties: Optional[ServiceConfigurationProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ServiceConfigurationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch(_Model): + properties: Optional[ServiceConfigurationPropertiesPatch] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ServiceConfigurationPropertiesPatch] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SSH = "SSH" + WAC = "WAC" + + + class azure.mgmt.hybridconnectivity.models.SolutionConfiguration(ExtensionResource): + id: str + name: str + properties: Optional[SolutionConfigurationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SolutionConfigurationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationProperties(_Model): + last_sync_time: Optional[datetime] + provisioning_state: Optional[Union[str, ResourceProvisioningState]] + solution_settings: Optional[SolutionSettings] + solution_type: str + status: Optional[Union[str, SolutionConfigurationStatus]] + status_details: Optional[str] + + @overload + def __init__( + self, + *, + solution_settings: Optional[SolutionSettings] = ..., + solution_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationPropertiesUpdate(_Model): + solution_settings: Optional[SolutionSettings] + solution_type: Optional[str] + + @overload + def __init__( + self, + *, + solution_settings: Optional[SolutionSettings] = ..., + solution_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NEW = "New" + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate(ProxyResource): + id: str + name: str + properties: Optional[SolutionConfigurationPropertiesUpdate] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SolutionConfigurationPropertiesUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionSettings(_Model): + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeProperties(_Model): + description: Optional[str] + host_types: Optional[list[Union[str, HostType]]] + solution_settings: Optional[list[SolutionTypeSettingsProperties]] + solution_type: Optional[str] + supported_azure_regions: Optional[list[str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + host_types: Optional[list[Union[str, HostType]]] = ..., + solution_settings: Optional[list[SolutionTypeSettingsProperties]] = ..., + solution_type: Optional[str] = ..., + supported_azure_regions: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeResource(ProxyResource): + id: str + name: str + properties: Optional[SolutionTypeProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SolutionTypeProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeSettings(_Model): + solution_settings: Optional[SolutionSettings] + solution_type: str + + @overload + def __init__( + self, + *, + solution_settings: Optional[SolutionSettings] = ..., + solution_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeSettingsProperties(_Model): + allowed_values: list[str] + default_value: str + description: str + display_name: str + host_types: list[Union[str, HostType]] + name: str + type: str + + @overload + def __init__( + self, + *, + allowed_values: list[str], + default_value: str, + description: str, + display_name: str, + host_types: list[Union[str, HostType]], + name: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.TrackedResourceUpdate(Resource): + id: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + DEFAULT = "default" + + +namespace azure.mgmt.hybridconnectivity.operations + + class azure.mgmt.hybridconnectivity.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace + def delete( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> ItemPaged[EndpointResource]: ... + + @overload + def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + + class azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + def post( + self, + generate_aws_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.operations.GenerateGcpTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + def post( + self, + generate_gcp_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.operations.InventoryOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + solution_configuration: str, + inventory_id: str, + **kwargs: Any + ) -> InventoryResource: ... + + @distributed_trace + def list_by_solution_configuration( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> ItemPaged[InventoryResource]: ... + + + class azure.mgmt.hybridconnectivity.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PublicCloudConnector]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PublicCloudConnector]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PublicCloudConnector]: ... + + @distributed_trace + def begin_test_permissions( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> LROPoller[OperationStatusResult]: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> PublicCloudConnector: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[PublicCloudConnector]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[PublicCloudConnector]: ... + + @overload + def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + + class azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace + def delete( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace + def list_by_endpoint_resource( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> ItemPaged[ServiceConfigurationResource]: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + + class azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_sync_now( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> LROPoller[OperationStatusResult]: ... + + @overload + def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace + def delete( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> ItemPaged[SolutionConfiguration]: ... + + @overload + def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def update( + self, + resource_uri: str, + solution_configuration: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + + class azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + solution_type: str, + **kwargs: Any + ) -> SolutionTypeResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SolutionTypeResource]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[SolutionTypeResource]: ... + + +namespace azure.mgmt.hybridconnectivity.types + + class azure.mgmt.hybridconnectivity.types.AwsCloudProfile(TypedDict, total=False): + key "accountId": Required[str] + key "isOrganizationalAccount": bool + accountId: str + excludedAccounts: list[str] + isOrganizationalAccount: bool + + + class azure.mgmt.hybridconnectivity.types.AwsCloudProfileUpdate(TypedDict, total=False): + excludedAccounts: list[str] + + + class azure.mgmt.hybridconnectivity.types.EndpointProperties(TypedDict, total=False): + key "provisioningState": str + key "resourceId": str + key "type": Required[Union[str, Type]] + provisioningState: str + resourceId: str + type: Union[str, Type] + + + class azure.mgmt.hybridconnectivity.types.EndpointResource(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('EndpointProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: EndpointProperties + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.ExtensionResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.GcpCloudProfile(TypedDict, total=False): + key "organizationProperties": ForwardRef('GcpOrganizationProperties', module='types') + key "projectProperties": ForwardRef('GcpProjectProperties', module='types') + organizationProperties: GcpOrganizationProperties + projectProperties: GcpProjectProperties + + + class azure.mgmt.hybridconnectivity.types.GcpCloudProfileUpdate(TypedDict, total=False): + key "organizationProperties": ForwardRef('GcpOrganizationPropertiesUpdate', module='types') + organizationProperties: GcpOrganizationPropertiesUpdate + + + class azure.mgmt.hybridconnectivity.types.GcpOrganizationProperties(TypedDict, total=False): + key "managementProjectId": Required[str] + key "managementProjectNumber": Required[str] + key "organizationId": Required[str] + excludedFolderIds: list[str] + excludedProjectNumbers: list[str] + managementProjectId: str + managementProjectNumber: str + organizationId: str + + + class azure.mgmt.hybridconnectivity.types.GcpOrganizationPropertiesUpdate(TypedDict, total=False): + excludedFolderIds: list[str] + excludedProjectNumbers: list[str] + + + class azure.mgmt.hybridconnectivity.types.GcpProjectProperties(TypedDict, total=False): + key "projectId": Required[str] + key "projectNumber": Required[str] + projectId: str + projectNumber: str + + + class azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest(TypedDict, total=False): + key "connectorId": Required[str] + connectorId: str + solutionTypes: list[SolutionTypeSettings] + + + class azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest(TypedDict, total=False): + key "connectorId": Required[str] + key "gcpCloudProfile": ForwardRef('GcpCloudProfile', module='types') + key "gcpTemplateFormat": Union[str, GcpTemplateFormat] + connectorId: str + gcpCloudProfile: GcpCloudProfile + gcpTemplateFormat: Union[str, GcpTemplateFormat] + solutionTypes: list[SolutionTypeSettings] + + + class azure.mgmt.hybridconnectivity.types.ListCredentialsRequest(TypedDict, total=False): + key "serviceName": Union[str, ServiceName] + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest(TypedDict, total=False): + key "serviceName": Union[str, ServiceName] + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ManagedProxyRequest(TypedDict, total=False): + key "hostname": str + key "service": Required[str] + key "serviceName": Union[str, ServiceName] + hostname: str + service: str + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnector(TrackedResource): + key "id": str + key "kind": Union[str, HostType] + key "location": Required[str] + key "name": str + key "properties": ForwardRef('PublicCloudConnectorProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + kind: Union[str, HostType] + location: str + name: str + properties: PublicCloudConnectorProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnectorProperties(TypedDict, total=False): + key "awsCloudProfile": ForwardRef('AwsCloudProfile', module='types') + key "connectorPrimaryIdentifier": str + key "gcpCloudProfile": ForwardRef('GcpCloudProfile', module='types') + key "hostType": Required[Union[str, HostType]] + key "provisioningState": Union[str, ResourceProvisioningState] + awsCloudProfile: AwsCloudProfile + connectorPrimaryIdentifier: str + gcpCloudProfile: GcpCloudProfile + hostType: Union[str, HostType] + provisioningState: Union[str, ResourceProvisioningState] + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnectorPropertiesUpdate(TypedDict, total=False): + key "awsCloudProfile": ForwardRef('AwsCloudProfileUpdate', module='types') + key "gcpCloudProfile": ForwardRef('GcpCloudProfileUpdate', module='types') + awsCloudProfile: AwsCloudProfileUpdate + gcpCloudProfile: GcpCloudProfileUpdate + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate(TrackedResourceUpdate): + key "id": str + key "name": str + key "properties": ForwardRef('PublicCloudConnectorPropertiesUpdate', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PublicCloudConnectorPropertiesUpdate + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridconnectivity.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationProperties(TypedDict, total=False): + key "port": int + key "provisioningState": Union[str, ProvisioningState] + key "resourceId": str + key "serviceName": Required[Union[str, ServiceName]] + port: int + provisioningState: Union[str, ProvisioningState] + resourceId: str + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationPropertiesPatch(TypedDict, total=False): + key "port": int + port: int + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('ServiceConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ServiceConfigurationProperties + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch(TypedDict, total=False): + key "properties": ForwardRef('ServiceConfigurationPropertiesPatch', module='types') + properties: ServiceConfigurationPropertiesPatch + + + class azure.mgmt.hybridconnectivity.types.SolutionConfiguration(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('SolutionConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SolutionConfigurationProperties + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.SolutionConfigurationProperties(TypedDict, total=False): + key "lastSyncTime": str + key "provisioningState": Union[str, ResourceProvisioningState] + key "solutionSettings": ForwardRef('SolutionSettings', module='types') + key "solutionType": Required[str] + key "status": Union[str, SolutionConfigurationStatus] + key "statusDetails": str + lastSyncTime: str + provisioningState: Union[str, ResourceProvisioningState] + solutionSettings: SolutionSettings + solutionType: str + status: Union[str, SolutionConfigurationStatus] + statusDetails: str + + + class azure.mgmt.hybridconnectivity.types.SolutionConfigurationPropertiesUpdate(TypedDict, total=False): + key "solutionSettings": ForwardRef('SolutionSettings', module='types') + key "solutionType": str + solutionSettings: SolutionSettings + solutionType: str + + + class azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('SolutionConfigurationPropertiesUpdate', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SolutionConfigurationPropertiesUpdate + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.SolutionSettings(TypedDict, total=False): + + + class azure.mgmt.hybridconnectivity.types.SolutionTypeSettings(TypedDict, total=False): + key "solutionSettings": ForwardRef('SolutionSettings', module='types') + key "solutionType": Required[str] + solutionSettings: SolutionSettings + solutionType: str + + + class azure.mgmt.hybridconnectivity.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.hybridconnectivity.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridconnectivity.types.TrackedResourceUpdate(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + +``` \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml new file mode 100644 index 000000000000..25ff1dba12ee --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 7dfe49671bef44128b7d80b2c254bea5f44a4c87b9bbeadd9cad045e5024cd5e +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json index 09df4dd2b8b9..a94afebd39aa 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json @@ -12,7 +12,15 @@ "azure.mgmt.hybridconnectivity.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.hybridconnectivity.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.hybridconnectivity.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.hybridconnectivity.models.GcpCloudProfile": "Microsoft.HybridConnectivity.GcpCloudProfile", + "azure.mgmt.hybridconnectivity.models.GcpCloudProfileUpdate": "Microsoft.HybridConnectivity.GcpCloudProfileUpdate", + "azure.mgmt.hybridconnectivity.models.GcpOrganizationProperties": "Microsoft.HybridConnectivity.GcpOrganizationProperties", + "azure.mgmt.hybridconnectivity.models.GcpOrganizationPropertiesUpdate": "Microsoft.HybridConnectivity.GcpOrganizationPropertiesUpdate", + "azure.mgmt.hybridconnectivity.models.GcpProjectProperties": "Microsoft.HybridConnectivity.GcpProjectProperties", "azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest": "Microsoft.HybridConnectivity.GenerateAwsTemplateRequest", + "azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse": "Microsoft.HybridConnectivity.GenerateAwsTemplateResponse", + "azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest": "Microsoft.HybridConnectivity.GenerateGcpTemplateRequest", + "azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse": "Microsoft.HybridConnectivity.GenerateGcpTemplateResponse", "azure.mgmt.hybridconnectivity.models.IngressGatewayResource": "Microsoft.HybridConnectivity.IngressGatewayResource", "azure.mgmt.hybridconnectivity.models.IngressProfileProperties": "Microsoft.HybridConnectivity.IngressProfileProperties", "azure.mgmt.hybridconnectivity.models.InventoryProperties": "Microsoft.HybridConnectivity.InventoryProperties", @@ -52,42 +60,79 @@ "azure.mgmt.hybridconnectivity.models.Type": "Microsoft.HybridConnectivity.Type", "azure.mgmt.hybridconnectivity.models.ServiceName": "Microsoft.HybridConnectivity.ServiceName", "azure.mgmt.hybridconnectivity.models.ProvisioningState": "Microsoft.HybridConnectivity.ProvisioningState", + "azure.mgmt.hybridconnectivity.models.GcpTemplateFormat": "Microsoft.HybridConnectivity.GcpTemplateFormat", "azure.mgmt.hybridconnectivity.models.HostType": "Microsoft.HybridConnectivity.HostType", "azure.mgmt.hybridconnectivity.models.ResourceProvisioningState": "Azure.ResourceManager.ResourceProvisioningState", "azure.mgmt.hybridconnectivity.models.SolutionConfigurationStatus": "Microsoft.HybridConnectivity.SolutionConfigurationStatus", "azure.mgmt.hybridconnectivity.models.CloudNativeType": "Microsoft.HybridConnectivity.CloudNativeType", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.get": "Microsoft.HybridConnectivity.EndpointResources.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.create_or_update": "Microsoft.HybridConnectivity.EndpointResources.createOrUpdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.update": "Microsoft.HybridConnectivity.EndpointResources.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.delete": "Microsoft.HybridConnectivity.EndpointResources.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list": "Microsoft.HybridConnectivity.EndpointResources.list", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list_credentials": "Microsoft.HybridConnectivity.EndpointResources.listCredentials", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list_ingress_gateway_credentials": "Microsoft.HybridConnectivity.EndpointResources.listIngressGatewayCredentials", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list_managed_proxy_details": "Microsoft.HybridConnectivity.EndpointResources.listManagedProxyDetails", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.get": "Microsoft.HybridConnectivity.ServiceConfigurationResources.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.create_orupdate": "Microsoft.HybridConnectivity.ServiceConfigurationResources.createOrupdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.update": "Microsoft.HybridConnectivity.ServiceConfigurationResources.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.delete": "Microsoft.HybridConnectivity.ServiceConfigurationResources.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.list_by_endpoint_resource": "Microsoft.HybridConnectivity.ServiceConfigurationResources.listByEndpointResource", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.generate_aws_template.post": "Microsoft.HybridConnectivity.GenerateAwsTemplate.post", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.get": "Microsoft.HybridConnectivity.PublicCloudConnectors.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.begin_create_or_update": "Microsoft.HybridConnectivity.PublicCloudConnectors.createOrUpdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.update": "Microsoft.HybridConnectivity.PublicCloudConnectors.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.delete": "Microsoft.HybridConnectivity.PublicCloudConnectors.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.list_by_resource_group": "Microsoft.HybridConnectivity.PublicCloudConnectors.listByResourceGroup", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.list_by_subscription": "Microsoft.HybridConnectivity.PublicCloudConnectors.listBySubscription", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.begin_test_permissions": "Microsoft.HybridConnectivity.PublicCloudConnectors.testPermissions", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.get": "Microsoft.HybridConnectivity.SolutionConfigurations.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.create_or_update": "Microsoft.HybridConnectivity.SolutionConfigurations.createOrUpdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.update": "Microsoft.HybridConnectivity.SolutionConfigurations.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.delete": "Microsoft.HybridConnectivity.SolutionConfigurations.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.list": "Microsoft.HybridConnectivity.SolutionConfigurations.list", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.begin_sync_now": "Microsoft.HybridConnectivity.SolutionConfigurations.syncNow", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.inventory.get": "Microsoft.HybridConnectivity.Inventory.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.inventory.list_by_solution_configuration": "Microsoft.HybridConnectivity.Inventory.listBySolutionConfiguration", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_types.get": "Microsoft.HybridConnectivity.SolutionTypes.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_types.list_by_resource_group": "Microsoft.HybridConnectivity.SolutionTypes.listByResourceGroup", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_types.list_by_subscription": "Microsoft.HybridConnectivity.SolutionTypes.listBySubscription" - } + "azure.mgmt.hybridconnectivity.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.hybridconnectivity.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.get": "Microsoft.HybridConnectivity.EndpointResources.get", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.get": "Microsoft.HybridConnectivity.EndpointResources.get", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.create_or_update": "Microsoft.HybridConnectivity.EndpointResources.createOrUpdate", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.create_or_update": "Microsoft.HybridConnectivity.EndpointResources.createOrUpdate", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.update": "Microsoft.HybridConnectivity.EndpointResources.update", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.update": "Microsoft.HybridConnectivity.EndpointResources.update", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.delete": "Microsoft.HybridConnectivity.EndpointResources.delete", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.delete": "Microsoft.HybridConnectivity.EndpointResources.delete", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list": "Microsoft.HybridConnectivity.EndpointResources.list", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list": "Microsoft.HybridConnectivity.EndpointResources.list", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list_credentials": "Microsoft.HybridConnectivity.EndpointResources.listCredentials", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list_credentials": "Microsoft.HybridConnectivity.EndpointResources.listCredentials", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list_ingress_gateway_credentials": "Microsoft.HybridConnectivity.EndpointResources.listIngressGatewayCredentials", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list_ingress_gateway_credentials": "Microsoft.HybridConnectivity.EndpointResources.listIngressGatewayCredentials", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list_managed_proxy_details": "Microsoft.HybridConnectivity.EndpointResources.listManagedProxyDetails", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list_managed_proxy_details": "Microsoft.HybridConnectivity.EndpointResources.listManagedProxyDetails", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.get": "Microsoft.HybridConnectivity.ServiceConfigurationResources.get", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.get": "Microsoft.HybridConnectivity.ServiceConfigurationResources.get", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.create_orupdate": "Microsoft.HybridConnectivity.ServiceConfigurationResources.createOrupdate", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.create_orupdate": "Microsoft.HybridConnectivity.ServiceConfigurationResources.createOrupdate", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.update": "Microsoft.HybridConnectivity.ServiceConfigurationResources.update", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.update": "Microsoft.HybridConnectivity.ServiceConfigurationResources.update", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.delete": "Microsoft.HybridConnectivity.ServiceConfigurationResources.delete", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.delete": "Microsoft.HybridConnectivity.ServiceConfigurationResources.delete", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.list_by_endpoint_resource": "Microsoft.HybridConnectivity.ServiceConfigurationResources.listByEndpointResource", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.list_by_endpoint_resource": "Microsoft.HybridConnectivity.ServiceConfigurationResources.listByEndpointResource", + "azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateAwsTemplate.post", + "azure.mgmt.hybridconnectivity.aio.operations.GenerateAwsTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateAwsTemplate.post", + "azure.mgmt.hybridconnectivity.operations.GenerateGcpTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateGcpTemplate.post", + "azure.mgmt.hybridconnectivity.aio.operations.GenerateGcpTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateGcpTemplate.post", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.get": "Microsoft.HybridConnectivity.PublicCloudConnectors.get", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.get": "Microsoft.HybridConnectivity.PublicCloudConnectors.get", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.begin_create_or_update": "Microsoft.HybridConnectivity.PublicCloudConnectors.createOrUpdate", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.begin_create_or_update": "Microsoft.HybridConnectivity.PublicCloudConnectors.createOrUpdate", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.update": "Microsoft.HybridConnectivity.PublicCloudConnectors.update", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.update": "Microsoft.HybridConnectivity.PublicCloudConnectors.update", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.delete": "Microsoft.HybridConnectivity.PublicCloudConnectors.delete", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.delete": "Microsoft.HybridConnectivity.PublicCloudConnectors.delete", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.list_by_resource_group": "Microsoft.HybridConnectivity.PublicCloudConnectors.listByResourceGroup", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.list_by_resource_group": "Microsoft.HybridConnectivity.PublicCloudConnectors.listByResourceGroup", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.list_by_subscription": "Microsoft.HybridConnectivity.PublicCloudConnectors.listBySubscription", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.list_by_subscription": "Microsoft.HybridConnectivity.PublicCloudConnectors.listBySubscription", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.begin_test_permissions": "Microsoft.HybridConnectivity.PublicCloudConnectors.testPermissions", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.begin_test_permissions": "Microsoft.HybridConnectivity.PublicCloudConnectors.testPermissions", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.get": "Microsoft.HybridConnectivity.SolutionConfigurations.get", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.get": "Microsoft.HybridConnectivity.SolutionConfigurations.get", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.create_or_update": "Microsoft.HybridConnectivity.SolutionConfigurations.createOrUpdate", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.create_or_update": "Microsoft.HybridConnectivity.SolutionConfigurations.createOrUpdate", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.update": "Microsoft.HybridConnectivity.SolutionConfigurations.update", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.update": "Microsoft.HybridConnectivity.SolutionConfigurations.update", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.delete": "Microsoft.HybridConnectivity.SolutionConfigurations.delete", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.delete": "Microsoft.HybridConnectivity.SolutionConfigurations.delete", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.list": "Microsoft.HybridConnectivity.SolutionConfigurations.list", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.list": "Microsoft.HybridConnectivity.SolutionConfigurations.list", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.begin_sync_now": "Microsoft.HybridConnectivity.SolutionConfigurations.syncNow", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.begin_sync_now": "Microsoft.HybridConnectivity.SolutionConfigurations.syncNow", + "azure.mgmt.hybridconnectivity.operations.InventoryOperations.get": "Microsoft.HybridConnectivity.Inventory.get", + "azure.mgmt.hybridconnectivity.aio.operations.InventoryOperations.get": "Microsoft.HybridConnectivity.Inventory.get", + "azure.mgmt.hybridconnectivity.operations.InventoryOperations.list_by_solution_configuration": "Microsoft.HybridConnectivity.Inventory.listBySolutionConfiguration", + "azure.mgmt.hybridconnectivity.aio.operations.InventoryOperations.list_by_solution_configuration": "Microsoft.HybridConnectivity.Inventory.listBySolutionConfiguration", + "azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations.get": "Microsoft.HybridConnectivity.SolutionTypes.get", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations.get": "Microsoft.HybridConnectivity.SolutionTypes.get", + "azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations.list_by_resource_group": "Microsoft.HybridConnectivity.SolutionTypes.listByResourceGroup", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations.list_by_resource_group": "Microsoft.HybridConnectivity.SolutionTypes.listByResourceGroup", + "azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations.list_by_subscription": "Microsoft.HybridConnectivity.SolutionTypes.listBySubscription", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations.list_by_subscription": "Microsoft.HybridConnectivity.SolutionTypes.listBySubscription" + }, + "CrossLanguageVersion": "530cfadbbd11" } \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py index 2819ae046085..814ef40c9213 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,19 +8,22 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from ._configuration import HybridConnectivityMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( EndpointsOperations, GenerateAwsTemplateOperations, + GenerateGcpTemplateOperations, InventoryOperations, Operations, PublicCloudConnectorsOperations, @@ -28,11 +32,17 @@ SolutionTypesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes +class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """REST API for public clouds. :ivar operations: Operations operations @@ -45,6 +55,9 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :ivar generate_aws_template: GenerateAwsTemplateOperations operations :vartype generate_aws_template: azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations + :ivar generate_gcp_template: GenerateGcpTemplateOperations operations + :vartype generate_gcp_template: + azure.mgmt.hybridconnectivity.operations.GenerateGcpTemplateOperations :ivar public_cloud_connectors: PublicCloudConnectorsOperations operations :vartype public_cloud_connectors: azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations @@ -59,9 +72,13 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,13 +89,26 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = HybridConnectivityMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -97,7 +127,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() @@ -110,6 +140,9 @@ def __init__( self.generate_aws_template = GenerateAwsTemplateOperations( self._client, self._config, self._serialize, self._deserialize ) + self.generate_gcp_template = GenerateGcpTemplateOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.public_cloud_connectors = PublicCloudConnectorsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py index a83b2c177790..f559a1f21986 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,10 +15,11 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for HybridConnectivityMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -29,7 +31,11 @@ class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-ins :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,9 +45,10 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-12-01") + api_version: str = kwargs.pop("api_version", "2027-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,6 +58,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-hybridconnectivity/{}".format(VERSION)) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_model_base.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/model_base.py similarity index 56% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_model_base.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/model_base.py index 3072ee252ed9..35d5fc024978 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_model_base.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/model_base.py @@ -1,9 +1,10 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=protected-access, broad-except @@ -21,17 +22,19 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET -from typing_extensions import Self +from collections.abc import MutableMapping import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self else: - from typing import MutableMapping + from typing_extensions import Self _LOGGER = logging.getLogger(__name__) @@ -39,6 +42,7 @@ TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -105,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -131,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -173,6 +208,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -204,7 +254,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - return date_obj + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -258,7 +308,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -282,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -294,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -311,12 +373,20 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -347,17 +417,47 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -374,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -398,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -407,13 +507,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -428,24 +528,24 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -454,14 +554,15 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -469,6 +570,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -485,6 +588,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -509,16 +614,14 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -537,69 +640,253 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -616,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -626,7 +1022,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -641,10 +1037,13 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -670,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -680,10 +1079,10 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -743,7 +1142,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -753,7 +1152,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -762,6 +1161,14 @@ def _deserialize_multiple_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + def _deserialize_sequence( deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], @@ -771,17 +1178,30 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -821,16 +1241,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -846,7 +1268,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -859,7 +1284,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -908,16 +1336,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -943,14 +1375,14 @@ def _deserialize( def _failsafe_deserialize( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, module: typing.Optional[str] = None, rf: typing.Optional["_RestField"] = None, format: typing.Optional[str] = None, ) -> typing.Any: try: - return _deserialize(deserializer, value, module, rf, format) - except DeserializationError: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -959,17 +1391,18 @@ def _failsafe_deserialize( def _failsafe_deserialize_xml( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, ) -> typing.Any: try: - return _deserialize_xml(deserializer, value) - except DeserializationError: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -977,11 +1410,12 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -989,14 +1423,20 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1007,14 +1447,44 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1039,11 +1509,12 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1053,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1060,8 +1532,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1077,21 +1549,77 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1113,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1125,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1139,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1146,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1155,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1171,10 +1700,11 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1182,7 +1712,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1195,9 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1208,13 +1758,15 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1227,7 +1779,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_serialization.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/serialization.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_serialization.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/serialization.py index 7a0232de5ddc..ae08f9d89f74 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_serialization.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/serialization.py @@ -1,28 +1,10 @@ # pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -49,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -59,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -247,12 +231,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -329,7 +313,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -398,7 +382,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -432,7 +416,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -496,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -536,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -546,7 +538,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -597,7 +589,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -807,7 +799,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -841,13 +833,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1118,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1202,7 +1256,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1390,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1402,9 +1460,13 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1414,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1424,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1777,7 +1860,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1803,7 +1886,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1938,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py index 0e00a6283246..8f2350dd3b0c 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0b1" +VERSION = "2.0.0" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py index 3a54c6ae3ec5..872f160e8b81 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,19 +8,22 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import HybridConnectivityMgmtClientConfiguration from .operations import ( EndpointsOperations, GenerateAwsTemplateOperations, + GenerateGcpTemplateOperations, InventoryOperations, Operations, PublicCloudConnectorsOperations, @@ -28,11 +32,17 @@ SolutionTypesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes +class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """REST API for public clouds. :ivar operations: Operations operations @@ -45,6 +55,9 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :ivar generate_aws_template: GenerateAwsTemplateOperations operations :vartype generate_aws_template: azure.mgmt.hybridconnectivity.aio.operations.GenerateAwsTemplateOperations + :ivar generate_gcp_template: GenerateGcpTemplateOperations operations + :vartype generate_gcp_template: + azure.mgmt.hybridconnectivity.aio.operations.GenerateGcpTemplateOperations :ivar public_cloud_connectors: PublicCloudConnectorsOperations operations :vartype public_cloud_connectors: azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations @@ -59,9 +72,13 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,13 +89,26 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = HybridConnectivityMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -97,7 +127,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() @@ -110,6 +142,9 @@ def __init__( self.generate_aws_template = GenerateAwsTemplateOperations( self._client, self._config, self._serialize, self._deserialize ) + self.generate_gcp_template = GenerateGcpTemplateOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.public_cloud_connectors = PublicCloudConnectorsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py index ffcaf8d0b94e..fa58783230ed 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,10 +15,11 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for HybridConnectivityMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -29,7 +31,11 @@ class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-ins :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,9 +45,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-12-01") + api_version: str = kwargs.pop("api_version", "2027-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,6 +58,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-hybridconnectivity/{}".format(VERSION)) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py index 60101daee8c0..2caf8c623231 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py @@ -16,6 +16,7 @@ from ._operations import EndpointsOperations # type: ignore from ._operations import ServiceConfigurationsOperations # type: ignore from ._operations import GenerateAwsTemplateOperations # type: ignore +from ._operations import GenerateGcpTemplateOperations # type: ignore from ._operations import PublicCloudConnectorsOperations # type: ignore from ._operations import SolutionConfigurationsOperations # type: ignore from ._operations import InventoryOperations # type: ignore @@ -30,6 +31,7 @@ "EndpointsOperations", "ServiceConfigurationsOperations", "GenerateAwsTemplateOperations", + "GenerateGcpTemplateOperations", "PublicCloudConnectorsOperations", "SolutionConfigurationsOperations", "InventoryOperations", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py index c2241ec6b3fe..e79ca21133e4 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py @@ -6,10 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -33,9 +33,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._serialization import Deserializer, Serializer +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation from ...operations._operations import ( build_endpoints_create_or_update_request, build_endpoints_delete_request, @@ -46,6 +47,7 @@ build_endpoints_list_request, build_endpoints_update_request, build_generate_aws_template_post_request, + build_generate_gcp_template_post_request, build_inventory_get_request, build_inventory_list_by_solution_configuration_request, build_operations_list_request, @@ -73,16 +75,12 @@ ) from .._configuration import HybridConnectivityMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -102,7 +100,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -149,7 +147,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -162,7 +163,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -178,7 +182,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -186,7 +193,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class EndpointsOperations: +class EndpointsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -243,6 +250,7 @@ async def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _mo } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -257,11 +265,14 @@ async def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _mo except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -302,7 +313,7 @@ async def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -315,7 +326,7 @@ async def create_or_update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -356,7 +367,7 @@ async def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Create or update the endpoint to the target resource. @@ -366,10 +377,10 @@ async def create_or_update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -409,6 +420,7 @@ async def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -423,11 +435,14 @@ async def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -468,7 +483,7 @@ async def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -481,7 +496,7 @@ async def update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -522,7 +537,7 @@ async def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Update the endpoint to the target resource. @@ -532,10 +547,10 @@ async def update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -575,6 +590,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -589,11 +605,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -649,14 +668,17 @@ async def delete(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.EndpointResource"]: + def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.EndpointResource"]: """List of endpoints to the target resource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -707,7 +729,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -720,7 +745,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EndpointResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.EndpointResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -736,7 +764,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -779,7 +810,7 @@ async def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[JSON] = None, + list_credentials_request: Optional[_types.ListCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -793,7 +824,7 @@ async def list_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_credentials_request: Object of type ListCredentialsRequest. Default value is None. - :type list_credentials_request: JSON + :type list_credentials_request: ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -841,7 +872,9 @@ async def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[Union[_models.ListCredentialsRequest, JSON, IO[bytes]]] = None, + list_credentials_request: Optional[ + Union[_models.ListCredentialsRequest, _types.ListCredentialsRequest, IO[bytes]] + ] = None, *, expiresin: Optional[int] = None, **kwargs: Any @@ -853,10 +886,10 @@ async def list_credentials( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param list_credentials_request: Object of type ListCredentialsRequest. Is one of the following - types: ListCredentialsRequest, JSON, IO[bytes] Default value is None. + :param list_credentials_request: Object of type ListCredentialsRequest. Is either a + ListCredentialsRequest type or a IO[bytes] type. Default value is None. :type list_credentials_request: ~azure.mgmt.hybridconnectivity.models.ListCredentialsRequest or - JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -876,9 +909,10 @@ async def list_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_credentials_request else None cls: ClsType[_models.EndpointAccessResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_credentials_request else None _content = None if isinstance(list_credentials_request, (IOBase, bytes)): _content = list_credentials_request @@ -903,6 +937,7 @@ async def list_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -917,11 +952,14 @@ async def list_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointAccessResource, response.json()) @@ -968,7 +1006,7 @@ async def list_ingress_gateway_credentials( self, resource_uri: str, endpoint_name: str, - list_ingress_gateway_credentials_request: Optional[JSON] = None, + list_ingress_gateway_credentials_request: Optional[_types.ListIngressGatewayCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -983,7 +1021,8 @@ async def list_ingress_gateway_credentials( :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type ListIngressGatewayCredentialsRequest. Default value is None. - :type list_ingress_gateway_credentials_request: JSON + :type list_ingress_gateway_credentials_request: + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1033,7 +1072,7 @@ async def list_ingress_gateway_credentials( resource_uri: str, endpoint_name: str, list_ingress_gateway_credentials_request: Optional[ - Union[_models.ListIngressGatewayCredentialsRequest, JSON, IO[bytes]] + Union[_models.ListIngressGatewayCredentialsRequest, _types.ListIngressGatewayCredentialsRequest, IO[bytes]] ] = None, *, expiresin: Optional[int] = None, @@ -1047,10 +1086,11 @@ async def list_ingress_gateway_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type - ListIngressGatewayCredentialsRequest. Is one of the following types: - ListIngressGatewayCredentialsRequest, JSON, IO[bytes] Default value is None. + ListIngressGatewayCredentialsRequest. Is either a ListIngressGatewayCredentialsRequest type or + a IO[bytes] type. Default value is None. :type list_ingress_gateway_credentials_request: - ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1070,9 +1110,10 @@ async def list_ingress_gateway_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_ingress_gateway_credentials_request else None cls: ClsType[_models.IngressGatewayResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_ingress_gateway_credentials_request else None _content = None if isinstance(list_ingress_gateway_credentials_request, (IOBase, bytes)): _content = list_ingress_gateway_credentials_request @@ -1097,6 +1138,7 @@ async def list_ingress_gateway_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1111,11 +1153,14 @@ async def list_ingress_gateway_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngressGatewayResource, response.json()) @@ -1156,7 +1201,7 @@ async def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: JSON, + managed_proxy_request: _types.ManagedProxyRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1169,7 +1214,7 @@ async def list_managed_proxy_details( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param managed_proxy_request: Object of type ManagedProxyRequest. Required. - :type managed_proxy_request: JSON + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1210,7 +1255,7 @@ async def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: Union[_models.ManagedProxyRequest, JSON, IO[bytes]], + managed_proxy_request: Union[_models.ManagedProxyRequest, _types.ManagedProxyRequest, IO[bytes]], **kwargs: Any ) -> _models.ManagedProxyResource: """Fetches the managed proxy details. @@ -1220,10 +1265,10 @@ async def list_managed_proxy_details( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param managed_proxy_request: Object of type ManagedProxyRequest. Is one of the following - types: ManagedProxyRequest, JSON, IO[bytes] Required. - :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or JSON - or IO[bytes] + :param managed_proxy_request: Object of type ManagedProxyRequest. Is either a + ManagedProxyRequest type or a IO[bytes] type. Required. + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or + ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest or IO[bytes] :return: ManagedProxyResource. The ManagedProxyResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ManagedProxyResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1263,6 +1308,7 @@ async def list_managed_proxy_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1277,11 +1323,14 @@ async def list_managed_proxy_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ManagedProxyResource, response.json()) @@ -1291,7 +1340,7 @@ async def list_managed_proxy_details( return deserialized # type: ignore -class ServiceConfigurationsOperations: +class ServiceConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1354,6 +1403,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1368,11 +1418,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -1419,7 +1472,7 @@ async def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResource, *, content_type: str = "application/json", **kwargs: Any @@ -1434,7 +1487,8 @@ async def create_orupdate( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1481,7 +1535,9 @@ async def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResource, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResource, _types.ServiceConfigurationResource, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Create or update a service in serviceConfiguration for the endpoint resource. @@ -1493,10 +1549,11 @@ async def create_orupdate( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResource, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResource type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -1538,6 +1595,7 @@ async def create_orupdate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1552,11 +1610,14 @@ async def create_orupdate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -1603,7 +1664,7 @@ async def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResourcePatch, *, content_type: str = "application/json", **kwargs: Any @@ -1618,7 +1679,8 @@ async def update( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1665,7 +1727,9 @@ async def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResourcePatch, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResourcePatch, _types.ServiceConfigurationResourcePatch, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Update the service details in the service configurations of the target resource. @@ -1677,10 +1741,11 @@ async def update( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResourcePatch, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResourcePatch type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -1722,6 +1787,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1736,11 +1802,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -1801,7 +1870,10 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1810,7 +1882,7 @@ async def delete( @distributed_trace def list_by_endpoint_resource( self, resource_uri: str, endpoint_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ServiceConfigurationResource"]: + ) -> AsyncItemPaged["_models.ServiceConfigurationResource"]: """Lists of all the services associated with endpoint resource. API to enumerate registered services in service configurations under a Endpoint Resource. @@ -1866,7 +1938,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1879,7 +1954,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ServiceConfigurationResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ServiceConfigurationResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1895,7 +1973,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1903,7 +1984,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GenerateAwsTemplateOperations: +class GenerateAwsTemplateOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1929,7 +2010,7 @@ async def post( *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -1939,32 +2020,39 @@ async def post( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def post( - self, generate_aws_template_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: _types.GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. Required. - :type generate_aws_template_request: JSON + :type generate_aws_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def post( self, generate_aws_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -1973,24 +2061,31 @@ async def post( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def post( - self, generate_aws_template_request: Union[_models.GenerateAwsTemplateRequest, JSON, IO[bytes]], **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: Union[ + _models.GenerateAwsTemplateRequest, _types.GenerateAwsTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to - Generate AWS CFT Template. Is one of the following types: GenerateAwsTemplateRequest, JSON, - IO[bytes] Required. + Generate AWS CFT Template. Is either a GenerateAwsTemplateRequest type or a IO[bytes] type. + Required. :type generate_aws_template_request: - ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or JSON or IO[bytes] - :return: any - :rtype: any + ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest or IO[bytes] + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2005,7 +2100,7 @@ async def post( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Any] = kwargs.pop("cls", None) + cls: ClsType[_models.GenerateAwsTemplateResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2027,6 +2122,182 @@ async def post( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GenerateAwsTemplateResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class GenerateGcpTemplateOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridconnectivity.aio.HybridConnectivityMgmtClient`'s + :attr:`generate_gcp_template` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HybridConnectivityMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def post( + self, + generate_gcp_template_request: _models.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + generate_gcp_template_request: _types.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, generate_gcp_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2027-01-01", + params_added_on={"2027-01-01": ["api_version", "subscription_id", "content_type", "accept"]}, + api_versions_list=["2027-01-01"], + ) + async def post( + self, + generate_gcp_template_request: Union[ + _models.GenerateGcpTemplateRequest, _types.GenerateGcpTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Is either a GenerateGcpTemplateRequest type or a + IO[bytes] type. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest or IO[bytes] + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateGcpTemplateResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(generate_gcp_template_request, (IOBase, bytes)): + _content = generate_gcp_template_request + else: + _content = json.dumps(generate_gcp_template_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_generate_gcp_template_post_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2041,13 +2312,16 @@ async def post( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(Any, response.json()) + deserialized = _deserialize(_models.GenerateGcpTemplateResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2055,7 +2329,7 @@ async def post( return deserialized # type: ignore -class PublicCloudConnectorsOperations: +class PublicCloudConnectorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2115,6 +2389,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2129,11 +2404,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -2146,7 +2424,7 @@ async def _create_or_update_initial( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2185,6 +2463,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2198,7 +2477,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2208,7 +2490,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2249,7 +2531,7 @@ async def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: JSON, + resource: _types.PublicCloudConnector, *, content_type: str = "application/json", **kwargs: Any @@ -2262,7 +2544,7 @@ async def begin_create_or_update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2307,7 +2589,7 @@ async def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PublicCloudConnector]: """Create a PublicCloudConnector. @@ -2317,9 +2599,10 @@ async def begin_create_or_update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param resource: Resource create parameters. Is one of the following types: - PublicCloudConnector, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a PublicCloudConnector type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector or IO[bytes] :return: An instance of AsyncLROPoller that returns PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: @@ -2410,7 +2693,7 @@ async def update( self, resource_group_name: str, public_cloud_connector: str, - properties: JSON, + properties: _types.PublicCloudConnectorUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -2423,7 +2706,7 @@ async def update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2464,7 +2747,7 @@ async def update( self, resource_group_name: str, public_cloud_connector: str, - properties: Union[_models.PublicCloudConnectorUpdate, JSON, IO[bytes]], + properties: Union[_models.PublicCloudConnectorUpdate, _types.PublicCloudConnectorUpdate, IO[bytes]], **kwargs: Any ) -> _models.PublicCloudConnector: """Update a PublicCloudConnector. @@ -2474,10 +2757,10 @@ async def update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param properties: The resource properties to be updated. Is one of the following types: - PublicCloudConnectorUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + PublicCloudConnectorUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate or IO[bytes] :return: PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector :raises ~azure.core.exceptions.HttpResponseError: @@ -2518,6 +2801,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2532,11 +2816,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -2593,7 +2880,10 @@ async def delete(self, resource_group_name: str, public_cloud_connector: str, ** if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2602,7 +2892,7 @@ async def delete(self, resource_group_name: str, public_cloud_connector: str, ** @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PublicCloudConnector"]: + ) -> AsyncItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2654,7 +2944,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2667,7 +2960,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2683,7 +2979,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2691,7 +2990,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PublicCloudConnector"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by subscription ID. :return: An iterator like instance of PublicCloudConnector @@ -2739,7 +3038,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2752,7 +3054,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2768,7 +3073,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2804,6 +3112,7 @@ async def _test_permissions_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2817,7 +3126,10 @@ async def _test_permissions_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2825,7 +3137,7 @@ async def _test_permissions_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2869,14 +3181,10 @@ async def begin_test_permissions( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -2903,7 +3211,7 @@ def get_long_running_output(pipeline_response): ) -class SolutionConfigurationsOperations: +class SolutionConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2960,6 +3268,7 @@ async def get(self, resource_uri: str, solution_configuration: str, **kwargs: An } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2974,11 +3283,14 @@ async def get(self, resource_uri: str, solution_configuration: str, **kwargs: An except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3019,7 +3331,7 @@ async def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: JSON, + resource: _types.SolutionConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -3032,7 +3344,7 @@ async def create_or_update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3073,7 +3385,7 @@ async def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: Union[_models.SolutionConfiguration, JSON, IO[bytes]], + resource: Union[_models.SolutionConfiguration, _types.SolutionConfiguration, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Create a SolutionConfiguration. @@ -3083,10 +3395,10 @@ async def create_or_update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param resource: Resource create parameters. Is one of the following types: - SolutionConfiguration, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or JSON or - IO[bytes] + :param resource: Resource create parameters. Is either a SolutionConfiguration type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or + ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -3126,6 +3438,7 @@ async def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3140,11 +3453,14 @@ async def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3185,7 +3501,7 @@ async def update( self, resource_uri: str, solution_configuration: str, - properties: JSON, + properties: _types.SolutionConfigurationUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -3198,7 +3514,7 @@ async def update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3239,7 +3555,7 @@ async def update( self, resource_uri: str, solution_configuration: str, - properties: Union[_models.SolutionConfigurationUpdate, JSON, IO[bytes]], + properties: Union[_models.SolutionConfigurationUpdate, _types.SolutionConfigurationUpdate, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Update a SolutionConfiguration. @@ -3249,10 +3565,10 @@ async def update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param properties: The resource properties to be updated. Is one of the following types: - SolutionConfigurationUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + SolutionConfigurationUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or + ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -3292,6 +3608,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3306,11 +3623,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3366,14 +3686,17 @@ async def delete(self, resource_uri: str, solution_configuration: str, **kwargs: if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.SolutionConfiguration"]: + def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.SolutionConfiguration"]: """List SolutionConfiguration resources by parent. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -3424,7 +3747,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3437,7 +3763,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionConfiguration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionConfiguration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3453,7 +3782,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3488,6 +3820,7 @@ async def _sync_now_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3501,7 +3834,10 @@ async def _sync_now_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3509,7 +3845,7 @@ async def _sync_now_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3553,14 +3889,10 @@ async def begin_sync_now( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -3587,7 +3919,7 @@ def get_long_running_output(pipeline_response): ) -class InventoryOperations: +class InventoryOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3649,6 +3981,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3663,11 +3996,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.InventoryResource, response.json()) @@ -3679,7 +4015,7 @@ async def get( @distributed_trace def list_by_solution_configuration( self, resource_uri: str, solution_configuration: str, **kwargs: Any - ) -> AsyncIterable["_models.InventoryResource"]: + ) -> AsyncItemPaged["_models.InventoryResource"]: """List InventoryResource resources by SolutionConfiguration. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -3733,7 +4069,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3746,7 +4085,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.InventoryResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.InventoryResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3762,7 +4104,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3770,7 +4115,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class SolutionTypesOperations: +class SolutionTypesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3828,6 +4173,7 @@ async def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3842,11 +4188,14 @@ async def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTypeResource, response.json()) @@ -3858,7 +4207,7 @@ async def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SolutionTypeResource"]: + ) -> AsyncItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3910,7 +4259,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3923,7 +4275,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3939,7 +4294,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3947,7 +4305,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SolutionTypeResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by subscription ID. :return: An iterator like instance of SolutionTypeResource @@ -3995,7 +4353,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4008,7 +4369,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4024,7 +4388,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py index f46ac515281b..8d339144bebd 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py @@ -24,7 +24,15 @@ ErrorDetail, ErrorResponse, ExtensionResource, + GcpCloudProfile, + GcpCloudProfileUpdate, + GcpOrganizationProperties, + GcpOrganizationPropertiesUpdate, + GcpProjectProperties, GenerateAwsTemplateRequest, + GenerateAwsTemplateResponse, + GenerateGcpTemplateRequest, + GenerateGcpTemplateResponse, IngressGatewayResource, IngressProfileProperties, InventoryProperties, @@ -65,6 +73,7 @@ ActionType, CloudNativeType, CreatedByType, + GcpTemplateFormat, HostType, Origin, ProvisioningState, @@ -88,7 +97,15 @@ "ErrorDetail", "ErrorResponse", "ExtensionResource", + "GcpCloudProfile", + "GcpCloudProfileUpdate", + "GcpOrganizationProperties", + "GcpOrganizationPropertiesUpdate", + "GcpProjectProperties", "GenerateAwsTemplateRequest", + "GenerateAwsTemplateResponse", + "GenerateGcpTemplateRequest", + "GenerateGcpTemplateResponse", "IngressGatewayResource", "IngressProfileProperties", "InventoryProperties", @@ -126,6 +143,7 @@ "ActionType", "CloudNativeType", "CreatedByType", + "GcpTemplateFormat", "HostType", "Origin", "ProvisioningState", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py index dc862c7da3de..788715cfcbf2 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py @@ -39,11 +39,22 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" +class GcpTemplateFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GCP template format.""" + + TERRAFORM = "terraform" + """Terraform template format.""" + SHELL_SCRIPT = "shellscript" + """Shell script template format.""" + + class HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum of host cloud the public cloud connector is referencing.""" AWS = "AWS" - """AWS state""" + """AWS state.""" + GCP = "GCP" + """GCP state.""" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -63,10 +74,15 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The resource provisioning state.""" SUCCEEDED = "Succeeded" + """SUCCEEDED.""" CREATING = "Creating" + """CREATING.""" UPDATING = "Updating" + """UPDATING.""" FAILED = "Failed" + """FAILED.""" CANCELED = "Canceled" + """CANCELED.""" class ResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -84,24 +100,28 @@ class ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Name of the service.""" SSH = "SSH" + """SSH.""" WAC = "WAC" + """WAC.""" class SolutionConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Solution Configuration Status.""" NEW = "New" - """New status""" + """New status.""" IN_PROGRESS = "InProgress" - """InProgress status""" + """InProgress status.""" COMPLETED = "Completed" - """Canceled status""" + """Canceled status.""" FAILED = "Failed" - """Failed status""" + """Failed status.""" class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of endpoint.""" DEFAULT = "default" + """DEFAULT.""" CUSTOM = "custom" + """CUSTOM.""" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py index fd45b020813b..7a9e90402e34 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py @@ -9,16 +9,15 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models -class AADProfileProperties(_model_base.Model): +class AADProfileProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The AAD Profile. :ivar server_id: The arc ingress gateway server app id. Required. @@ -51,7 +50,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AwsCloudProfile(_model_base.Model): +class AwsCloudProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """cloud profile for AWS. :ivar account_id: Account id for the AWS account. Required. @@ -66,7 +65,7 @@ class AwsCloudProfile(_model_base.Model): account_id: str = rest_field(name="accountId", visibility=["read", "create"]) """Account id for the AWS account. Required.""" - excluded_accounts: Optional[List[str]] = rest_field( + excluded_accounts: Optional[list[str]] = rest_field( name="excludedAccounts", visibility=["read", "create", "update", "delete", "query"] ) """List of AWS accounts which need to be excluded.""" @@ -81,7 +80,7 @@ def __init__( self, *, account_id: str, - excluded_accounts: Optional[List[str]] = None, + excluded_accounts: Optional[list[str]] = None, is_organizational_account: Optional[bool] = None, ) -> None: ... @@ -96,14 +95,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AwsCloudProfileUpdate(_model_base.Model): +class AwsCloudProfileUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """cloud profile for AWS. :ivar excluded_accounts: List of AWS accounts which need to be excluded. :vartype excluded_accounts: list[str] """ - excluded_accounts: Optional[List[str]] = rest_field( + excluded_accounts: Optional[list[str]] = rest_field( name="excludedAccounts", visibility=["read", "create", "update", "delete", "query"] ) """List of AWS accounts which need to be excluded.""" @@ -112,7 +111,7 @@ class AwsCloudProfileUpdate(_model_base.Model): def __init__( self, *, - excluded_accounts: Optional[List[str]] = None, + excluded_accounts: Optional[list[str]] = None, ) -> None: ... @overload @@ -126,7 +125,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EndpointAccessResource(_model_base.Model): +class EndpointAccessResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The endpoint access for the target resource. :ivar relay: Azure relay hybrid connection access properties. @@ -178,12 +177,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.relay is None: self.relay = self._attr_to_rest_field["relay"]._class_type() - setattr(self.properties, key, value) + setattr(self.relay, key, value) else: super().__setattr__(key, value) -class EndpointProperties(_model_base.Model): +class EndpointProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Endpoint details. :ivar type: The type of endpoint. Required. Known values are: "default" and "custom". @@ -222,8 +221,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_model_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class Resource(_Model): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -267,7 +266,7 @@ class ExtensionResource(Resource): """ -class EndpointResource(ExtensionResource): +class EndpointResource(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The endpoint for the target resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -308,7 +307,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorAdditionalInfo(_model_base.Model): +class ErrorAdditionalInfo(_Model): """The resource management error additional info. :ivar type: The additional info type. @@ -323,7 +322,7 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. :ivar code: The error code. @@ -344,17 +343,16 @@ class ErrorDetail(_model_base.Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.hybridconnectivity.models.ErrorDetail @@ -381,7 +379,198 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GenerateAwsTemplateRequest(_model_base.Model): +class GcpCloudProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """cloud profile for GCP. + + :ivar project_properties: The project properties of the GCP project. + :vartype project_properties: ~azure.mgmt.hybridconnectivity.models.GcpProjectProperties + :ivar organization_properties: The organization properties of the GCP organization. + :vartype organization_properties: + ~azure.mgmt.hybridconnectivity.models.GcpOrganizationProperties + """ + + project_properties: Optional["_models.GcpProjectProperties"] = rest_field( + name="projectProperties", visibility=["read", "create"] + ) + """The project properties of the GCP project.""" + organization_properties: Optional["_models.GcpOrganizationProperties"] = rest_field( + name="organizationProperties", visibility=["read", "create"] + ) + """The organization properties of the GCP organization.""" + + @overload + def __init__( + self, + *, + project_properties: Optional["_models.GcpProjectProperties"] = None, + organization_properties: Optional["_models.GcpOrganizationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpCloudProfileUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """cloud profile for GCP. + + :ivar organization_properties: The organization properties of the GCP organization. + :vartype organization_properties: + ~azure.mgmt.hybridconnectivity.models.GcpOrganizationPropertiesUpdate + """ + + organization_properties: Optional["_models.GcpOrganizationPropertiesUpdate"] = rest_field( + name="organizationProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """The organization properties of the GCP organization.""" + + @overload + def __init__( + self, + *, + organization_properties: Optional["_models.GcpOrganizationPropertiesUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpOrganizationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """GCP organization properties. + + :ivar organization_id: The organization id of the GCP organization. Required. + :vartype organization_id: str + :ivar management_project_number: The project number of the management project under the GCP + organization. Required. + :vartype management_project_number: str + :ivar management_project_id: The project Id of the management project under the GCP + organization. Required. + :vartype management_project_id: str + :ivar excluded_project_numbers: List of GCP projects which need to be excluded. + :vartype excluded_project_numbers: list[str] + :ivar excluded_folder_ids: List of GCP folders which need to be excluded. + :vartype excluded_folder_ids: list[str] + """ + + organization_id: str = rest_field(name="organizationId", visibility=["read", "create"]) + """The organization id of the GCP organization. Required.""" + management_project_number: str = rest_field(name="managementProjectNumber", visibility=["read", "create"]) + """The project number of the management project under the GCP organization. Required.""" + management_project_id: str = rest_field(name="managementProjectId", visibility=["read", "create"]) + """The project Id of the management project under the GCP organization. Required.""" + excluded_project_numbers: Optional[list[str]] = rest_field( + name="excludedProjectNumbers", visibility=["read", "create"] + ) + """List of GCP projects which need to be excluded.""" + excluded_folder_ids: Optional[list[str]] = rest_field(name="excludedFolderIds", visibility=["read", "create"]) + """List of GCP folders which need to be excluded.""" + + @overload + def __init__( + self, + *, + organization_id: str, + management_project_number: str, + management_project_id: str, + excluded_project_numbers: Optional[list[str]] = None, + excluded_folder_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpOrganizationPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """GCP organization properties for update. + + :ivar excluded_project_numbers: List of GCP projects which need to be excluded. + :vartype excluded_project_numbers: list[str] + :ivar excluded_folder_ids: List of GCP folders which need to be excluded. + :vartype excluded_folder_ids: list[str] + """ + + excluded_project_numbers: Optional[list[str]] = rest_field( + name="excludedProjectNumbers", visibility=["read", "create", "update", "delete", "query"] + ) + """List of GCP projects which need to be excluded.""" + excluded_folder_ids: Optional[list[str]] = rest_field( + name="excludedFolderIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of GCP folders which need to be excluded.""" + + @overload + def __init__( + self, + *, + excluded_project_numbers: Optional[list[str]] = None, + excluded_folder_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpProjectProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """GCP project properties. + + :ivar project_number: The project number of the GCP project. Required. + :vartype project_number: str + :ivar project_id: The project id of the GCP project. Required. + :vartype project_id: str + """ + + project_number: str = rest_field(name="projectNumber", visibility=["read", "create"]) + """The project number of the GCP project. Required.""" + project_id: str = rest_field(name="projectId", visibility=["read", "create"]) + """The project id of the GCP project. Required.""" + + @overload + def __init__( + self, + *, + project_number: str, + project_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GenerateAwsTemplateRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. :ivar connector_id: The name of public cloud connector. Required. @@ -392,7 +581,7 @@ class GenerateAwsTemplateRequest(_model_base.Model): connector_id: str = rest_field(name="connectorId", visibility=["read", "create", "update", "delete", "query"]) """The name of public cloud connector. Required.""" - solution_types: Optional[List["_models.SolutionTypeSettings"]] = rest_field( + solution_types: Optional[list["_models.SolutionTypeSettings"]] = rest_field( name="solutionTypes", visibility=["read", "create", "update", "delete", "query"] ) """The list of solution types and their settings.""" @@ -402,7 +591,7 @@ def __init__( self, *, connector_id: str, - solution_types: Optional[List["_models.SolutionTypeSettings"]] = None, + solution_types: Optional[list["_models.SolutionTypeSettings"]] = None, ) -> None: ... @overload @@ -416,7 +605,66 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IngressGatewayResource(_model_base.Model): +class GenerateAwsTemplateResponse(_Model): + """The HybridConnectivity post operation response.""" + + +class GenerateGcpTemplateRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectorId and SolutionTypes and their properties to Generate GCP Access Control Template. + + :ivar connector_id: The name of public cloud connector. Required. + :vartype connector_id: str + :ivar solution_types: The list of solution types and their settings. + :vartype solution_types: list[~azure.mgmt.hybridconnectivity.models.SolutionTypeSettings] + :ivar gcp_cloud_profile: The GCP cloud profile. + :vartype gcp_cloud_profile: ~azure.mgmt.hybridconnectivity.models.GcpCloudProfile + :ivar gcp_template_format: Optional template output format. Defaults to 'terraform' if not + provided. Known values are: "terraform" and "shellscript". + :vartype gcp_template_format: str or ~azure.mgmt.hybridconnectivity.models.GcpTemplateFormat + """ + + connector_id: str = rest_field(name="connectorId", visibility=["read", "create", "update", "delete", "query"]) + """The name of public cloud connector. Required.""" + solution_types: Optional[list["_models.SolutionTypeSettings"]] = rest_field( + name="solutionTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of solution types and their settings.""" + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = rest_field( + name="gcpCloudProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The GCP cloud profile.""" + gcp_template_format: Optional[Union[str, "_models.GcpTemplateFormat"]] = rest_field( + name="gcpTemplateFormat", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional template output format. Defaults to 'terraform' if not provided. Known values are: + \"terraform\" and \"shellscript\".""" + + @overload + def __init__( + self, + *, + connector_id: str, + solution_types: Optional[list["_models.SolutionTypeSettings"]] = None, + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = None, + gcp_template_format: Optional[Union[str, "_models.GcpTemplateFormat"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GenerateGcpTemplateResponse(_Model): + """The HybridConnectivity post operation response.""" + + +class IngressGatewayResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ingress gateway access credentials. :ivar relay: Azure relay hybrid connection access properties. @@ -475,12 +723,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.relay is None: self.relay = self._attr_to_rest_field["relay"]._class_type() - setattr(self.properties, key, value) + setattr(self.relay, key, value) else: super().__setattr__(key, value) -class IngressProfileProperties(_model_base.Model): +class IngressProfileProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Ingress gateway profile. :ivar hostname: The ingress hostname. Required. @@ -530,12 +778,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.aad_profile is None: self.aad_profile = self._attr_to_rest_field["aad_profile"]._class_type() - setattr(self.properties, key, value) + setattr(self.aad_profile, key, value) else: super().__setattr__(key, value) -class InventoryProperties(_model_base.Model): +class InventoryProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of inventory. :ivar cloud_native_type: Gets or sets the cloud native resource type. "ec2" @@ -604,8 +852,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. + """Proxy Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -621,7 +868,7 @@ class ProxyResource(Resource): """ -class InventoryResource(ProxyResource): +class InventoryResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Concrete proxy resource types can be created by aliasing this type using a specific property type. @@ -663,7 +910,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ListCredentialsRequest(_model_base.Model): +class ListCredentialsRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The details of the service for which credentials needs to be returned. :ivar service_name: The name of the service. If not provided, the request will by pass the @@ -695,7 +942,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ListIngressGatewayCredentialsRequest(_model_base.Model): +class ListIngressGatewayCredentialsRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represent ListIngressGatewayCredentials Request object. :ivar service_name: The name of the service. If not provided, the request will by pass the @@ -727,7 +974,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedProxyRequest(_model_base.Model): +class ManagedProxyRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represent ManageProxy Request object. :ivar service: The name of the service. Required. @@ -769,7 +1016,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedProxyResource(_model_base.Model): +class ManagedProxyResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Managed Proxy. :ivar proxy: The short lived proxy name. Required. @@ -802,8 +1049,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -859,8 +1106,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_model_base.Model): - """Localized display information for and operation. +class OperationDisplay(_Model): + """Localized display information for an operation. :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". @@ -890,7 +1137,7 @@ class OperationDisplay(_model_base.Model): views.""" -class OperationStatusResult(_model_base.Model): +class OperationStatusResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The current status of an async operation. :ivar id: Fully qualified ID for the async operation. @@ -932,7 +1179,7 @@ class OperationStatusResult(_model_base.Model): name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) """The end time of the operation.""" - operations: Optional[List["_models.OperationStatusResult"]] = rest_field( + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The operations list.""" @@ -951,7 +1198,7 @@ def __init__( percent_complete: Optional[float] = None, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - operations: Optional[List["_models.OperationStatusResult"]] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, error: Optional["_models.ErrorDetail"] = None, ) -> None: ... @@ -966,9 +1213,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -987,7 +1233,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -997,7 +1243,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1011,7 +1257,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnector(TrackedResource): +class PublicCloudConnector(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Public Cloud Connector. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1031,19 +1277,23 @@ class PublicCloudConnector(TrackedResource): :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorProperties + :ivar kind: The kind of the public cloud connector. Known values are: "AWS" and "GCP". + :vartype kind: str or ~azure.mgmt.hybridconnectivity.models.HostType """ properties: Optional["_models.PublicCloudConnectorProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + kind: Optional[Union[str, "_models.HostType"]] = rest_field(visibility=["read"]) + """The kind of the public cloud connector. Known values are: \"AWS\" and \"GCP\".""" @overload def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.PublicCloudConnectorProperties"] = None, ) -> None: ... @@ -1058,12 +1308,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnectorProperties(_model_base.Model): +class PublicCloudConnectorProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of public cloud connectors. - :ivar aws_cloud_profile: Cloud profile for AWS. Required. + :ivar aws_cloud_profile: Cloud profile for AWS. :vartype aws_cloud_profile: ~azure.mgmt.hybridconnectivity.models.AwsCloudProfile - :ivar host_type: Host cloud the public cloud connector. Required. "AWS" + :ivar gcp_cloud_profile: Cloud profile for GCP. + :vartype gcp_cloud_profile: ~azure.mgmt.hybridconnectivity.models.GcpCloudProfile + :ivar host_type: Host cloud the public cloud connector. Required. Known values are: "AWS" and + "GCP". :vartype host_type: str or ~azure.mgmt.hybridconnectivity.models.HostType :ivar provisioning_state: The resource provisioning state. Known values are: "Succeeded", "Failed", and "Canceled". @@ -1073,12 +1326,16 @@ class PublicCloudConnectorProperties(_model_base.Model): :vartype connector_primary_identifier: str """ - aws_cloud_profile: "_models.AwsCloudProfile" = rest_field( + aws_cloud_profile: Optional["_models.AwsCloudProfile"] = rest_field( name="awsCloudProfile", visibility=["read", "create", "update", "delete", "query"] ) - """Cloud profile for AWS. Required.""" + """Cloud profile for AWS.""" + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = rest_field( + name="gcpCloudProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Cloud profile for GCP.""" host_type: Union[str, "_models.HostType"] = rest_field(name="hostType", visibility=["read", "create"]) - """Host cloud the public cloud connector. Required. \"AWS\"""" + """Host cloud the public cloud connector. Required. Known values are: \"AWS\" and \"GCP\".""" provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -1090,8 +1347,9 @@ class PublicCloudConnectorProperties(_model_base.Model): def __init__( self, *, - aws_cloud_profile: "_models.AwsCloudProfile", host_type: Union[str, "_models.HostType"], + aws_cloud_profile: Optional["_models.AwsCloudProfile"] = None, + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = None, ) -> None: ... @overload @@ -1105,23 +1363,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnectorPropertiesUpdate(_model_base.Model): +class PublicCloudConnectorPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of public cloud connectors. :ivar aws_cloud_profile: Cloud profile for AWS. :vartype aws_cloud_profile: ~azure.mgmt.hybridconnectivity.models.AwsCloudProfileUpdate + :ivar gcp_cloud_profile: Cloud profile for GCP. + :vartype gcp_cloud_profile: ~azure.mgmt.hybridconnectivity.models.GcpCloudProfileUpdate """ aws_cloud_profile: Optional["_models.AwsCloudProfileUpdate"] = rest_field( name="awsCloudProfile", visibility=["read", "create", "update", "delete", "query"] ) """Cloud profile for AWS.""" + gcp_cloud_profile: Optional["_models.GcpCloudProfileUpdate"] = rest_field( + name="gcpCloudProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Cloud profile for GCP.""" @overload def __init__( self, *, aws_cloud_profile: Optional["_models.AwsCloudProfileUpdate"] = None, + gcp_cloud_profile: Optional["_models.GcpCloudProfileUpdate"] = None, ) -> None: ... @overload @@ -1135,7 +1400,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResourceUpdate(Resource): +class TrackedResourceUpdate(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -1154,14 +1419,14 @@ class TrackedResourceUpdate(Resource): :vartype tags: dict[str, str] """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" @overload def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1175,7 +1440,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnectorUpdate(TrackedResourceUpdate): +class PublicCloudConnectorUpdate(TrackedResourceUpdate): # pylint: disable=docstring-keyword-should-match-keyword-only """Public Cloud Connector. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1204,7 +1469,7 @@ class PublicCloudConnectorUpdate(TrackedResourceUpdate): def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.PublicCloudConnectorPropertiesUpdate"] = None, ) -> None: ... @@ -1219,7 +1484,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RelayNamespaceAccessProperties(_model_base.Model): +class RelayNamespaceAccessProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure relay hybrid connection access properties. :ivar namespace_name: The namespace name. Required. @@ -1277,7 +1542,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceConfigurationProperties(_model_base.Model): +class ServiceConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Service configuration details. :ivar service_name: Name of the service. Required. Known values are: "SSH" and "WAC". @@ -1327,7 +1592,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceConfigurationPropertiesPatch(_model_base.Model): +class ServiceConfigurationPropertiesPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Service configuration details. :ivar port: The port on which service is enabled. @@ -1355,7 +1620,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceConfigurationResource(ExtensionResource): +class ServiceConfigurationResource(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The service configuration details associated with the target resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1416,7 +1681,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ServiceConfigurationResourcePatch(_model_base.Model): +class ServiceConfigurationResourcePatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The service details under service configuration for the target endpoint resource. :ivar properties: The service configuration properties. @@ -1466,7 +1731,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class SolutionConfiguration(ExtensionResource): +class SolutionConfiguration(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution Configuration. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1507,7 +1772,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionConfigurationProperties(_model_base.Model): +class SolutionConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution configuration resource. :ivar provisioning_state: The resource provisioning state. Known values are: "Succeeded", @@ -1564,7 +1829,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionConfigurationPropertiesUpdate(_model_base.Model): +class SolutionConfigurationPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution configuration resource. :ivar solution_type: The type of the solution. @@ -1601,7 +1866,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionConfigurationUpdate(ProxyResource): +class SolutionConfigurationUpdate(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution Configuration. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1643,11 +1908,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionSettings(_model_base.Model): +class SolutionSettings(_Model): """Solution settings.""" -class SolutionTypeProperties(_model_base.Model): +class SolutionTypeProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of Solution type resource. :ivar solution_type: The name of the solution type. @@ -1656,6 +1921,8 @@ class SolutionTypeProperties(_model_base.Model): :vartype description: str :ivar supported_azure_regions: The locations this solution is supported in. :vartype supported_azure_regions: list[str] + :ivar host_types: The supported host types for the current solution type. + :vartype host_types: list[str or ~azure.mgmt.hybridconnectivity.models.HostType] :ivar solution_settings: Array of solution settings and its description. :vartype solution_settings: list[~azure.mgmt.hybridconnectivity.models.SolutionTypeSettingsProperties] @@ -1667,11 +1934,15 @@ class SolutionTypeProperties(_model_base.Model): """The name of the solution type.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Short description of solution type.""" - supported_azure_regions: Optional[List[str]] = rest_field( + supported_azure_regions: Optional[list[str]] = rest_field( name="supportedAzureRegions", visibility=["read", "create", "update", "delete", "query"] ) """The locations this solution is supported in.""" - solution_settings: Optional[List["_models.SolutionTypeSettingsProperties"]] = rest_field( + host_types: Optional[list[Union[str, "_models.HostType"]]] = rest_field( + name="hostTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The supported host types for the current solution type.""" + solution_settings: Optional[list["_models.SolutionTypeSettingsProperties"]] = rest_field( name="solutionSettings", visibility=["read", "create", "update", "delete", "query"] ) """Array of solution settings and its description.""" @@ -1682,8 +1953,9 @@ def __init__( *, solution_type: Optional[str] = None, description: Optional[str] = None, - supported_azure_regions: Optional[List[str]] = None, - solution_settings: Optional[List["_models.SolutionTypeSettingsProperties"]] = None, + supported_azure_regions: Optional[list[str]] = None, + host_types: Optional[list[Union[str, "_models.HostType"]]] = None, + solution_settings: Optional[list["_models.SolutionTypeSettingsProperties"]] = None, ) -> None: ... @overload @@ -1697,7 +1969,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionTypeResource(ProxyResource): +class SolutionTypeResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Concrete proxy resource types can be created by aliasing this type using a specific property type. @@ -1739,7 +2011,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionTypeSettings(_model_base.Model): +class SolutionTypeSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The properties of Solution Type. :ivar solution_type: The type of the solution. Required. @@ -1774,7 +2046,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionTypeSettingsProperties(_model_base.Model): +class SolutionTypeSettingsProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represent Solution settings properties description array. :ivar name: The name of the solution setting property. Required. @@ -1787,6 +2059,8 @@ class SolutionTypeSettingsProperties(_model_base.Model): :vartype description: str :ivar allowed_values: Array of allowed values for this solution settings property. Required. :vartype allowed_values: list[str] + :ivar host_types: The supported host types for the current solution setting. Required. + :vartype host_types: list[str or ~azure.mgmt.hybridconnectivity.models.HostType] :ivar default_value: Default value for this solution settings property. Required. :vartype default_value: str """ @@ -1799,10 +2073,14 @@ class SolutionTypeSettingsProperties(_model_base.Model): """Type of the solution setting property, represented as a string. Required.""" description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Description of solution setting property. Required.""" - allowed_values: List[str] = rest_field( + allowed_values: list[str] = rest_field( name="allowedValues", visibility=["read", "create", "update", "delete", "query"] ) """Array of allowed values for this solution settings property. Required.""" + host_types: list[Union[str, "_models.HostType"]] = rest_field( + name="hostTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The supported host types for the current solution setting. Required.""" default_value: str = rest_field(name="defaultValue", visibility=["read", "create", "update", "delete", "query"]) """Default value for this solution settings property. Required.""" @@ -1814,7 +2092,8 @@ def __init__( display_name: str, type: str, description: str, - allowed_values: List[str], + allowed_values: list[str], + host_types: list[Union[str, "_models.HostType"]], default_value: str, ) -> None: ... @@ -1829,7 +2108,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_model_base.Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py index 60101daee8c0..2caf8c623231 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py @@ -16,6 +16,7 @@ from ._operations import EndpointsOperations # type: ignore from ._operations import ServiceConfigurationsOperations # type: ignore from ._operations import GenerateAwsTemplateOperations # type: ignore +from ._operations import GenerateGcpTemplateOperations # type: ignore from ._operations import PublicCloudConnectorsOperations # type: ignore from ._operations import SolutionConfigurationsOperations # type: ignore from ._operations import InventoryOperations # type: ignore @@ -30,6 +31,7 @@ "EndpointsOperations", "ServiceConfigurationsOperations", "GenerateAwsTemplateOperations", + "GenerateGcpTemplateOperations", "PublicCloudConnectorsOperations", "SolutionConfigurationsOperations", "InventoryOperations", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py index 2958e40b289b..4ee0e357e049 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py @@ -6,10 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -32,18 +32,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import HybridConnectivityMgmtClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._serialization import Deserializer, Serializer +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -53,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +69,7 @@ def build_endpoints_get_request(resource_uri: str, endpoint_name: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +95,7 @@ def build_endpoints_create_or_update_request(resource_uri: str, endpoint_name: s _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +123,7 @@ def build_endpoints_update_request(resource_uri: str, endpoint_name: str, **kwar _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,12 +147,9 @@ def build_endpoints_update_request(resource_uri: str, endpoint_name: str, **kwar def build_endpoints_delete_request(resource_uri: str, endpoint_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}" path_format_arguments = { @@ -168,17 +162,14 @@ def build_endpoints_delete_request(resource_uri: str, endpoint_name: str, **kwar # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_endpoints_list_request(resource_uri: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +196,7 @@ def build_endpoints_list_credentials_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +228,7 @@ def build_endpoints_list_ingress_gateway_credentials_request( # pylint: disable _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +262,7 @@ def build_endpoints_list_managed_proxy_details_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -300,7 +291,7 @@ def build_service_configurations_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -331,7 +322,7 @@ def build_service_configurations_create_orupdate_request( # pylint: disable=nam _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +355,7 @@ def build_service_configurations_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -393,12 +384,9 @@ def build_service_configurations_update_request( # pylint: disable=name-too-lon def build_service_configurations_delete_request( # pylint: disable=name-too-long resource_uri: str, endpoint_name: str, service_configuration_name: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}" path_format_arguments = { @@ -414,10 +402,7 @@ def build_service_configurations_delete_request( # pylint: disable=name-too-lon # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_service_configurations_list_by_endpoint_resource_request( # pylint: disable=name-too-long @@ -426,7 +411,7 @@ def build_service_configurations_list_by_endpoint_resource_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -452,7 +437,7 @@ def build_generate_aws_template_post_request(subscription_id: str, **kwargs: Any _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -474,13 +459,40 @@ def build_generate_aws_template_post_request(subscription_id: str, **kwargs: Any return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_generate_gcp_template_post_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateGcpTemplate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_public_cloud_connectors_get_request( # pylint: disable=name-too-long resource_group_name: str, public_cloud_connector: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,7 +521,7 @@ def build_public_cloud_connectors_create_or_update_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -540,7 +552,7 @@ def build_public_cloud_connectors_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -567,12 +579,9 @@ def build_public_cloud_connectors_update_request( # pylint: disable=name-too-lo def build_public_cloud_connectors_delete_request( # pylint: disable=name-too-long resource_group_name: str, public_cloud_connector: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}" path_format_arguments = { @@ -586,10 +595,7 @@ def build_public_cloud_connectors_delete_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_public_cloud_connectors_list_by_resource_group_request( # pylint: disable=name-too-long @@ -598,7 +604,7 @@ def build_public_cloud_connectors_list_by_resource_group_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -625,7 +631,7 @@ def build_public_cloud_connectors_list_by_subscription_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -651,7 +657,7 @@ def build_public_cloud_connectors_test_permissions_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -679,7 +685,7 @@ def build_solution_configurations_get_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -707,7 +713,7 @@ def build_solution_configurations_create_or_update_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -737,7 +743,7 @@ def build_solution_configurations_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -763,12 +769,9 @@ def build_solution_configurations_update_request( # pylint: disable=name-too-lo def build_solution_configurations_delete_request( # pylint: disable=name-too-long resource_uri: str, solution_configuration: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}" path_format_arguments = { @@ -781,10 +784,7 @@ def build_solution_configurations_delete_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_solution_configurations_list_request( # pylint: disable=name-too-long @@ -793,7 +793,7 @@ def build_solution_configurations_list_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -819,7 +819,7 @@ def build_solution_configurations_sync_now_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -848,7 +848,7 @@ def build_inventory_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -876,7 +876,7 @@ def build_inventory_list_by_solution_configuration_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -905,7 +905,7 @@ def build_solution_types_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -933,7 +933,7 @@ def build_solution_types_list_by_resource_group_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -960,7 +960,7 @@ def build_solution_types_list_by_subscription_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -980,7 +980,7 @@ def build_solution_types_list_by_subscription_request( # pylint: disable=name-t return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -990,7 +990,7 @@ class Operations: :attr:`operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -1000,7 +1000,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -1046,7 +1046,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1059,7 +1062,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1075,7 +1081,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1083,7 +1092,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class EndpointsOperations: +class EndpointsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1093,7 +1102,7 @@ class EndpointsOperations: :attr:`endpoints` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -1140,6 +1149,7 @@ def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _models.E } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1154,11 +1164,14 @@ def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _models.E except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -1199,7 +1212,7 @@ def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -1212,7 +1225,7 @@ def create_or_update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1253,7 +1266,7 @@ def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Create or update the endpoint to the target resource. @@ -1263,10 +1276,10 @@ def create_or_update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1306,6 +1319,7 @@ def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1320,11 +1334,14 @@ def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -1365,7 +1382,7 @@ def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -1378,7 +1395,7 @@ def update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1419,7 +1436,7 @@ def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Update the endpoint to the target resource. @@ -1429,10 +1446,10 @@ def update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1472,6 +1489,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1486,11 +1504,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -1548,14 +1569,17 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.EndpointResource"]: + def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.EndpointResource"]: """List of endpoints to the target resource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -1605,7 +1629,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1618,7 +1645,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EndpointResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.EndpointResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1634,7 +1664,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1677,7 +1710,7 @@ def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[JSON] = None, + list_credentials_request: Optional[_types.ListCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -1691,7 +1724,7 @@ def list_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_credentials_request: Object of type ListCredentialsRequest. Default value is None. - :type list_credentials_request: JSON + :type list_credentials_request: ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1739,7 +1772,9 @@ def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[Union[_models.ListCredentialsRequest, JSON, IO[bytes]]] = None, + list_credentials_request: Optional[ + Union[_models.ListCredentialsRequest, _types.ListCredentialsRequest, IO[bytes]] + ] = None, *, expiresin: Optional[int] = None, **kwargs: Any @@ -1751,10 +1786,10 @@ def list_credentials( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param list_credentials_request: Object of type ListCredentialsRequest. Is one of the following - types: ListCredentialsRequest, JSON, IO[bytes] Default value is None. + :param list_credentials_request: Object of type ListCredentialsRequest. Is either a + ListCredentialsRequest type or a IO[bytes] type. Default value is None. :type list_credentials_request: ~azure.mgmt.hybridconnectivity.models.ListCredentialsRequest or - JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1774,9 +1809,10 @@ def list_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_credentials_request else None cls: ClsType[_models.EndpointAccessResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_credentials_request else None _content = None if isinstance(list_credentials_request, (IOBase, bytes)): _content = list_credentials_request @@ -1801,6 +1837,7 @@ def list_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1815,11 +1852,14 @@ def list_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointAccessResource, response.json()) @@ -1866,7 +1906,7 @@ def list_ingress_gateway_credentials( self, resource_uri: str, endpoint_name: str, - list_ingress_gateway_credentials_request: Optional[JSON] = None, + list_ingress_gateway_credentials_request: Optional[_types.ListIngressGatewayCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -1881,7 +1921,8 @@ def list_ingress_gateway_credentials( :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type ListIngressGatewayCredentialsRequest. Default value is None. - :type list_ingress_gateway_credentials_request: JSON + :type list_ingress_gateway_credentials_request: + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1931,7 +1972,7 @@ def list_ingress_gateway_credentials( resource_uri: str, endpoint_name: str, list_ingress_gateway_credentials_request: Optional[ - Union[_models.ListIngressGatewayCredentialsRequest, JSON, IO[bytes]] + Union[_models.ListIngressGatewayCredentialsRequest, _types.ListIngressGatewayCredentialsRequest, IO[bytes]] ] = None, *, expiresin: Optional[int] = None, @@ -1945,10 +1986,11 @@ def list_ingress_gateway_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type - ListIngressGatewayCredentialsRequest. Is one of the following types: - ListIngressGatewayCredentialsRequest, JSON, IO[bytes] Default value is None. + ListIngressGatewayCredentialsRequest. Is either a ListIngressGatewayCredentialsRequest type or + a IO[bytes] type. Default value is None. :type list_ingress_gateway_credentials_request: - ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1968,9 +2010,10 @@ def list_ingress_gateway_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_ingress_gateway_credentials_request else None cls: ClsType[_models.IngressGatewayResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_ingress_gateway_credentials_request else None _content = None if isinstance(list_ingress_gateway_credentials_request, (IOBase, bytes)): _content = list_ingress_gateway_credentials_request @@ -1995,6 +2038,7 @@ def list_ingress_gateway_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2009,11 +2053,14 @@ def list_ingress_gateway_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngressGatewayResource, response.json()) @@ -2054,7 +2101,7 @@ def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: JSON, + managed_proxy_request: _types.ManagedProxyRequest, *, content_type: str = "application/json", **kwargs: Any @@ -2067,7 +2114,7 @@ def list_managed_proxy_details( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param managed_proxy_request: Object of type ManagedProxyRequest. Required. - :type managed_proxy_request: JSON + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2108,7 +2155,7 @@ def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: Union[_models.ManagedProxyRequest, JSON, IO[bytes]], + managed_proxy_request: Union[_models.ManagedProxyRequest, _types.ManagedProxyRequest, IO[bytes]], **kwargs: Any ) -> _models.ManagedProxyResource: """Fetches the managed proxy details. @@ -2118,10 +2165,10 @@ def list_managed_proxy_details( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param managed_proxy_request: Object of type ManagedProxyRequest. Is one of the following - types: ManagedProxyRequest, JSON, IO[bytes] Required. - :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or JSON - or IO[bytes] + :param managed_proxy_request: Object of type ManagedProxyRequest. Is either a + ManagedProxyRequest type or a IO[bytes] type. Required. + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or + ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest or IO[bytes] :return: ManagedProxyResource. The ManagedProxyResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ManagedProxyResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2161,6 +2208,7 @@ def list_managed_proxy_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2175,11 +2223,14 @@ def list_managed_proxy_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ManagedProxyResource, response.json()) @@ -2189,7 +2240,7 @@ def list_managed_proxy_details( return deserialized # type: ignore -class ServiceConfigurationsOperations: +class ServiceConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2199,7 +2250,7 @@ class ServiceConfigurationsOperations: :attr:`service_configurations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -2252,6 +2303,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2266,11 +2318,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -2317,7 +2372,7 @@ def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResource, *, content_type: str = "application/json", **kwargs: Any @@ -2332,7 +2387,8 @@ def create_orupdate( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2379,7 +2435,9 @@ def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResource, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResource, _types.ServiceConfigurationResource, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Create or update a service in serviceConfiguration for the endpoint resource. @@ -2391,10 +2449,11 @@ def create_orupdate( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResource, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResource type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -2436,6 +2495,7 @@ def create_orupdate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2450,11 +2510,14 @@ def create_orupdate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -2501,7 +2564,7 @@ def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResourcePatch, *, content_type: str = "application/json", **kwargs: Any @@ -2516,7 +2579,8 @@ def update( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2563,7 +2627,9 @@ def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResourcePatch, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResourcePatch, _types.ServiceConfigurationResourcePatch, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Update the service details in the service configurations of the target resource. @@ -2575,10 +2641,11 @@ def update( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResourcePatch, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResourcePatch type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -2620,6 +2687,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2634,11 +2702,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -2699,7 +2770,10 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2708,7 +2782,7 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def list_by_endpoint_resource( self, resource_uri: str, endpoint_name: str, **kwargs: Any - ) -> Iterable["_models.ServiceConfigurationResource"]: + ) -> ItemPaged["_models.ServiceConfigurationResource"]: """Lists of all the services associated with endpoint resource. API to enumerate registered services in service configurations under a Endpoint Resource. @@ -2764,7 +2838,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2777,7 +2854,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ServiceConfigurationResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ServiceConfigurationResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2793,7 +2873,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2801,7 +2884,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GenerateAwsTemplateOperations: +class GenerateAwsTemplateOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2811,7 +2894,7 @@ class GenerateAwsTemplateOperations: :attr:`generate_aws_template` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -2827,7 +2910,7 @@ def post( *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -2837,32 +2920,39 @@ def post( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def post( - self, generate_aws_template_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: _types.GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. Required. - :type generate_aws_template_request: JSON + :type generate_aws_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def post( self, generate_aws_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -2871,24 +2961,31 @@ def post( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def post( - self, generate_aws_template_request: Union[_models.GenerateAwsTemplateRequest, JSON, IO[bytes]], **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: Union[ + _models.GenerateAwsTemplateRequest, _types.GenerateAwsTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to - Generate AWS CFT Template. Is one of the following types: GenerateAwsTemplateRequest, JSON, - IO[bytes] Required. + Generate AWS CFT Template. Is either a GenerateAwsTemplateRequest type or a IO[bytes] type. + Required. :type generate_aws_template_request: - ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or JSON or IO[bytes] - :return: any - :rtype: any + ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest or IO[bytes] + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2903,7 +3000,7 @@ def post( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Any] = kwargs.pop("cls", None) + cls: ClsType[_models.GenerateAwsTemplateResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2925,6 +3022,182 @@ def post( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GenerateAwsTemplateResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class GenerateGcpTemplateOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient`'s + :attr:`generate_gcp_template` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HybridConnectivityMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def post( + self, + generate_gcp_template_request: _models.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + generate_gcp_template_request: _types.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, generate_gcp_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2027-01-01", + params_added_on={"2027-01-01": ["api_version", "subscription_id", "content_type", "accept"]}, + api_versions_list=["2027-01-01"], + ) + def post( + self, + generate_gcp_template_request: Union[ + _models.GenerateGcpTemplateRequest, _types.GenerateGcpTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Is either a GenerateGcpTemplateRequest type or a + IO[bytes] type. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest or IO[bytes] + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateGcpTemplateResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(generate_gcp_template_request, (IOBase, bytes)): + _content = generate_gcp_template_request + else: + _content = json.dumps(generate_gcp_template_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_generate_gcp_template_post_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2939,13 +3212,16 @@ def post( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(Any, response.json()) + deserialized = _deserialize(_models.GenerateGcpTemplateResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2953,7 +3229,7 @@ def post( return deserialized # type: ignore -class PublicCloudConnectorsOperations: +class PublicCloudConnectorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2963,7 +3239,7 @@ class PublicCloudConnectorsOperations: :attr:`public_cloud_connectors` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -3011,6 +3287,7 @@ def get(self, resource_group_name: str, public_cloud_connector: str, **kwargs: A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3025,11 +3302,14 @@ def get(self, resource_group_name: str, public_cloud_connector: str, **kwargs: A except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -3042,7 +3322,7 @@ def _create_or_update_initial( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3081,6 +3361,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3094,7 +3375,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3104,7 +3388,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3145,7 +3429,7 @@ def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: JSON, + resource: _types.PublicCloudConnector, *, content_type: str = "application/json", **kwargs: Any @@ -3158,7 +3442,7 @@ def begin_create_or_update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3203,7 +3487,7 @@ def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.PublicCloudConnector]: """Create a PublicCloudConnector. @@ -3213,9 +3497,10 @@ def begin_create_or_update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param resource: Resource create parameters. Is one of the following types: - PublicCloudConnector, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a PublicCloudConnector type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector or IO[bytes] :return: An instance of LROPoller that returns PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: @@ -3306,7 +3591,7 @@ def update( self, resource_group_name: str, public_cloud_connector: str, - properties: JSON, + properties: _types.PublicCloudConnectorUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -3319,7 +3604,7 @@ def update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3360,7 +3645,7 @@ def update( self, resource_group_name: str, public_cloud_connector: str, - properties: Union[_models.PublicCloudConnectorUpdate, JSON, IO[bytes]], + properties: Union[_models.PublicCloudConnectorUpdate, _types.PublicCloudConnectorUpdate, IO[bytes]], **kwargs: Any ) -> _models.PublicCloudConnector: """Update a PublicCloudConnector. @@ -3370,10 +3655,10 @@ def update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param properties: The resource properties to be updated. Is one of the following types: - PublicCloudConnectorUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + PublicCloudConnectorUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate or IO[bytes] :return: PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector :raises ~azure.core.exceptions.HttpResponseError: @@ -3414,6 +3699,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3428,11 +3714,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -3491,7 +3780,10 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -3500,7 +3792,7 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.PublicCloudConnector"]: + ) -> ItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3552,7 +3844,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3565,7 +3860,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3581,7 +3879,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3589,7 +3890,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.PublicCloudConnector"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by subscription ID. :return: An iterator like instance of PublicCloudConnector @@ -3637,7 +3938,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3650,7 +3954,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3666,7 +3973,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3702,6 +4012,7 @@ def _test_permissions_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3715,7 +4026,10 @@ def _test_permissions_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3723,7 +4037,7 @@ def _test_permissions_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3767,14 +4081,10 @@ def begin_test_permissions( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -3801,7 +4111,7 @@ def get_long_running_output(pipeline_response): ) -class SolutionConfigurationsOperations: +class SolutionConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3811,7 +4121,7 @@ class SolutionConfigurationsOperations: :attr:`solution_configurations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -3858,6 +4168,7 @@ def get(self, resource_uri: str, solution_configuration: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3872,11 +4183,14 @@ def get(self, resource_uri: str, solution_configuration: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3917,7 +4231,7 @@ def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: JSON, + resource: _types.SolutionConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -3930,7 +4244,7 @@ def create_or_update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3971,7 +4285,7 @@ def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: Union[_models.SolutionConfiguration, JSON, IO[bytes]], + resource: Union[_models.SolutionConfiguration, _types.SolutionConfiguration, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Create a SolutionConfiguration. @@ -3981,10 +4295,10 @@ def create_or_update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param resource: Resource create parameters. Is one of the following types: - SolutionConfiguration, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or JSON or - IO[bytes] + :param resource: Resource create parameters. Is either a SolutionConfiguration type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or + ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -4024,6 +4338,7 @@ def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4038,11 +4353,14 @@ def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -4083,7 +4401,7 @@ def update( self, resource_uri: str, solution_configuration: str, - properties: JSON, + properties: _types.SolutionConfigurationUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -4096,7 +4414,7 @@ def update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4137,7 +4455,7 @@ def update( self, resource_uri: str, solution_configuration: str, - properties: Union[_models.SolutionConfigurationUpdate, JSON, IO[bytes]], + properties: Union[_models.SolutionConfigurationUpdate, _types.SolutionConfigurationUpdate, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Update a SolutionConfiguration. @@ -4147,10 +4465,10 @@ def update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param properties: The resource properties to be updated. Is one of the following types: - SolutionConfigurationUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + SolutionConfigurationUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or + ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -4190,6 +4508,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4204,11 +4523,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -4266,14 +4588,17 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.SolutionConfiguration"]: + def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.SolutionConfiguration"]: """List SolutionConfiguration resources by parent. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -4324,7 +4649,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4337,7 +4665,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionConfiguration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionConfiguration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4353,7 +4684,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4386,6 +4720,7 @@ def _sync_now_initial(self, resource_uri: str, solution_configuration: str, **kw } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4399,7 +4734,10 @@ def _sync_now_initial(self, resource_uri: str, solution_configuration: str, **kw except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4407,7 +4745,7 @@ def _sync_now_initial(self, resource_uri: str, solution_configuration: str, **kw response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4451,14 +4789,10 @@ def begin_sync_now( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -4485,7 +4819,7 @@ def get_long_running_output(pipeline_response): ) -class InventoryOperations: +class InventoryOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4495,7 +4829,7 @@ class InventoryOperations: :attr:`inventory` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -4547,6 +4881,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4561,11 +4896,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.InventoryResource, response.json()) @@ -4577,7 +4915,7 @@ def get( @distributed_trace def list_by_solution_configuration( self, resource_uri: str, solution_configuration: str, **kwargs: Any - ) -> Iterable["_models.InventoryResource"]: + ) -> ItemPaged["_models.InventoryResource"]: """List InventoryResource resources by SolutionConfiguration. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -4630,7 +4968,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4643,7 +4984,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.InventoryResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.InventoryResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4659,7 +5003,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4667,7 +5014,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class SolutionTypesOperations: +class SolutionTypesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4677,7 +5024,7 @@ class SolutionTypesOperations: :attr:`solution_types` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -4725,6 +5072,7 @@ def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) -> _m } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4739,11 +5087,14 @@ def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) -> _m except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTypeResource, response.json()) @@ -4755,7 +5106,7 @@ def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) -> _m @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.SolutionTypeResource"]: + ) -> ItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -4807,7 +5158,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4820,7 +5174,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4836,7 +5193,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4844,7 +5204,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SolutionTypeResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by subscription ID. :return: An iterator like instance of SolutionTypeResource @@ -4892,7 +5252,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4905,7 +5268,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4921,7 +5287,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py new file mode 100644 index 000000000000..5669f7fb686e --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py @@ -0,0 +1,694 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + CreatedByType, + GcpTemplateFormat, + HostType, + ProvisioningState, + ResourceProvisioningState, + ServiceName, + SolutionConfigurationStatus, + Type, + ) + + +class AwsCloudProfile(TypedDict, total=False): + """cloud profile for AWS. + + :ivar accountId: Account id for the AWS account. Required. + :vartype accountId: str + :ivar excludedAccounts: List of AWS accounts which need to be excluded. + :vartype excludedAccounts: list[str] + :ivar isOrganizationalAccount: Boolean value that indicates whether the account is + organizational or not. True represents organization account, whereas false represents a single + account. + :vartype isOrganizationalAccount: bool + """ + + accountId: Required[str] + """Account id for the AWS account. Required.""" + excludedAccounts: list[str] + """List of AWS accounts which need to be excluded.""" + isOrganizationalAccount: bool + """Boolean value that indicates whether the account is organizational or not. True represents + organization account, whereas false represents a single account.""" + + +class AwsCloudProfileUpdate(TypedDict, total=False): + """cloud profile for AWS. + + :ivar excludedAccounts: List of AWS accounts which need to be excluded. + :vartype excludedAccounts: list[str] + """ + + excludedAccounts: list[str] + """List of AWS accounts which need to be excluded.""" + + +class EndpointProperties(TypedDict, total=False): + """Endpoint details. + + :ivar type: The type of endpoint. Required. Known values are: "default" and "custom". + :vartype type: Union[str, "Type"] + :ivar resourceId: The resource Id of the connectivity endpoint (optional). + :vartype resourceId: str + :ivar provisioningState: The resource provisioning state. + :vartype provisioningState: str + """ + + type: Required[Union[str, "Type"]] + """The type of endpoint. Required. Known values are: \"default\" and \"custom\".""" + resourceId: str + """The resource Id of the connectivity endpoint (optional).""" + provisioningState: str + """The resource provisioning state.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ExtensionResource(Resource): + """The base extension resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class EndpointResource(ExtensionResource): + """The endpoint for the target resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The endpoint properties. + :vartype properties: "EndpointProperties" + """ + + properties: "EndpointProperties" + """The endpoint properties.""" + + +class GcpCloudProfile(TypedDict, total=False): + """cloud profile for GCP. + + :ivar projectProperties: The project properties of the GCP project. + :vartype projectProperties: "GcpProjectProperties" + :ivar organizationProperties: The organization properties of the GCP organization. + :vartype organizationProperties: "GcpOrganizationProperties" + """ + + projectProperties: "GcpProjectProperties" + """The project properties of the GCP project.""" + organizationProperties: "GcpOrganizationProperties" + """The organization properties of the GCP organization.""" + + +class GcpCloudProfileUpdate(TypedDict, total=False): + """cloud profile for GCP. + + :ivar organizationProperties: The organization properties of the GCP organization. + :vartype organizationProperties: "GcpOrganizationPropertiesUpdate" + """ + + organizationProperties: "GcpOrganizationPropertiesUpdate" + """The organization properties of the GCP organization.""" + + +class GcpOrganizationProperties(TypedDict, total=False): + """GCP organization properties. + + :ivar organizationId: The organization id of the GCP organization. Required. + :vartype organizationId: str + :ivar managementProjectNumber: The project number of the management project under the GCP + organization. Required. + :vartype managementProjectNumber: str + :ivar managementProjectId: The project Id of the management project under the GCP organization. + Required. + :vartype managementProjectId: str + :ivar excludedProjectNumbers: List of GCP projects which need to be excluded. + :vartype excludedProjectNumbers: list[str] + :ivar excludedFolderIds: List of GCP folders which need to be excluded. + :vartype excludedFolderIds: list[str] + """ + + organizationId: Required[str] + """The organization id of the GCP organization. Required.""" + managementProjectNumber: Required[str] + """The project number of the management project under the GCP organization. Required.""" + managementProjectId: Required[str] + """The project Id of the management project under the GCP organization. Required.""" + excludedProjectNumbers: list[str] + """List of GCP projects which need to be excluded.""" + excludedFolderIds: list[str] + """List of GCP folders which need to be excluded.""" + + +class GcpOrganizationPropertiesUpdate(TypedDict, total=False): + """GCP organization properties for update. + + :ivar excludedProjectNumbers: List of GCP projects which need to be excluded. + :vartype excludedProjectNumbers: list[str] + :ivar excludedFolderIds: List of GCP folders which need to be excluded. + :vartype excludedFolderIds: list[str] + """ + + excludedProjectNumbers: list[str] + """List of GCP projects which need to be excluded.""" + excludedFolderIds: list[str] + """List of GCP folders which need to be excluded.""" + + +class GcpProjectProperties(TypedDict, total=False): + """GCP project properties. + + :ivar projectNumber: The project number of the GCP project. Required. + :vartype projectNumber: str + :ivar projectId: The project id of the GCP project. Required. + :vartype projectId: str + """ + + projectNumber: Required[str] + """The project number of the GCP project. Required.""" + projectId: Required[str] + """The project id of the GCP project. Required.""" + + +class GenerateAwsTemplateRequest(TypedDict, total=False): + """ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + + :ivar connectorId: The name of public cloud connector. Required. + :vartype connectorId: str + :ivar solutionTypes: The list of solution types and their settings. + :vartype solutionTypes: list["SolutionTypeSettings"] + """ + + connectorId: Required[str] + """The name of public cloud connector. Required.""" + solutionTypes: list["SolutionTypeSettings"] + """The list of solution types and their settings.""" + + +class GenerateGcpTemplateRequest(TypedDict, total=False): + """ConnectorId and SolutionTypes and their properties to Generate GCP Access Control Template. + + :ivar connectorId: The name of public cloud connector. Required. + :vartype connectorId: str + :ivar solutionTypes: The list of solution types and their settings. + :vartype solutionTypes: list["SolutionTypeSettings"] + :ivar gcpCloudProfile: The GCP cloud profile. + :vartype gcpCloudProfile: "GcpCloudProfile" + :ivar gcpTemplateFormat: Optional template output format. Defaults to 'terraform' if not + provided. Known values are: "terraform" and "shellscript". + :vartype gcpTemplateFormat: Union[str, "GcpTemplateFormat"] + """ + + connectorId: Required[str] + """The name of public cloud connector. Required.""" + solutionTypes: list["SolutionTypeSettings"] + """The list of solution types and their settings.""" + gcpCloudProfile: "GcpCloudProfile" + """The GCP cloud profile.""" + gcpTemplateFormat: Union[str, "GcpTemplateFormat"] + """Optional template output format. Defaults to 'terraform' if not provided. Known values are: + \"terraform\" and \"shellscript\".""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class ListCredentialsRequest(TypedDict, total=False): + """The details of the service for which credentials needs to be returned. + + :ivar serviceName: The name of the service. If not provided, the request will by pass the + generation of service configuration token. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + """ + + serviceName: Union[str, "ServiceName"] + """The name of the service. If not provided, the request will by pass the generation of service + configuration token. Known values are: \"SSH\" and \"WAC\".""" + + +class ListIngressGatewayCredentialsRequest(TypedDict, total=False): + """Represent ListIngressGatewayCredentials Request object. + + :ivar serviceName: The name of the service. If not provided, the request will by pass the + generation of service configuration token. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + """ + + serviceName: Union[str, "ServiceName"] + """The name of the service. If not provided, the request will by pass the generation of service + configuration token. Known values are: \"SSH\" and \"WAC\".""" + + +class ManagedProxyRequest(TypedDict, total=False): + """Represent ManageProxy Request object. + + :ivar service: The name of the service. Required. + :vartype service: str + :ivar hostname: The target host name. + :vartype hostname: str + :ivar serviceName: The name of the service. It is an optional property, if not provided, + service configuration tokens issue code would be by passed. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + """ + + service: Required[str] + """The name of the service. Required.""" + hostname: str + """The target host name.""" + serviceName: Union[str, "ServiceName"] + """The name of the service. It is an optional property, if not provided, service configuration + tokens issue code would be by passed. Known values are: \"SSH\" and \"WAC\".""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class PublicCloudConnector(TrackedResource): + """Public Cloud Connector. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "PublicCloudConnectorProperties" + :ivar kind: The kind of the public cloud connector. Known values are: "AWS" and "GCP". + :vartype kind: Union[str, "HostType"] + """ + + properties: "PublicCloudConnectorProperties" + """The resource-specific properties for this resource.""" + kind: Union[str, "HostType"] + """The kind of the public cloud connector. Known values are: \"AWS\" and \"GCP\".""" + + +class PublicCloudConnectorProperties(TypedDict, total=False): + """Properties of public cloud connectors. + + :ivar awsCloudProfile: Cloud profile for AWS. + :vartype awsCloudProfile: "AwsCloudProfile" + :ivar gcpCloudProfile: Cloud profile for GCP. + :vartype gcpCloudProfile: "GcpCloudProfile" + :ivar hostType: Host cloud the public cloud connector. Required. Known values are: "AWS" and + "GCP". + :vartype hostType: Union[str, "HostType"] + :ivar provisioningState: The resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ResourceProvisioningState"] + :ivar connectorPrimaryIdentifier: Connector primary identifier. + :vartype connectorPrimaryIdentifier: str + """ + + awsCloudProfile: "AwsCloudProfile" + """Cloud profile for AWS.""" + gcpCloudProfile: "GcpCloudProfile" + """Cloud profile for GCP.""" + hostType: Required[Union[str, "HostType"]] + """Host cloud the public cloud connector. Required. Known values are: \"AWS\" and \"GCP\".""" + provisioningState: Union[str, "ResourceProvisioningState"] + """The resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and \"Canceled\".""" + connectorPrimaryIdentifier: str + """Connector primary identifier.""" + + +class PublicCloudConnectorPropertiesUpdate(TypedDict, total=False): + """Properties of public cloud connectors. + + :ivar awsCloudProfile: Cloud profile for AWS. + :vartype awsCloudProfile: "AwsCloudProfileUpdate" + :ivar gcpCloudProfile: Cloud profile for GCP. + :vartype gcpCloudProfile: "GcpCloudProfileUpdate" + """ + + awsCloudProfile: "AwsCloudProfileUpdate" + """Cloud profile for AWS.""" + gcpCloudProfile: "GcpCloudProfileUpdate" + """Cloud profile for GCP.""" + + +class TrackedResourceUpdate(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: dict[str, str] + """Resource tags.""" + + +class PublicCloudConnectorUpdate(TrackedResourceUpdate): + """Public Cloud Connector. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "PublicCloudConnectorPropertiesUpdate" + """ + + properties: "PublicCloudConnectorPropertiesUpdate" + """The resource-specific properties for this resource.""" + + +class ServiceConfigurationProperties(TypedDict, total=False): + """Service configuration details. + + :ivar serviceName: Name of the service. Required. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + :ivar resourceId: The resource Id of the connectivity endpoint (optional). + :vartype resourceId: str + :ivar port: The port on which service is enabled. + :vartype port: int + :ivar provisioningState: The resource provisioning state. Known values are: "Succeeded", + "Creating", "Updating", "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + serviceName: Required[Union[str, "ServiceName"]] + """Name of the service. Required. Known values are: \"SSH\" and \"WAC\".""" + resourceId: str + """The resource Id of the connectivity endpoint (optional).""" + port: int + """The port on which service is enabled.""" + provisioningState: Union[str, "ProvisioningState"] + """The resource provisioning state. Known values are: \"Succeeded\", \"Creating\", \"Updating\", + \"Failed\", and \"Canceled\".""" + + +class ServiceConfigurationPropertiesPatch(TypedDict, total=False): + """Service configuration details. + + :ivar port: The port on which service is enabled. + :vartype port: int + """ + + port: int + """The port on which service is enabled.""" + + +class ServiceConfigurationResource(ExtensionResource): + """The service configuration details associated with the target resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The service configuration properties. + :vartype properties: "ServiceConfigurationProperties" + """ + + properties: "ServiceConfigurationProperties" + """The service configuration properties.""" + + +class ServiceConfigurationResourcePatch(TypedDict, total=False): + """The service details under service configuration for the target endpoint resource. + + :ivar properties: The service configuration properties. + :vartype properties: "ServiceConfigurationPropertiesPatch" + """ + + properties: "ServiceConfigurationPropertiesPatch" + """The service configuration properties.""" + + +class SolutionConfiguration(ExtensionResource): + """Solution Configuration. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SolutionConfigurationProperties" + """ + + properties: "SolutionConfigurationProperties" + """The resource-specific properties for this resource.""" + + +class SolutionConfigurationProperties(TypedDict, total=False): + """Solution configuration resource. + + :ivar provisioningState: The resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ResourceProvisioningState"] + :ivar solutionType: The type of the solution. Required. + :vartype solutionType: str + :ivar solutionSettings: Solution settings. + :vartype solutionSettings: "SolutionSettings" + :ivar status: The status of solution configurations. Known values are: "New", "InProgress", + "Completed", and "Failed". + :vartype status: Union[str, "SolutionConfigurationStatus"] + :ivar statusDetails: The detailed message of status details. + :vartype statusDetails: str + :ivar lastSyncTime: The last time resources were inventoried. + :vartype lastSyncTime: str + """ + + provisioningState: Union[str, "ResourceProvisioningState"] + """The resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and \"Canceled\".""" + solutionType: Required[str] + """The type of the solution. Required.""" + solutionSettings: "SolutionSettings" + """Solution settings.""" + status: Union[str, "SolutionConfigurationStatus"] + """The status of solution configurations. Known values are: \"New\", \"InProgress\", + \"Completed\", and \"Failed\".""" + statusDetails: str + """The detailed message of status details.""" + lastSyncTime: str + """The last time resources were inventoried.""" + + +class SolutionConfigurationPropertiesUpdate(TypedDict, total=False): + """Solution configuration resource. + + :ivar solutionType: The type of the solution. + :vartype solutionType: str + :ivar solutionSettings: Solution settings. + :vartype solutionSettings: "SolutionSettings" + """ + + solutionType: str + """The type of the solution.""" + solutionSettings: "SolutionSettings" + """Solution settings.""" + + +class SolutionConfigurationUpdate(ProxyResource): + """Solution Configuration. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SolutionConfigurationPropertiesUpdate" + """ + + properties: "SolutionConfigurationPropertiesUpdate" + """The resource-specific properties for this resource.""" + + +class SolutionSettings(TypedDict, total=False): + """Solution settings.""" + + +class SolutionTypeSettings(TypedDict, total=False): + """The properties of Solution Type. + + :ivar solutionType: The type of the solution. Required. + :vartype solutionType: str + :ivar solutionSettings: Solution settings. + :vartype solutionSettings: "SolutionSettings" + """ + + solutionType: Required[str] + """The type of the solution. Required.""" + solutionSettings: "SolutionSettings" + """Solution settings.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_custom.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_maximum_set_gen.py similarity index 91% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_custom.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_maximum_set_gen.py index 7403a1f4faf6..b6e47969b0da 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_custom.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_put_custom.py + python endpoints_create_or_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,7 +33,7 @@ def main(): response = client.endpoints.create_or_update( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="custom", + endpoint_name="qlgk", endpoint_resource={ "properties": { "resourceId": "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace", @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2024-12-01/EndpointsPutCustom.json +# x-ms-original-file: 2027-01-01/Endpoints_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_minimum_set_gen.py similarity index 68% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_minimum_set_gen.py index c5dac2d4e473..f0ae626341eb 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_put_default.py + python endpoints_create_or_update_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,12 +33,25 @@ def main(): response = client.endpoints.create_or_update( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", - endpoint_resource={"properties": {"type": "default"}}, + endpoint_name="brvzkuhspeph", + endpoint_resource={ + "id": "str", + "name": "str", + "properties": {"type": "str", "provisioningState": "str", "resourceId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPutDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_CreateOrUpdate_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py new file mode 100644 index 000000000000..a83c4c6f1c15 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.endpoints.delete( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="bzibyvoiurhaqyjfcvvmtqqxp", + ) + + +# x-ms-original-file: 2027-01-01/Endpoints_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_minimum_set_gen.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_minimum_set_gen.py index d990167ecbde..e5c0b4275419 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_delete_default.py + python endpoints_delete_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,10 +33,10 @@ def main(): client.endpoints.delete( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", + endpoint_name="hnsdhce", ) -# x-ms-original-file: 2024-12-01/EndpointsDeleteDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_custom.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_maximum_set_gen.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_custom.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_maximum_set_gen.py index 5b064606b69b..a4fad94cb63a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_custom.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_get_custom.py + python endpoints_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,11 +33,11 @@ def main(): response = client.endpoints.get( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="custom", + endpoint_name="dvibtlitlirlrljqjavewemmh", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsGetCustom.json +# x-ms-original-file: 2027-01-01/Endpoints_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_minimum_set_gen.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_minimum_set_gen.py index a925e639d79e..91f02be82539 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_get_default.py + python endpoints_get_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,11 +33,11 @@ def main(): response = client.endpoints.get( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", + endpoint_name="mtmtfiytugklrzlgsbfllkffmpbit", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsGetDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_patch_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_patch_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_maximum_set_gen.py index b5a77a5d385f..75fec8c1f79b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_patch_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_patch_default.py + python endpoints_list_credentials_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,14 +31,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.endpoints.update( + response = client.endpoints.list_credentials( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", - endpoint_resource={"properties": {"type": "default"}}, + endpoint_name="zctvtuhbhezloxvc", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPatchDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_ListCredentials_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_credentials.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_minimum_set_gen.py similarity index 89% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_credentials.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_minimum_set_gen.py index 0ab64a25f79f..5cbd168effe1 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_credentials.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_post_list_credentials.py + python endpoints_list_credentials_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,11 +33,11 @@ def main(): response = client.endpoints.list_credentials( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", + endpoint_name="yfaebuxkhicaact", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPostListCredentials.json +# x-ms-original-file: 2027-01-01/Endpoints_ListCredentials_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py new file mode 100644 index 000000000000..89996ea2961f --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_list_ingress_gateway_credentials_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list_ingress_gateway_credentials( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="csjtwwrsv", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_ListIngressGatewayCredentials_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py new file mode 100644 index 000000000000..e631c550c63b --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_list_ingress_gateway_credentials_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list_ingress_gateway_credentials( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="acwtmooqweqqgfcz", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_ListIngressGatewayCredentials_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_managed_proxy_details.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_managed_proxy_details.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_maximum_set_gen.py index c7c1d7a6de45..41ffbfebf084 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_managed_proxy_details.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_post_list_managed_proxy_details.py + python endpoints_list_managed_proxy_details_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,13 +32,13 @@ def main(): ) response = client.endpoints.list_managed_proxy_details( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006", - endpoint_name="default", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="bjamsbnl", managed_proxy_request={"hostname": "r.proxy.arc.com", "service": "127.0.0.1:65035", "serviceName": "WAC"}, ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPostListManagedProxyDetails.json +# x-ms-original-file: 2027-01-01/Endpoints_ListManagedProxyDetails_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py new file mode 100644 index 000000000000..394a7da73ddf --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_list_managed_proxy_details_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list_managed_proxy_details( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="ujpppanchofwgjdv", + managed_proxy_request={"service": "127.0.0.1:65035"}, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_ListManagedProxyDetails_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_maximum_set_gen.py similarity index 93% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_maximum_set_gen.py index f2119dc657ab..86246082edcf 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_list.py + python endpoints_list_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/EndpointsList.json +# x-ms-original-file: 2027-01-01/Endpoints_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py deleted file mode 100644 index e47dfa6dae19..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python endpoints_post_list_ingress_gateway_credentials.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.endpoints.list_ingress_gateway_credentials( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0", - endpoint_name="default", - ) - print(response) - - -# x-ms-original-file: 2024-12-01/EndpointsPostListIngressGatewayCredentials.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py new file mode 100644 index 000000000000..52040e335fdd --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py @@ -0,0 +1,49 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_update_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="rukckncxq", + endpoint_resource={ + "properties": { + "resourceId": "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace", + "type": "custom", + } + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py new file mode 100644 index 000000000000..5512625cc680 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py @@ -0,0 +1,57 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_update_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="xmbtuwprx", + endpoint_resource={ + "id": "str", + "name": "str", + "properties": {"type": "str", "provisioningState": "str", "resourceId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_Update_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_maximum_set_gen.py similarity index 91% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_maximum_set_gen.py index 1066b00687da..32754071c84b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python generate_aws_template_post.py + python generate_aws_template_post_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2024-12-01/GenerateAwsTemplate_Post.json +# x-ms-original-file: 2027-01-01/GenerateAwsTemplate_Post_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_minimum_set_gen.py similarity index 83% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_minimum_set_gen.py index 2336cdc8064f..a2efa0aeada6 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_configurations_get.py + python generate_aws_template_post_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.solution_configurations.get( - resource_uri="ymuj", - solution_configuration="tks", + response = client.generate_aws_template.post( + generate_aws_template_request={"connectorId": "pnxcfjidglabnwxit"}, ) print(response) -# x-ms-original-file: 2024-12-01/SolutionConfigurations_Get.json +# x-ms-original-file: 2027-01-01/GenerateAwsTemplate_Post_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py new file mode 100644 index 000000000000..f36de84be852 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python generate_gcp_template_post_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.generate_gcp_template.post( + generate_gcp_template_request={ + "connectorId": "lvrdneuerxztxiixlzswcbm", + "gcpCloudProfile": { + "organizationProperties": { + "excludedFolderIds": ["xxl"], + "excludedProjectNumbers": ["sepdnfxmhcrubtklwllxfbhju"], + "managementProjectId": "mjubieitixhpmid", + "managementProjectNumber": "mjubieitixhpm", + "organizationId": "vqlzghfdinlamurmg", + }, + "projectProperties": {"projectId": "mjubieitixhpmid", "projectNumber": "mjubieitixhpm"}, + }, + "gcpTemplateFormat": "terraform", + "solutionTypes": [{"solutionSettings": {}, "solutionType": "hjyownzpfxwiufmd"}], + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/GenerateGcpTemplate_Post_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_minimum_set_gen.py similarity index 82% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_minimum_set_gen.py index 5e17790500da..416965fbedac 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python inventory_get.py + python generate_gcp_template_post_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.inventory.get( - resource_uri="ymuj", - solution_configuration="zarfsraogroxlaqjjnwixtn", - inventory_id="xofprmcboosrbd", + response = client.generate_gcp_template.post( + generate_gcp_template_request={"connectorId": "lvrdneuerxztxiixlzswcbm"}, ) print(response) -# x-ms-original-file: 2024-12-01/Inventory_Get.json +# x-ms-original-file: 2027-01-01/GenerateGcpTemplate_Post_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py new file mode 100644 index 000000000000..e77c2c6b32fd --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python inventory_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.inventory.get( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + inventory_id="pr", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Inventory_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py new file mode 100644 index 000000000000..76debcd63662 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python inventory_list_by_solution_configuration_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.inventory.list_by_solution_configuration( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/Inventory_ListBySolutionConfiguration_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_maximum_set_gen.py similarity index 92% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_maximum_set_gen.py index 37c83bea655e..d5179ec43a18 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python operations_list.py + python operations_list_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/OperationsList.json +# x-ms-original-file: 2027-01-01/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_minimum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_minimum_set_gen.py index 09ee5a33bd61..359ee9f9e484 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_configurations_list.py + python operations_list_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,11 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.solution_configurations.list( - resource_uri="ymuj", - ) + response = client.operations.list() for item in response: print(item) -# x-ms-original-file: 2024-12-01/SolutionConfigurations_List.json +# x-ms-original-file: 2027-01-01/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update_maximum_set_gen.py similarity index 67% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update_maximum_set_gen.py index 2ae2b64558f6..d400407bf7b2 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_create_or_update.py + python public_cloud_connectors_create_or_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,9 +31,10 @@ def main(): ) response = client.public_cloud_connectors.begin_create_or_update( - resource_group_name="rgpublicCloud", - public_cloud_connector="advjwoakdusalamomg", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", resource={ + "kind": "AWS", "location": "jpiglusfxynfcewcjwvvnn", "properties": { "awsCloudProfile": { @@ -41,6 +42,16 @@ def main(): "excludedAccounts": ["rwgqpukglvbqmogqcliqolucp"], "isOrganizationalAccount": True, }, + "gcpCloudProfile": { + "organizationProperties": { + "excludedFolderIds": ["xxl"], + "excludedProjectNumbers": ["sepdnfxmhcrubtklwllxfbhju"], + "managementProjectId": "mjubieitixhpmid", + "managementProjectNumber": "mjubieitixhpm", + "organizationId": "vqlzghfdinlamurmg", + }, + "projectProperties": {"projectId": "mjubieitixhpmid", "projectNumber": "mjubieitixhpm"}, + }, "hostType": "AWS", }, "tags": {}, @@ -49,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_CreateOrUpdate.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete_maximum_set_gen.py index 28be4687c3bd..996d4e922e67 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_delete.py + python public_cloud_connectors_delete_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,11 +31,11 @@ def main(): ) client.public_cloud_connectors.delete( - resource_group_name="rgpublicCloud", - public_cloud_connector="skcfyjvflkhibdywjay", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", ) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_Delete.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get_maximum_set_gen.py index 0e6d58803435..533a5a6f62ee 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_get.py + python public_cloud_connectors_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.public_cloud_connectors.get( - resource_group_name="rgpublicCloud", - public_cloud_connector="rzygvnpsnrdylwzdbsscjazvamyxmh", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", ) print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_Get.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_maximum_set_gen.py index 34a973973d0b..4908e284bf2c 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_list_by_resource_group.py + python public_cloud_connectors_list_by_resource_group_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.public_cloud_connectors.list_by_resource_group( - resource_group_name="rgpublicCloud", + resource_group_name="rghybridconnectivity", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListByResourceGroup.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_minimum_set_gen.py similarity index 81% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_minimum_set_gen.py index 2e16b13759e5..42cf95c7be51 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python inventory_list_by_solution_configuration.py + python public_cloud_connectors_list_by_resource_group_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.inventory.list_by_solution_configuration( - resource_uri="ymuj", - solution_configuration="wsxt", + response = client.public_cloud_connectors.list_by_resource_group( + resource_group_name="rghybridconnectivity", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/Inventory_ListBySolutionConfiguration.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListByResourceGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_maximum_set_gen.py similarity index 88% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_maximum_set_gen.py index 666105c95057..fff03865acbc 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_list_by_subscription.py + python public_cloud_connectors_list_by_subscription_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListBySubscription.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py new file mode 100644 index 000000000000..aabcea115d8a --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python public_cloud_connectors_list_by_subscription_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.public_cloud_connectors.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListBySubscription_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions_maximum_set_gen.py index f23d2eaddce1..27d051ffd9b4 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_test_permissions.py + python public_cloud_connectors_test_permissions_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.public_cloud_connectors.begin_test_permissions( - resource_group_name="rgpublicCloud", - public_cloud_connector="rzygvnpsnrdylwzdbsscjazvamyxmh", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", ).result() print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_TestPermissions.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_TestPermissions_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update_maximum_set_gen.py index d7f0b0bb4c65..8bbe7703221a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_update.py + python public_cloud_connectors_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,13 +31,13 @@ def main(): ) response = client.public_cloud_connectors.update( - resource_group_name="rgpublicCloud", - public_cloud_connector="svtirlbyqpepbzyessjenlueeznhg", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", properties={"properties": {"awsCloudProfile": {"excludedAccounts": ["zrbtd"]}}, "tags": {}}, ) print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_Update.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_create_orupdate_maximum_set_gen.py similarity index 71% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_create_orupdate_maximum_set_gen.py index 5be08c0943f7..5f0f1bc76716 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_create_orupdate_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_put_ssh.py + python service_configurations_create_orupdate_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,14 +32,20 @@ def main(): ) response = client.service_configurations.create_orupdate( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", - service_configuration_resource={"properties": {"port": 22, "serviceName": "SSH"}}, + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="djevinbielhfx", + service_configuration_name="inlnklujw", + service_configuration_resource={ + "properties": { + "port": 22, + "resourceId": "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + "serviceName": "SSH", + } + }, ) print(response) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsPutSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_CreateOrupdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_maximum_set_gen.py index 91f6675db329..5661ad4da55b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_delete_ssh.py + python service_configurations_delete_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,12 +32,12 @@ def main(): ) client.service_configurations.delete( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="ureaofizl", + service_configuration_name="ptkmrkoxmvcmvhdzxkd", ) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsDeleteSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py new file mode 100644 index 000000000000..226d82115443 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python service_configurations_delete_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.service_configurations.delete( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="ykrzxbnhnszoikyge", + service_configuration_name="qwaxkaulnvwsspqjblxrlxtlyfr", + ) + + +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Delete_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_maximum_set_gen.py index 62e5f3f1e435..28b719b584ed 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_get_ssh.py + python service_configurations_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,13 +32,13 @@ def main(): ) response = client.service_configurations.get( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="qxkrgoqcdbdduowdxphfmfjpe", + service_configuration_name="bdahzuetmihmfsvxrtegqzkybmjbfu", ) print(response) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsGetSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py deleted file mode 100644 index 82e103a95f6e..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python service_configurations_get_wac.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.service_configurations.get( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="WAC", - ) - print(response) - - -# x-ms-original-file: 2024-12-01/ServiceConfigurationsGetWAC.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list_by_endpoint_resource_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list_by_endpoint_resource_maximum_set_gen.py index 1853241e8583..0b507ee9501b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list_by_endpoint_resource_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_list.py + python service_configurations_list_by_endpoint_resource_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,13 +32,13 @@ def main(): ) response = client.service_configurations.list_by_endpoint_resource( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="azklihfwffrqohr", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsList.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_ListByEndpointResource_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py deleted file mode 100644 index ea4eacb31787..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python service_configurations_put_wac.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.service_configurations.create_orupdate( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="WAC", - service_configuration_resource={"properties": {"port": 6516, "serviceName": "WAC"}}, - ) - print(response) - - -# x-ms-original-file: 2024-12-01/ServiceConfigurationsPutWAC.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_patch_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_update_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_patch_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_update_maximum_set_gen.py index ea10444f75ff..841fab51f584 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_patch_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_update_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_patch_ssh.py + python service_configurations_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,14 +32,14 @@ def main(): ) response = client.service_configurations.update( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="bsbpgdlspjhyjgpoxxsoptu", + service_configuration_name="dcdbyycehygofsazwxadc", service_configuration_resource={"properties": {"port": 22}}, ) print(response) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsPatchSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py deleted file mode 100644 index 26f4bbdefbea..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.solution_configurations.create_or_update( - resource_uri="ymuj", - solution_configuration="keebwujt", - resource={"properties": {"solutionSettings": {}, "solutionType": "nmtqllkyohwtsthxaimsye"}}, - ) - print(response) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py new file mode 100644 index 000000000000..005587c20bbb --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_create_or_update_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.create_or_update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + resource={ + "properties": { + "solutionSettings": {}, + "solutionType": "nmtqllkyohwtsthxaimsye", + "status": "AuthorizationPending", + } + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_CreateOrUpdate_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py deleted file mode 100644 index 3debd7031a00..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.solution_configurations.delete( - resource_uri="ymuj", - solution_configuration="stu", - ) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py new file mode 100644 index 000000000000..c5a41fcfe208 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.solution_configurations.delete( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py new file mode 100644 index 000000000000..2981d80cb6ff --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.get( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py new file mode 100644 index 000000000000..cf99bda57597 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_list_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.list( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_List_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py new file mode 100644 index 000000000000..cfd4ab156713 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_list_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.list( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_List_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py deleted file mode 100644 index a7eb795625ee..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_sync_now.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.solution_configurations.begin_sync_now( - resource_uri="ymuj", - solution_configuration="tks", - ).result() - print(response) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_SyncNow.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py new file mode 100644 index 000000000000..03edd9c6fb20 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_sync_now_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.begin_sync_now( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ).result() + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_SyncNow_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py deleted file mode 100644 index 2093d7a5b254..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.solution_configurations.update( - resource_uri="ymuj", - solution_configuration="dxt", - properties={"properties": {"solutionSettings": {}, "solutionType": "myzljlstvmgkp"}}, - ) - print(response) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py new file mode 100644 index 000000000000..f85b409fba28 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_update_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + properties={"properties": {"solutionSettings": {}, "solutionType": "myzljlstvmgkp"}}, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get_maximum_set_gen.py index fa0ca5cada1b..4e494eed3d1c 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_types_get.py + python solution_types_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.solution_types.get( - resource_group_name="rgpublicCloud", - solution_type="lulzqllpu", + resource_group_name="rghybridconnectivity", + solution_type="uekzhgszlxyljiagul", ) print(response) -# x-ms-original-file: 2024-12-01/SolutionTypes_Get.json +# x-ms-original-file: 2027-01-01/SolutionTypes_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group_maximum_set_gen.py index abfbfd9cd169..2c0c67ef1165 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_types_list_by_resource_group.py + python solution_types_list_by_resource_group_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.solution_types.list_by_resource_group( - resource_group_name="rgpublicCloud", + resource_group_name="rghybridconnectivity", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/SolutionTypes_ListByResourceGroup.json +# x-ms-original-file: 2027-01-01/SolutionTypes_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription_maximum_set_gen.py similarity index 89% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription_maximum_set_gen.py index 08db69b66d5d..cd14b14c9cdc 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_types_list_by_subscription.py + python solution_types_list_by_subscription_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/SolutionTypes_ListBySubscription.json +# x-ms-original-file: 2027-01-01/SolutionTypes_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py new file mode 100644 index 000000000000..7ee66a9fe94b --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridConnectivityMgmtGenerateGcpTemplateOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridConnectivityMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_generate_gcp_template_post(self, resource_group): + response = self.client.generate_gcp_template.post( + generate_gcp_template_request={ + "connectorId": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, + "gcpTemplateFormat": "str", + "solutionTypes": [{"solutionType": "str", "solutionSettings": {}}], + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py new file mode 100644 index 000000000000..3b1439878716 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridconnectivity.aio import HybridConnectivityMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridConnectivityMgmtGenerateGcpTemplateOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridConnectivityMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_generate_gcp_template_post(self, resource_group): + response = await self.client.generate_gcp_template.post( + generate_gcp_template_request={ + "connectorId": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, + "gcpTemplateFormat": "str", + "solutionTypes": [{"solutionType": "str", "solutionSettings": {}}], + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py index db734cbd0900..0223c8a18bca 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py @@ -38,15 +38,26 @@ def test_public_cloud_connectors_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "kind": "str", "name": "str", "properties": { + "hostType": "str", "awsCloudProfile": { "accountId": "str", "excludedAccounts": ["str"], "isOrganizationalAccount": bool, }, - "hostType": "str", "connectorPrimaryIdentifier": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, "provisioningState": "str", }, "systemData": { @@ -74,7 +85,12 @@ def test_public_cloud_connectors_update(self, resource_group): properties={ "id": "str", "name": "str", - "properties": {"awsCloudProfile": {"excludedAccounts": ["str"]}}, + "properties": { + "awsCloudProfile": {"excludedAccounts": ["str"]}, + "gcpCloudProfile": { + "organizationProperties": {"excludedFolderIds": ["str"], "excludedProjectNumbers": ["str"]} + }, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py index 56d7587dbf9f..71ae890ef569 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py @@ -40,15 +40,26 @@ async def test_public_cloud_connectors_begin_create_or_update(self, resource_gro resource={ "location": "str", "id": "str", + "kind": "str", "name": "str", "properties": { + "hostType": "str", "awsCloudProfile": { "accountId": "str", "excludedAccounts": ["str"], "isOrganizationalAccount": bool, }, - "hostType": "str", "connectorPrimaryIdentifier": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, "provisioningState": "str", }, "systemData": { @@ -77,7 +88,12 @@ async def test_public_cloud_connectors_update(self, resource_group): properties={ "id": "str", "name": "str", - "properties": {"awsCloudProfile": {"excludedAccounts": ["str"]}}, + "properties": { + "awsCloudProfile": {"excludedAccounts": ["str"]}, + "gcpCloudProfile": { + "organizationProperties": {"excludedFolderIds": ["str"], "excludedProjectNumbers": ["str"]} + }, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml index 540da07d41af..df4007a6fc16 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-hybridconnectivity" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Hybridconnectivity Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.hybridconnectivity._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-hybridconnectivity" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Hybridconnectivity Management" +package_doc_id = "" +is_stable = true +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "HybridConnectivityMgmtClient" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml deleted file mode 100644 index 0fdff035cd3b..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-hybridconnectivity" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Hybridconnectivity Management" -package_doc_id = "" -is_stable = true -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "HybridConnectivityMgmtClient" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py deleted file mode 100644 index 2903ec83b38d..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-hybridconnectivity" -PACKAGE_PPRINT_NAME = "Hybridconnectivity Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml index 86e8c4272404..483401d6df3e 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/hybridconnectivity/HybridConnectivity.Management -commit: 3db6867b8e524ea6d1bc7a3bbb989fe50dd2f184 +commit: 47515ad36204e02e14c3b62414beebca92abb4a2 repo: Azure/azure-rest-api-specs additionalDirectories: From 1779f04c0cfe495d699e707c9673e9fb1b237caf Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:34:23 -0600 Subject: [PATCH 24/35] Sync eng/common directory with azure-sdk-tools for PR 17383 (#49661) * Add package name and package version to logs. * Pass dummy hash when no hash is provided. * Revert "Pass dummy hash when no hash is provided." This reverts commit 3449133ed429c799db553ea5e2a96a69aa7cc5ed. --------- Co-authored-by: Travis Prescott --- .../scripts/Get-PackageApprovalStatus.ps1 | 13 +++++---- .../tests/Get-PackageApprovalStatus.Tests.ps1 | 28 +++++++++++++++++-- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/eng/common/scripts/Get-PackageApprovalStatus.ps1 b/eng/common/scripts/Get-PackageApprovalStatus.ps1 index 642add267c79..c3107bbc31fe 100644 --- a/eng/common/scripts/Get-PackageApprovalStatus.ps1 +++ b/eng/common/scripts/Get-PackageApprovalStatus.ps1 @@ -4,6 +4,7 @@ Checks whether a package is approved for release. .DESCRIPTION Invokes the centralized Azure SDK CLI API review release gate and fails unless its structured result approves the package. +Approval summary headings include the package name and version to distinguish packages in CI logs. .PARAMETER PackageInfoFiles Package-info JSON files containing the package name, version, and optional API hash. @@ -58,25 +59,25 @@ function Write-BackendStatus([string] $Name, [object] $Status) { } } -function Write-ApprovalSummary([object] $Response) { +function Write-ApprovalSummary([object] $Response, [string] $PackageName, [string] $PackageVersion) { $result = $Response.result $source = if ($result.PSObject.Properties["finalSource"]) { $result.finalSource } else { "unknown" } $reason = if ($result.PSObject.Properties["reason"]) { $result.reason } else { "none" } Write-Host "" - Write-Host "Approval results" + Write-Host "Approval Results ($PackageName $PackageVersion)" Write-Host "----------------" if ($result.PSObject.Properties["reviewHub"]) { - Write-BackendStatus "API Review Hub" $result.reviewHub + Write-BackendStatus "API Review Hub ($PackageName $PackageVersion)" $result.reviewHub } if ($result.PSObject.Properties["apiView"]) { Write-Host "" - Write-BackendStatus "APIView" $result.apiView + Write-BackendStatus "APIView ($PackageName $PackageVersion)" $result.apiView } $approval = if ($result.isApproved) { "APPROVED" } else { "NOT APPROVED" } Write-Host "" - Write-Host "Overall" + Write-Host "Overall ($PackageName $PackageVersion)" Write-Host " Status: $approval" Write-Host " Source: $source" Write-Host " Reason: $reason" @@ -120,7 +121,7 @@ function Test-PackageApproval([string] $PackageName, [string] $PackageVersion, [ $null -ne $response.result -and $response.result.PSObject.Properties["isApproved"] -and $response.result.isApproved -is [bool]) { - Write-ApprovalSummary $response + Write-ApprovalSummary $response $PackageName $PackageVersion } if ($exitCode -ne 0) { diff --git a/eng/common/scripts/tests/Get-PackageApprovalStatus.Tests.ps1 b/eng/common/scripts/tests/Get-PackageApprovalStatus.Tests.ps1 index d6a744e3d937..6f86148236a6 100644 --- a/eng/common/scripts/tests/Get-PackageApprovalStatus.Tests.ps1 +++ b/eng/common/scripts/tests/Get-PackageApprovalStatus.Tests.ps1 @@ -125,9 +125,31 @@ Describe "Get-PackageApprovalStatus.ps1" { $messages = @(& $scriptPath -PackageInfoFiles $packageInfoPath 6>&1) | ForEach-Object { "$_" } - [Array]::IndexOf($messages, "API Review Hub") | Should BeLessThan ([Array]::IndexOf($messages, "APIView")) - [Array]::IndexOf($messages, "APIView") | Should BeLessThan ([Array]::IndexOf($messages, "Overall")) - ($messages -join [Environment]::NewLine) | Should Match "Overall\r?\n Status: APPROVED\r?\n Source: APIView\r?\n Reason: approved" + foreach ($heading in @("Approval Results", "API Review Hub", "APIView", "Overall")) { + @($messages | Where-Object { $_ -eq "$heading (azure-test 1.0.0)" }).Count | Should Be 1 + } + [Array]::IndexOf($messages, "API Review Hub (azure-test 1.0.0)") | Should BeLessThan ([Array]::IndexOf($messages, "APIView (azure-test 1.0.0)")) + [Array]::IndexOf($messages, "APIView (azure-test 1.0.0)") | Should BeLessThan ([Array]::IndexOf($messages, "Overall (azure-test 1.0.0)")) + ($messages -join [Environment]::NewLine) | Should Match "Overall \(azure-test 1\.0\.0\)\r?\n Status: APPROVED\r?\n Source: APIView\r?\n Reason: approved" + } + + It "includes each package name and version in all summary headings when checking multiple packages" { + $secondPackageInfoPath = Join-Path $TestDrive "azure-other.json" + @{ + Name = "azure-other" + Version = "2.0.0b1" + } | ConvertTo-Json | Set-Content $secondPackageInfoPath + $global:AzSdkOutput = '{"operation_status":"Succeeded","result":{"isApproved":true,"finalSource":"APIView","reason":"approved","reviewHub":{"isApproved":false,"reason":"repositoryNotSupported","statusCode":200},"apiView":{"isApproved":true,"reason":"approved","statusCode":200}}}' + + $messages = @(& $scriptPath -PackageInfoFiles @($packageInfoPath, $secondPackageInfoPath) 6>&1) | + ForEach-Object { "$_" } + + foreach ($package in @("azure-test 1.0.0", "azure-other 2.0.0b1")) { + foreach ($heading in @("Approval Results", "API Review Hub", "APIView", "Overall")) { + @($messages | Where-Object { $_ -eq "$heading ($package)" }).Count | Should Be 1 + } + } + $global:CapturedAzSdkInvocations.Count | Should Be 2 } It "includes raw output when azsdk returns malformed output" { From 5f632656b9cbd1eb964b3bc931bc256220f1d0cc Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 13:35:19 -0700 Subject: [PATCH 25/35] Sync eng/common directory with azure-sdk-tools for PR 17350 (#49660) * Upgrade Vally to 0.19.0 for App-token MCP evaluations * Restore public npm metadata in Vally locks Co-authored-by: helen229 <19517014+helen229@users.noreply.github.com> * Sync eng/common directory with azure-sdk-tools repository for Tools PR 17350 * Keep eval transitive dependencies available in CI mirror * Align eval tooling with Node 24 requirements --------- Co-authored-by: helen229 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: helen229 <19517014+helen229@users.noreply.github.com> Co-authored-by: azure-sdk --- .../templates/jobs/generate-eval-matrix.yml | 4 +- eng/common/scripts/eval/README.md | 7 +- eng/common/scripts/eval/package-lock.json | 2748 +++++++++++++---- eng/common/scripts/eval/package.json | 4 +- .../eval/publisher/test/publisher.test.ts | 12 +- 5 files changed, 2112 insertions(+), 663 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/generate-eval-matrix.yml b/eng/common/pipelines/templates/jobs/generate-eval-matrix.yml index 688a1018bfb7..02c2243b8eb5 100644 --- a/eng/common/pipelines/templates/jobs/generate-eval-matrix.yml +++ b/eng/common/pipelines/templates/jobs/generate-eval-matrix.yml @@ -22,9 +22,9 @@ jobs: fetchDepth: 1 - task: UseNode@1 - displayName: 'Use Node.js 22.x' + displayName: 'Use Node.js 24.x' inputs: - version: 22.x + version: 24.x # set -f stops the shell expanding the glob `*` before patterns reach the script. - script: | diff --git a/eng/common/scripts/eval/README.md b/eng/common/scripts/eval/README.md index 75d7beabb268..0fd3b593a885 100644 --- a/eng/common/scripts/eval/README.md +++ b/eng/common/scripts/eval/README.md @@ -185,10 +185,9 @@ relax TLS or broaden permissions to hide a failed request. ## TypeScript (no build step) The `*.ts` sources run directly through Node's native type stripping (erasable syntax only — -no `enum`/`namespace`/parameter properties, no emit). Shard/Summary jobs and publisher -CI use Node `24.x`; the publisher requires `>=24.14.1`. The older dependency-free -glue still supports its declared Node 22 minimum, but that is not the publisher's -runtime requirement. Relative imports use explicit `.ts` specifiers, as Node requires. +no `enum`/`namespace`/parameter properties, no emit). Matrix/Shard/Summary jobs and publisher +CI use Node `24.x`; both evaluator projects and the publisher require `>=24.14.1`, +matching azure-rest-api-specs. Relative imports use explicit `.ts` specifiers, as Node requires. The standalone Blob publisher uses the same execution model; it adds no compiler or TypeScript runtime dependency. ## Vendored files diff --git a/eng/common/scripts/eval/package-lock.json b/eng/common/scripts/eval/package-lock.json index 46258252c6e9..a3b49fce9950 100644 --- a/eng/common/scripts/eval/package-lock.json +++ b/eng/common/scripts/eval/package-lock.json @@ -8,10 +8,28 @@ "name": "@azure-tools/eval-scripts", "version": "1.0.0", "devDependencies": { - "@microsoft/vally-cli": "0.14.0" + "@microsoft/vally-cli": "0.19.0" }, "engines": { - "node": ">=22.12.0" + "node": ">=24.14.1" + } + }, + "node_modules/@azure-rest/core-client": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-2.9.0.tgz", + "integrity": "sha512-6933vNLqh06RR7rumnrq3UZIeBtRLeBHDPMrieDPIljiCaMMwt0nRw++nd3TOxiohtasNtm29rC+b/9ZVKCOqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.10.0", + "@azure/core-rest-pipeline": "^1.24.0", + "@azure/core-tracing": "^1.3.0", + "@typespec/ts-http-runtime": "^0.3.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=22.0.0" } }, "node_modules/@azure/abort-controller": { @@ -43,9 +61,9 @@ } }, "node_modules/@azure/core-client": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.0.tgz", - "integrity": "sha512-JjQWO6akOck45PH/XBrxzsQGAiKrfFl4m5iggJ0ItMIz5omRufOXWpqCPpdjKN3vKDzlSUvFjaMb7Zwf0gvAdA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.1.tgz", + "integrity": "sha512-2QygG2F76ZpMP2eMztiJvAiFMu71M9rDeU7vO/QKg5Css7MgM4frUOslFjhVjRhbGaCNPtz/S8M6y46/fFKVuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -61,6 +79,16 @@ "node": ">=22.0.0" } }, + "node_modules/@azure/core-process": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-process/-/core-process-1.0.0.tgz", + "integrity": "sha512-/shnJ+ooO8WPxDhPEeI/2oRQuubn16gZ6CvlbpWbEswZfzwI9tI/sMAHmF3x1LuQ9yZYXfLW3TjzGMLEC5blKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.0.0" + } + }, "node_modules/@azure/core-rest-pipeline": { "version": "1.25.0", "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", @@ -123,221 +151,242 @@ } }, "node_modules/@azure/monitor-opentelemetry-exporter": { - "version": "1.0.0-beta.32", - "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry-exporter/-/monitor-opentelemetry-exporter-1.0.0-beta.32.tgz", - "integrity": "sha512-Tk5Tv8KwHhKCQlXET/7ZLtjBv1Zi4lmPTadKTQ9KCURRJWdt+6hu5ze52Tlp2pVeg3mg+MRQ9vhWvVNXMZAp/A==", + "version": "1.0.0-beta.46", + "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry-exporter/-/monitor-opentelemetry-exporter-1.0.0-beta.46.tgz", + "integrity": "sha512-DXrkmKi2+zZCZEWPZN2cwEv3++NSeoo93F6FlHivoT+t7Q/7IRxLrCVttn22jGvFs8636cRKcWA8tqS8jPFOsQ==", "dev": true, "license": "MIT", "dependencies": { + "@azure-rest/core-client": "^2.5.2", "@azure/core-auth": "^1.9.0", "@azure/core-client": "^1.9.2", + "@azure/core-process": "^1.0.0", "@azure/core-rest-pipeline": "^1.19.0", - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/api-logs": "^0.200.0", - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/resources": "^2.0.0", - "@opentelemetry/sdk-logs": "^0.200.0", - "@opentelemetry/sdk-metrics": "^2.0.0", - "@opentelemetry/sdk-trace-base": "^2.0.0", - "@opentelemetry/semantic-conventions": "^1.32.0", + "@azure/core-util": "^1.11.0", + "@opentelemetry/api": "^1.9.1", + "@opentelemetry/api-logs": "^0.221.0", + "@opentelemetry/core": "^2.10.0", + "@opentelemetry/resources": "^2.10.0", + "@opentelemetry/sdk-logs": "^0.221.0", + "@opentelemetry/sdk-metrics": "^2.10.0", + "@opentelemetry/sdk-trace-base": "^2.10.0", + "@opentelemetry/semantic-conventions": "^1.43.0", "tslib": "^2.8.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, - "node_modules/@github/copilot": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.80.tgz", - "integrity": "sha512-6tf93ZF56KOiTTAjK/UhLZkl1W543IzaTQly288kockJZFswpRTnQEI00Yvacpb39DTvTYu3/ha9SeKpo/pgZQ==", + "node_modules/@github/copilot-sdk": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.15.tgz", + "integrity": "sha512-u7WEeF93PKCimIbzv7qgBh1UcuuaHFMoWEDC7W8/2VUGB9eeMN4Ff4QqgHWYHZSQnK5xGtY9Tx8KdyssU9kTYw==", "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "license": "MIT", "dependencies": { - "detect-libc": "^2.1.2" + "koffi": "3.2.1", + "vscode-jsonrpc": "8.2.1", + "zod": "4.3.6" }, - "bin": { - "copilot": "npm-loader.js" + "engines": { + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.80", - "@github/copilot-darwin-x64": "1.0.80", - "@github/copilot-linux-arm64": "1.0.80", - "@github/copilot-linux-x64": "1.0.80", - "@github/copilot-linuxmusl-arm64": "1.0.80", - "@github/copilot-linuxmusl-x64": "1.0.80", - "@github/copilot-win32-arm64": "1.0.80", - "@github/copilot-win32-x64": "1.0.80" - } - }, - "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.80.tgz", - "integrity": "sha512-fzn4PnSx3+O/a3ip72KVsjnzORsEygK+0i21bFAnFBYS+0Wi1Pk+o/CmNsJ7aRbf1enSJrcH8UDVkyc9pMGEBg==", + "@github/copilot-sdk-darwin-arm64": "1.0.15", + "@github/copilot-sdk-darwin-x64": "1.0.15", + "@github/copilot-sdk-linux-arm64": "1.0.15", + "@github/copilot-sdk-linux-x64": "1.0.15", + "@github/copilot-sdk-linuxmusl-arm64": "1.0.15", + "@github/copilot-sdk-linuxmusl-x64": "1.0.15", + "@github/copilot-sdk-win32-arm64": "1.0.15", + "@github/copilot-sdk-win32-x64": "1.0.15" + } + }, + "node_modules/@github/copilot-sdk-darwin-arm64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-arm64/-/copilot-sdk-darwin-arm64-1.0.15.tgz", + "integrity": "sha512-+iZRSgr0Bjc2EksKuNHggfBQR/2HAiLCAjgIx31X4SavNLzcly6BuR/mJLe6xkamlyjj0ugkLK5TKwnmRjqDRg==", "cpu": [ "arm64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "license": "MIT", "optional": true, "os": [ "darwin" - ], - "bin": { - "copilot-darwin-arm64": "copilot" - } + ] }, - "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.80.tgz", - "integrity": "sha512-PKsyGk5DccNzR3bYXcYTGB9N6sHzhzGqEwq/2t1qBwqPbrC98Zo2dOT2G40/QYpJ4XdrGmTmdmfPJQ9PJknlIQ==", + "node_modules/@github/copilot-sdk-darwin-x64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-x64/-/copilot-sdk-darwin-x64-1.0.15.tgz", + "integrity": "sha512-zNtblCoNiSOK0B0y5Y6GvVLfe9PNexJjy/3t1HfcTAA2vHt/zzS440yoGFdqg196Vjtp9yxpLc92Sf1yz6GDMA==", "cpu": [ "x64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "license": "MIT", "optional": true, "os": [ "darwin" - ], - "bin": { - "copilot-darwin-x64": "copilot" - } + ] }, - "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.80.tgz", - "integrity": "sha512-8oXwN2luyHEjIoSk8AkATBjXDhRoQtuiUvC93GpfQKFHI+I1eoOVwIsAq5fKP8jNCF2rOrYFIcTjwmRt38kCcQ==", + "node_modules/@github/copilot-sdk-linux-arm64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-arm64/-/copilot-sdk-linux-arm64-1.0.15.tgz", + "integrity": "sha512-Q+vp0Y8DBVf9VIe/OxH6jbgf/16xMbvRI/jsglZFGW+u8YNkUGDcpDxSdonMsE5EplC3Hc6E0xFkjVp6pkV1cg==", "cpu": [ "arm64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ], - "bin": { - "copilot-linux-arm64": "copilot" - } + ] }, - "node_modules/@github/copilot-linux-x64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.80.tgz", - "integrity": "sha512-qv1ytVNwA3IDK7kcQow+fAikD67t42+AQ8X42bK/7oudNiv4frVZMO0yh1DYIebVRcmEhmPvbVPY/ptVUK3cbA==", + "node_modules/@github/copilot-sdk-linux-x64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-x64/-/copilot-sdk-linux-x64-1.0.15.tgz", + "integrity": "sha512-OzZm8sKiUNDbc5GVtj9UY3uf/Ci4ZCSdd76yhguoTXHWE6azV50DycWuSFN8WjmILvemYYcIXo81gXrKcpasPQ==", "cpu": [ "x64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ], - "bin": { - "copilot-linux-x64": "copilot" - } + ] }, - "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.80.tgz", - "integrity": "sha512-Qjyi+OlVnPC4Lkuy7blDMMwMUQI/yELl7gDnqQlaN8TEbhZqZueuf3p0a+kEjXcNsw4XtNYQc0eMJqSIYy/Pjg==", + "node_modules/@github/copilot-sdk-linuxmusl-arm64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-arm64/-/copilot-sdk-linuxmusl-arm64-1.0.15.tgz", + "integrity": "sha512-13mnqoX3egpxwMnd2EsMOnDSBxXqK4ed1M/eX2ElAEdWRakE5/NV6tdsAjwdvgCnMeq7g8TXZ0n2Di2qamxAIQ==", "cpu": [ "arm64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ], - "bin": { - "copilot-linuxmusl-arm64": "copilot" - } + ] }, - "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.80.tgz", - "integrity": "sha512-rBg8pugf+5FhiZxi2zkOr+rlcOVF6Xg63j1FvryfwPT4DJ2w5Na7O3lpS4sgu8QmsP5H+dAqjlXYLYsvSoVQ0g==", + "node_modules/@github/copilot-sdk-linuxmusl-x64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-x64/-/copilot-sdk-linuxmusl-x64-1.0.15.tgz", + "integrity": "sha512-zKDpqjRsYNBCS+sjZ1nIgZ+4u3sGx6Z6fNIxR8cnJZkqzkdKfjWQ4E/5gqdS+jl+7Eb6eKi3ZMioH9OCFTpjBA==", "cpu": [ "x64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ], - "bin": { - "copilot-linuxmusl-x64": "copilot" - } - }, - "node_modules/@github/copilot-sdk": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.11.tgz", - "integrity": "sha512-ngrnfa9052fLTOMoY0iiQS2B6pFDYJpWNj3syCdjzdje0R5mWoij9b8exJZciLvX7BbJjKz2/lIdwo24av3e3A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@github/copilot": "^1.0.79", - "koffi": "^3.1.0", - "vscode-jsonrpc": "^8.2.1", - "zod": "^4.3.6" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - } + ] }, - "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.80.tgz", - "integrity": "sha512-+f7Vkd3vt2DYOxRnS8dStvYu3DY638N/AuLuIjxZp1F9GgwCUZK69wspqIxg2L59PmRRQcH4AGTrRDR60ENIZA==", + "node_modules/@github/copilot-sdk-win32-arm64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-arm64/-/copilot-sdk-win32-arm64-1.0.15.tgz", + "integrity": "sha512-m3EE2sdqY+XTI1O8sauMSg80iTVEjUqtD1hc0MGPchQd7mt5m/P7KxN7pmUCQ4oVwCqigiMMKbebTRvOz0j0pA==", "cpu": [ "arm64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "license": "MIT", "optional": true, "os": [ "win32" - ], - "bin": { - "copilot-win32-arm64": "copilot.exe" - } + ] }, - "node_modules/@github/copilot-win32-x64": { - "version": "1.0.80", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.80.tgz", - "integrity": "sha512-PO0kPqhRTWQfsqGaj4UN3cj8ttkcJYy4wmXiArtFm+03AIFu8xTvuhQDPn2xEOsUome7m7t2XomKoavcrCcRsw==", + "node_modules/@github/copilot-sdk-win32-x64": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-x64/-/copilot-sdk-win32-x64-1.0.15.tgz", + "integrity": "sha512-BRBJ8za6VZDy+LLRPZVkXWepXgT9psys9WM19d8X7CAl9ymr6Pj7K0nOgJ2eqFMeURXW/tithFgOoxQXNBHSzg==", "cpu": [ "x64" ], "dev": true, - "license": "SEE LICENSE IN LICENSE.md", + "license": "MIT", "optional": true, "os": [ "win32" - ], - "bin": { - "copilot-win32-x64": "copilot.exe" + ] + }, + "node_modules/@github/copilot-sdk/node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/@hono/node-server": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.1.tgz", - "integrity": "sha512-ELuehkj5VCBdgEw9zs+ivkKwyzzUCSQuE96YmiPvn1ECBoZCczbFXJLeEGMTYjphP6gydh4pHMqEYPVMYUVgQg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.5.tgz", + "integrity": "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q==", "dev": true, "license": "MIT", "engines": { "node": ">=20" }, "peerDependencies": { - "hono": "^4" + "hono": "^4 || ^5.0.0-0" + } + }, + "node_modules/@koromix/koffi-android-arm64": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-android-arm64/-/koffi-android-arm64-3.2.1.tgz", + "integrity": "sha512-1pJQ4jnZlUJduK9u9DC5CGy3aOgDUPvIXpNb6syV3+Dh5Q/ugezAIGCqvY+w+1mgXsve0pd0NVvJRjdZNHQ6MA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "funding": { + "url": "https://liberapay.com/Koromix" + } + }, + "node_modules/@koromix/koffi-android-x64": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-android-x64/-/koffi-android-x64-3.2.1.tgz", + "integrity": "sha512-HH40xGh3gVQifjOBnhwT2tECC0lL1lYe+nxHvWNSzxDIyQNcVPXg38ta7vuONRFpD+uIrw7fqGYLzbZIagkVcg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "funding": { + "url": "https://liberapay.com/Koromix" } }, "node_modules/@koromix/koffi-darwin-arm64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-darwin-arm64/-/koffi-darwin-arm64-3.1.5.tgz", - "integrity": "sha512-IpqITl2fJi3QN9bTtNnygWPdK7ScSjw3xtGu8e6feYGvimCysu+spgI5KyeslY2jTnqxGS9xr8pLAbLhGJ8edA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-darwin-arm64/-/koffi-darwin-arm64-3.2.1.tgz", + "integrity": "sha512-Vj4h+xcjc5+Cn0DhPHjgRX4omKAv96Kehtcd+1YgYuY2W7FvQn9vS+3SmzVwhC5Qmg9bIwUZObYQ8T/4hBqQqA==", "cpu": [ "arm64" ], @@ -352,9 +401,9 @@ } }, "node_modules/@koromix/koffi-darwin-x64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-darwin-x64/-/koffi-darwin-x64-3.1.5.tgz", - "integrity": "sha512-4Tia4BS5EV/+vN9eIrdToanVe+U/2VqTZCBgOzoUbPKjgky51eqM+3J4qdRUvmYJohcJNPob5/hsxeItUZrl1g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-darwin-x64/-/koffi-darwin-x64-3.2.1.tgz", + "integrity": "sha512-gFCWxNBTZIvxo1p+PURWfsy2Ctj5FGnVVs1f03lTLhBvmxEto70pdIiFztdFLDFkAJ1pmtQmruRKapeK+E8YPA==", "cpu": [ "x64" ], @@ -369,9 +418,9 @@ } }, "node_modules/@koromix/koffi-freebsd-arm64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-freebsd-arm64/-/koffi-freebsd-arm64-3.1.5.tgz", - "integrity": "sha512-bP94uzseFO79NG3flpU3WxfyvltD+jzC/kN8FDZLi8J0VUZNW1Wmu8yq87KEzjX1qT9KyX4Y+elVbGqHXHTv2Q==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-freebsd-arm64/-/koffi-freebsd-arm64-3.2.1.tgz", + "integrity": "sha512-qj+f1s2e6vULaUG1cdlTcCXmunCq2t+rjxku1+esaMIqVnHpOwj0QzPuInG0AFdXjwBNQhyVR/HpDj8daEwwsQ==", "cpu": [ "arm64" ], @@ -386,9 +435,9 @@ } }, "node_modules/@koromix/koffi-freebsd-ia32": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-freebsd-ia32/-/koffi-freebsd-ia32-3.1.5.tgz", - "integrity": "sha512-raFXXAPHzvCQWhaoMUF+Cc2ZWgg2UBU0RVoowHZhaw9nQYPC1pERcPRH+JA+SNIN6g4d2GFW6uPFc+QbUhsagA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-freebsd-ia32/-/koffi-freebsd-ia32-3.2.1.tgz", + "integrity": "sha512-6olHb1Qfgai0jjs6ddlDDD0ZfsCxy7SPi8rMRpuYQWH0qhgtyQu82hw5b1p7z+TJ0zZP3ZeQQ6l+U/MlM1ICHQ==", "cpu": [ "ia32" ], @@ -403,9 +452,9 @@ } }, "node_modules/@koromix/koffi-freebsd-x64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-freebsd-x64/-/koffi-freebsd-x64-3.1.5.tgz", - "integrity": "sha512-h6RyBZmPMBIDWTABkJIhzDdYwSnYAJvTacHpEjbT55Arkmw1H15Rl7CFtXuEuBrqh+uivoCrRgA6vszl9CsJ9g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-freebsd-x64/-/koffi-freebsd-x64-3.2.1.tgz", + "integrity": "sha512-Dikhw1ySYNVMkmeFvFVjnU5Wdk6mffNoOjJxm9bTG96vg7OlemylxqdEven47R1YJ3yzNVJn/MlQ207ORWfi2w==", "cpu": [ "x64" ], @@ -419,10 +468,27 @@ "url": "https://liberapay.com/Koromix" } }, + "node_modules/@koromix/koffi-linux-arm": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-arm/-/koffi-linux-arm-3.2.1.tgz", + "integrity": "sha512-OfwUwZylidq95wQKp6ClInULrfB2giu7dqM6Rhe0zAe6lES5I2SXNw15T9+GnRHk3/9hKT2XZ37OZLaKSyWNLA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://liberapay.com/Koromix" + } + }, "node_modules/@koromix/koffi-linux-arm64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-arm64/-/koffi-linux-arm64-3.1.5.tgz", - "integrity": "sha512-u0vCmKPu4yQDhl/ri1J6U3vDnvYtYjoZaIWb+oMbRXhVZeiqdE53MGPb+q2A7Dj2n9IbYloAfEICQbL6l0pmiQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-arm64/-/koffi-linux-arm64-3.2.1.tgz", + "integrity": "sha512-K+cGUL5iBcDqxmsocrjmlASqDf24gc7artbVW3PewG2c9AqwC63lezgwvB85Nx4lZAQjB6zIFHh9A7t1yGbwhw==", "cpu": [ "arm64" ], @@ -437,9 +503,9 @@ } }, "node_modules/@koromix/koffi-linux-ia32": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-ia32/-/koffi-linux-ia32-3.1.5.tgz", - "integrity": "sha512-Xa5JbumWglwPVZgrJcLhqyC1wCWlfm7+C00p3FuOTNGp0qoYuf2/tOoAh0/q7+taVm30cMopu/6lRHwdmF6I/w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-ia32/-/koffi-linux-ia32-3.2.1.tgz", + "integrity": "sha512-rxj6UYjU1qd98gxNQOSCdLpc5cPRi5Giq9rNd3jnGuSNIyMkwa6Dxw4cUjmhIBCYESMJtmNt5NWnJp5u9wTfYQ==", "cpu": [ "ia32" ], @@ -454,9 +520,9 @@ } }, "node_modules/@koromix/koffi-linux-loong64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-loong64/-/koffi-linux-loong64-3.1.5.tgz", - "integrity": "sha512-F3i2CeTcqVBUQiSRUBSEzX1VgtXmLLiZb/ouZtXHkWpTLhJNd9TH7s3CizTofci0VRqlKdexGUYhK5vzPDAAHA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-loong64/-/koffi-linux-loong64-3.2.1.tgz", + "integrity": "sha512-aHhnHzkPRmT/IHDlGvESJ/Bs32m8N6UE6Ab6kMeJzgk74IN8af2m/81/wZJtybR1M2UxCV4NmlVNUYQQvSAO3Q==", "cpu": [ "loong64" ], @@ -471,9 +537,9 @@ } }, "node_modules/@koromix/koffi-linux-riscv64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-riscv64/-/koffi-linux-riscv64-3.1.5.tgz", - "integrity": "sha512-2TgQuzy+4PfDg+rw3kOmN6lywEWdzKT3eaLPbOp0b/9DaN7CLBJ/QIR5GhGsMNpeI30zU0YzFeYFxoVoJ/LqFw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-riscv64/-/koffi-linux-riscv64-3.2.1.tgz", + "integrity": "sha512-qtQBsjbm3LiirLJvajWmKkNb7ARk7fvJVXdftJ7NtAnF3Xw8EbDvrtvmvtNI1yLPlYcBmlzCCD71hwhWYk0SIA==", "cpu": [ "riscv64" ], @@ -488,9 +554,9 @@ } }, "node_modules/@koromix/koffi-linux-x64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-x64/-/koffi-linux-x64-3.1.5.tgz", - "integrity": "sha512-2yaIg/1V0m4CiAUMzG4CIlWmq1WJ+QBMlFfaGr9su+OH5fuIqC7V3BbMiB03IwIl1VofIZO5JA4Db4lID8tpbw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-linux-x64/-/koffi-linux-x64-3.2.1.tgz", + "integrity": "sha512-c7hw7Qs/r5gnFRTQLcbifBwRU7wiocj+2pVuDQ5Ahb3r36SZmupmgYbTWcLvTW+hul1jd7SKRV0d14ZJq/tvSw==", "cpu": [ "x64" ], @@ -505,9 +571,9 @@ } }, "node_modules/@koromix/koffi-openbsd-ia32": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-openbsd-ia32/-/koffi-openbsd-ia32-3.1.5.tgz", - "integrity": "sha512-8/OXd+u9omMooykhvdJPEP7u6FFzzrrFo9gOmSHc9/DPt3XkVYOtSsE97PDk6zYaAzwIYHSKjHvIXsfFwFc7sg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-openbsd-ia32/-/koffi-openbsd-ia32-3.2.1.tgz", + "integrity": "sha512-mmY8fY8LQ/CB52+h3yrMYmVyoxzW3x08S0yI6VNfHWdfU6yJtZkKCbhjmQCYMrWbYKC4gMvwZwCywIGPAkLyeA==", "cpu": [ "ia32" ], @@ -522,9 +588,9 @@ } }, "node_modules/@koromix/koffi-openbsd-x64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-openbsd-x64/-/koffi-openbsd-x64-3.1.5.tgz", - "integrity": "sha512-SpeqldKkuDk2aTj5PVWumy7eq6Tr2GtBPAOI1NiDHhg8xe433KraxrA9V9UjEd+1+kSGJQGR04nQByN3MPA9PQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-openbsd-x64/-/koffi-openbsd-x64-3.2.1.tgz", + "integrity": "sha512-k4ig6aAPbFSRATOIIOfdf/KtlOGH4SVls6L9fy0QnTxRJYvY2oSltTsQtBDANgEQldlq8Kl5WnpRa1VSibP4Lw==", "cpu": [ "x64" ], @@ -539,9 +605,9 @@ } }, "node_modules/@koromix/koffi-win32-arm64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-win32-arm64/-/koffi-win32-arm64-3.1.5.tgz", - "integrity": "sha512-uej3YAEKAhlfVPoIo5sOwtxhTLRVJ01LgtWrKGpnnAQU3C+Ilmaxdh+Oc2xc1G3NK30N5eCVJpyO9r3pjKC6Vw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-win32-arm64/-/koffi-win32-arm64-3.2.1.tgz", + "integrity": "sha512-cTWBJGK//pDMeKQJE/79Aq9MiOAF4H8QyLZHSQ9IWm8czOfwjG4J1AhsQ9DjI9KFOykH77hhnpmQTGVMIubGig==", "cpu": [ "arm64" ], @@ -556,9 +622,9 @@ } }, "node_modules/@koromix/koffi-win32-ia32": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-win32-ia32/-/koffi-win32-ia32-3.1.5.tgz", - "integrity": "sha512-d42jv2f4PwtJGNJS19Xfn/BRtGsBNNVkw0O0K5tkIGI+yNq4MnPTSUsaGbDIkCLNsCgk/LFqAaE8BExyCdrujA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-win32-ia32/-/koffi-win32-ia32-3.2.1.tgz", + "integrity": "sha512-Z50EM6TAZ7CFyMmyX6thv8eNpJchqe9eenhibSIy2Eq/FQYF76gU2VK/LEoaF46L8hfC7TpTp9b10MvReHEyFA==", "cpu": [ "ia32" ], @@ -573,9 +639,9 @@ } }, "node_modules/@koromix/koffi-win32-x64": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@koromix/koffi-win32-x64/-/koffi-win32-x64-3.1.5.tgz", - "integrity": "sha512-Pyo1WEHEP6Ek2NEn2pquwJzSPLOdY4vymoPSz0an1DgvFWSkOyBYYkGVoxL1ajfj5I1pPdXysYqixtVTzAtOfQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@koromix/koffi-win32-x64/-/koffi-win32-x64-3.2.1.tgz", + "integrity": "sha512-ZmZNiBO6bkOSh3QNzgfvb1cMY0yMobn6ZQrSMqbAce21qyYL8niIbyipz9N/PIRDciGhsV0wUxnZsxIO+yWsHQ==", "cpu": [ "x64" ], @@ -590,65 +656,119 @@ } }, "node_modules/@microsoft/vally": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@microsoft/vally/-/vally-0.14.0.tgz", - "integrity": "sha512-a3Xhj5PUSp6vv38ViSOocrYneMuBu9HpJQ2/VAyoIAHYhWklm/IGmGCylOMv+4brMX2aZSEiX3sW2dMIy3q7vA==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@microsoft/vally/-/vally-0.19.0.tgz", + "integrity": "sha512-EtdL8VR9+Yr1gGyRkgwluA52rSuJ/+WXQ7ENvXwRIyezCDUSv2NRYmf9D2qxyQMEt3GSo7P3hl4RnG0tJSAr0w==", "dev": true, "license": "MIT", "dependencies": { - "@github/copilot-sdk": "^1.0.7", + "@github/copilot-sdk": "1.0.15", + "@modelcontextprotocol/sdk": "^1.31.0", "@opentelemetry/api": "^1.9.1", + "@opentelemetry/core": "^2.10.0", "js-tiktoken": "^1.0.21", "mdast-util-from-markdown": "^2.0.3", - "picomatch": "^4.0.5", - "yaml": "^2.9.0", - "zod": "^4.4.3" + "picomatch": "^4.0.7", + "semver": "^7.8.5", + "yaml": "^2.9.1", + "zod": "^4.6.5" + }, + "bin": { + "vally-docker-runner": "dist/backend/docker/runner.js" }, "engines": { - "node": ">=22.12.0" + "node": ">=22.14.0" } }, "node_modules/@microsoft/vally-cli": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@microsoft/vally-cli/-/vally-cli-0.14.0.tgz", - "integrity": "sha512-jN9ap1aiuRJQDkiPecrFUp3v5r4Lm+l7154CPY+22cdySGl+XfaOAY5Eh9YqkfwFcya5X+U3pJmBBpFMzHuVlg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@microsoft/vally-cli/-/vally-cli-0.19.0.tgz", + "integrity": "sha512-2GJa+AkABGksS6DsEHBTbLseY7trq6ALpbXBO5bCWM1BylNx1Ams+/6J79moWEC2gKKwTgkc6rUDuX3rWy+avA==", "dev": true, "license": "MIT", "dependencies": { - "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.32", - "@microsoft/vally": "^0.14.0", - "@microsoft/vally-server": "^0.14.0", + "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.46", + "@microsoft/vally": "^0.19.0", + "@microsoft/vally-server": "^0.19.0", "@opentelemetry/api": "^1.9.1", - "@opentelemetry/exporter-trace-otlp-http": "^0.221.0", - "@opentelemetry/resources": "^2.10.0", - "@opentelemetry/sdk-trace-base": "^2.10.0", - "@opentelemetry/sdk-trace-node": "^2.10.0", + "@opentelemetry/exporter-trace-otlp-http": "^0.222.0", + "@opentelemetry/resources": "^2.11.0", + "@opentelemetry/sdk-trace-base": "^2.11.0", + "@opentelemetry/sdk-trace-node": "^2.11.0", "commander": "^15.0.0" }, "bin": { "vally": "dist/index.js" }, "engines": { - "node": ">=22.12.0" + "node": ">=22.14.0" }, "optionalDependencies": { "@vscode/deviceid": "~0.1.5" } }, "node_modules/@microsoft/vally-server": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@microsoft/vally-server/-/vally-server-0.14.0.tgz", - "integrity": "sha512-uFyeR8s1oHopjWK0GhRRRFbI+hm4BqHWFUTdgA2GdFRiz+xJfhxjMvTDi69WC0tJoq4WuDEglraEg0CG07LodA==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@microsoft/vally-server/-/vally-server-0.19.0.tgz", + "integrity": "sha512-R2gI3A+wvRJjZzXn9+B7QkN6viXOtMObjYs1s//hPFq3XJ2FFdxDUVghB68jkE/M49bwRtHYhY7vsROIHwReoA==", "dev": true, "license": "MIT", "dependencies": { - "@hono/node-server": "^2.0.12", - "@microsoft/vally": "^0.14.0", - "better-sqlite3": "^13.0.2", - "hono": "^4.13.1" + "@hono/node-server": "^2.1.3", + "@microsoft/vally": "^0.19.0", + "hono": "^4.13.12" }, "engines": { - "node": ">=22.12.0" + "node": ">=22.14.0" + }, + "peerDependencies": { + "better-sqlite3": "^13.0.3" + }, + "peerDependenciesMeta": { + "better-sqlite3": { + "optional": true + } + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.32.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.32.1.tgz", + "integrity": "sha512-2DdE+SJDtzLEEWzY1ZjY7Q+VcPhcV1KisD3zI4u0XZyktsjHum1mwbMI+JaulUBi2OZk+KJAi2uPXzxichPkdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.9 || ^2.0.5", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } } }, "node_modules/@opentelemetry/api": { @@ -662,9 +782,9 @@ } }, "node_modules/@opentelemetry/api-logs": { - "version": "0.200.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.200.0.tgz", - "integrity": "sha512-IKJBQxh91qJ+3ssRly5hYEJ8NDHu9oY/B1PXVSCWf7zytmYO9RNLB0Ox9XQ/fJ8m6gY6Q6NtBWlmXfaXt5Uc4Q==", + "version": "0.221.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.221.0.tgz", + "integrity": "sha512-OlanaW1vv7ufTqQ3/fPLI4arGt5ZoM+P8abOMki6uEYnpRazepSWDwDnnw+la7kE26SHVC18//SMccrDvLKOXQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -675,9 +795,9 @@ } }, "node_modules/@opentelemetry/context-async-hooks": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.10.0.tgz", - "integrity": "sha512-bvyMcgLEkozzSzpEEEo1OMoeQ97bxj6Qs2uN3mPrSdDvObMI1myffD/BPqcLlzZO9//d1SqQA/WPw7Cz2AiqhA==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.12.0.tgz", + "integrity": "sha512-iK/1nD7mmZVkuYjVjkdFBiCvzntJdFny1S3CYbUYyOq7V5enL6XX+gJ7eh965L1LnS11VA8mQ7Ej/ck04SB0MQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -688,9 +808,9 @@ } }, "node_modules/@opentelemetry/core": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.10.0.tgz", - "integrity": "sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.12.0.tgz", + "integrity": "sha512-1HsSAuvT4/my0QrXWsyXFdWjKaPeCHsismKZgEEIb8NK13LP6DrMRlsUbvD/0F9mDWK3xDom9AMv3IscxgOnOQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -704,15 +824,15 @@ } }, "node_modules/@opentelemetry/exporter-trace-otlp-http": { - "version": "0.221.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.221.0.tgz", - "integrity": "sha512-AySXiKoC+meiWm6zdVj5T2LnPDZuatveBby1cMOeQteIWsYXAUxs8Sru13G2pVSPrUXz6vF+og7QVBX6GdC/oQ==", + "version": "0.222.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.222.0.tgz", + "integrity": "sha512-RCnPWcHppwiquQ+cV3nWvNwdf0MG1w26e5jewW2T83nTZOlXgcg88sY9ulCVgagGHcq1mj0L0GP6YHgzk2v8oA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/otlp-exporter-base": "0.221.0", - "@opentelemetry/otlp-transformer": "0.221.0", - "@opentelemetry/sdk-trace": "2.10.0" + "@opentelemetry/otlp-exporter-base": "0.222.0", + "@opentelemetry/otlp-transformer": "0.222.0", + "@opentelemetry/sdk-trace": "2.11.0" }, "engines": { "node": "^18.19.0 || >=20.6.0" @@ -722,14 +842,14 @@ } }, "node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.221.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.221.0.tgz", - "integrity": "sha512-UFPIq80OH3Ns/oPFHRj14d4DTOxUo+MUFU8hUiCq5jTqFhdeJnfVSANHT+xp92409cA+oxzvlZCe6NM1wvCuBA==", + "version": "0.222.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.222.0.tgz", + "integrity": "sha512-YbywG3veEm2Fb6TbdxRkuquWob6eVWXuA8/Ba1tXz9jHfUqpdE3keilOHEtPboC4CvS1bjeeVfNkWGOOrLj+lw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.10.0", - "@opentelemetry/otlp-transformer": "0.221.0" + "@opentelemetry/core": "2.11.0", + "@opentelemetry/otlp-transformer": "0.222.0" }, "engines": { "node": "^18.19.0 || >=20.6.0" @@ -738,19 +858,35 @@ "@opentelemetry/api": "^1.3.0" } }, + "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.11.0.tgz", + "integrity": "sha512-7YP44XH0tV6+Mb54x2YGf84i7yi+31MBZlE8JwvozkxyTvXbSp10X7cI7YE49ChJ3shMJoBmCJF3+1QFBJctGA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, "node_modules/@opentelemetry/otlp-transformer": { - "version": "0.221.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.221.0.tgz", - "integrity": "sha512-lg6lkOU08Az23jVcn/0Els9HP+V8PnR4Km6p0KgpTggS0n/WuhnmY64rSh83Of9iR9nD+dpWr6adlcX8KzAwjg==", + "version": "0.222.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.222.0.tgz", + "integrity": "sha512-/F3BZ89+CJQnZkMh2tCrtcdB+XT2Dxhj4FFE+WPQ//413hmFL0/RfEX6vgOIWGhiSzrkHWTK3+6SiT7K5/g/jQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.221.0", - "@opentelemetry/core": "2.10.0", - "@opentelemetry/resources": "2.10.0", - "@opentelemetry/sdk-logs": "0.221.0", - "@opentelemetry/sdk-metrics": "2.10.0", - "@opentelemetry/sdk-trace": "2.10.0" + "@opentelemetry/api-logs": "0.222.0", + "@opentelemetry/core": "2.11.0", + "@opentelemetry/resources": "2.11.0", + "@opentelemetry/sdk-logs": "0.222.0", + "@opentelemetry/sdk-metrics": "2.11.0", + "@opentelemetry/sdk-trace": "2.11.0" }, "engines": { "node": "^18.19.0 || >=20.6.0" @@ -760,9 +896,9 @@ } }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/api-logs": { - "version": "0.221.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.221.0.tgz", - "integrity": "sha512-OlanaW1vv7ufTqQ3/fPLI4arGt5ZoM+P8abOMki6uEYnpRazepSWDwDnnw+la7kE26SHVC18//SMccrDvLKOXQ==", + "version": "0.222.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.222.0.tgz", + "integrity": "sha512-9mb1If+IF6u0ZVXkHQ6ogEae5HwA6ajIVUgpSDQyRASxft6BSXHvBvPooRle3yFN/fKnCdSOnuu0OC3PLcF6+g==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -772,16 +908,49 @@ "node": ">=8.0.0" } }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.11.0.tgz", + "integrity": "sha512-7YP44XH0tV6+Mb54x2YGf84i7yi+31MBZlE8JwvozkxyTvXbSp10X7cI7YE49ChJ3shMJoBmCJF3+1QFBJctGA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.11.0.tgz", + "integrity": "sha512-Ie7+8q8MDF4FAEQCKVMTx3ReUvxiIAgIiiW3c9JdmP8+HMcDy20puT+AHjexnExgnbvBxjQ9fjkFDWrikJ2jQA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.11.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-logs": { - "version": "0.221.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.221.0.tgz", - "integrity": "sha512-FaDcazjyMp7TZZZAsqbo4IkovP0UegoCu0EBkiNt+qCqvUf7FPAsfcrZ3+ZEkKgXZ/jHafop+JoGPDk3A0SmLg==", + "version": "0.222.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.222.0.tgz", + "integrity": "sha512-+19YHODIjaUCArxleaJtuufFZVpz/xvvK+VllQqE+W8hHolxdoRwHfK/s667zezwh1hkx6FFF+oYzetYgqK+Bg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.221.0", - "@opentelemetry/core": "2.10.0", - "@opentelemetry/resources": "2.10.0", + "@opentelemetry/api-logs": "0.222.0", + "@opentelemetry/core": "2.11.0", + "@opentelemetry/resources": "2.11.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -791,14 +960,31 @@ "@opentelemetry/api": ">=1.4.0 <1.10.0" } }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-metrics": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-2.11.0.tgz", + "integrity": "sha512-7GXXcObyHyDUUSG+L+kJoquty01bzm7ivE7+SSgXXJcHuPzGviptxwARmI2c+bnnxjexGQbJnyNlN8HxBP/Y7A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.11.0", + "@opentelemetry/resources": "2.11.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.9.0 <1.10.0" + } + }, "node_modules/@opentelemetry/resources": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.10.0.tgz", - "integrity": "sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.12.0.tgz", + "integrity": "sha512-+rSRoOdln6NhXTVcBdHSlZxJDNzwxadeweK2ltZO3tVtfp6aklABc06xclDk6ovRR+EiGgIcSbh/6NgjFhnb3A==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.10.0", + "@opentelemetry/core": "2.12.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -809,15 +995,16 @@ } }, "node_modules/@opentelemetry/sdk-logs": { - "version": "0.200.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.200.0.tgz", - "integrity": "sha512-VZG870063NLfObmQQNtCVcdXXLzI3vOjjrRENmU37HYiPFa0ZXpXVDsTD02Nh3AT3xYJzQaWKl2X2lQ2l7TWJA==", + "version": "0.221.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.221.0.tgz", + "integrity": "sha512-FaDcazjyMp7TZZZAsqbo4IkovP0UegoCu0EBkiNt+qCqvUf7FPAsfcrZ3+ZEkKgXZ/jHafop+JoGPDk3A0SmLg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.200.0", - "@opentelemetry/core": "2.0.0", - "@opentelemetry/resources": "2.0.0" + "@opentelemetry/api-logs": "0.221.0", + "@opentelemetry/core": "2.10.0", + "@opentelemetry/resources": "2.10.0", + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { "node": "^18.19.0 || >=20.6.0" @@ -827,9 +1014,9 @@ } }, "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.0.0.tgz", - "integrity": "sha512-SLX36allrcnVaPYG3R78F/UZZsBsvbc7lMCLx37LyH5MJ1KAAZ2E3mW9OAD3zGz0G8q/BtoS5VUrjzDydhD6LQ==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.10.0.tgz", + "integrity": "sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -843,13 +1030,13 @@ } }, "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.0.0.tgz", - "integrity": "sha512-rnZr6dML2z4IARI4zPGQV4arDikF/9OXZQzrC01dLmn0CZxU5U5OLd/m1T7YkGRj5UitjeoCtg/zorlgMQcdTg==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.10.0.tgz", + "integrity": "sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.0.0", + "@opentelemetry/core": "2.10.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -860,14 +1047,14 @@ } }, "node_modules/@opentelemetry/sdk-metrics": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-2.10.0.tgz", - "integrity": "sha512-t6r1VSvXNtSDnPXU1FbZeetJb7yyovHmgu0wRSoftxtE0g2rSNhQZQUy69sRUCL+iioJpX8SN/S6wq6ZtvLySQ==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-2.12.0.tgz", + "integrity": "sha512-mVMaEHwCUJuY3S4Esn+nT0yQA3qCEGh+SOPJsXygU0Gl453WcsDNjtEa8EfdewMwoLyr1tlofB4fXytVpiXuow==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.10.0", - "@opentelemetry/resources": "2.10.0" + "@opentelemetry/core": "2.12.0", + "@opentelemetry/resources": "2.12.0" }, "engines": { "node": "^18.19.0 || >=20.6.0" @@ -877,14 +1064,14 @@ } }, "node_modules/@opentelemetry/sdk-trace": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace/-/sdk-trace-2.10.0.tgz", - "integrity": "sha512-MfQGq3GRmTh5fM/y+OjaO0vj6+luCB1XO2gfXCalKCfgKw0eHL++sm75DNweC6ohlp+aFvACqeE0fYayqdRaoQ==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace/-/sdk-trace-2.11.0.tgz", + "integrity": "sha512-fFnTqGm8/G73GQVnxYi7LXa1ZVYEUvgL6XI1LpvV0bPC7WQ/ZGgKxCSl8FnlZBKto9JHHEFTO6s6CUpvvtwFrA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.10.0", - "@opentelemetry/resources": "2.10.0", + "@opentelemetry/core": "2.11.0", + "@opentelemetry/resources": "2.11.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -895,15 +1082,16 @@ } }, "node_modules/@opentelemetry/sdk-trace-base": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.10.0.tgz", - "integrity": "sha512-GuYQQT7QD2EeO8lcZLRQzcbOyhqAzL+6WWTKTU9mSUBYBazkEDl+VrQcXQhbB08OWM9anD1aHleVadzulpOaUQ==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.12.0.tgz", + "integrity": "sha512-JOERgZCxRM06FEJ5kEWxlSRChah6MmXDx3KwCruqEv/iEyLkTokCSemf2y1w8oIHtfrr8EVTpzebq/31vn2Cpg==", + "deprecated": "Use @opentelemetry/sdk-trace package", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.10.0", - "@opentelemetry/resources": "2.10.0", - "@opentelemetry/sdk-trace": "2.10.0", + "@opentelemetry/core": "2.12.0", + "@opentelemetry/resources": "2.12.0", + "@opentelemetry/sdk-trace": "2.12.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -913,28 +1101,80 @@ "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, - "node_modules/@opentelemetry/sdk-trace-node": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-2.10.0.tgz", - "integrity": "sha512-GZK/G6oZyBLGlH1pUgeDch7D91KoHd2uotUGIkWCPi9GI5T9X0p4L7nNAMDR1BQjkRYoDqo+ddfVx9t5Uhys+Q==", + "node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/sdk-trace": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace/-/sdk-trace-2.12.0.tgz", + "integrity": "sha512-ImVuRQ6faOsTi1Wna88s2avgrrf/iDgXPigIeynkUhjstMuoQUDOJXgkez2j1mlU4btjXcXBGa+q7qKFYR3GsA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@opentelemetry/context-async-hooks": "2.10.0", - "@opentelemetry/core": "2.10.0", - "@opentelemetry/sdk-trace-base": "2.10.0" + "@opentelemetry/core": "2.12.0", + "@opentelemetry/resources": "2.12.0", + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" + "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, - "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.43.0.tgz", - "integrity": "sha512-eSYWTm620tTk45EKSedaUL8MFYI8hW164hIXsgIHyxu3VobUB3fFCu5t0hQby6OoWRPsG1KkKUG2M5UadiLiVg==", + "node_modules/@opentelemetry/sdk-trace-node": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-2.12.0.tgz", + "integrity": "sha512-9DufH1IlmQMoKAfot5y/FhTP1RnmhLb5K6eKmJO/bvzPjYwPAazoiAUbTZFdPbqxOXN0FEbhZx/e6SB1Og4jmg==", + "deprecated": "Use @opentelemetry/sdk-trace package", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/context-async-hooks": "2.12.0", + "@opentelemetry/core": "2.12.0", + "@opentelemetry/sdk-trace-base": "2.12.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace/node_modules/@opentelemetry/core": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.11.0.tgz", + "integrity": "sha512-7YP44XH0tV6+Mb54x2YGf84i7yi+31MBZlE8JwvozkxyTvXbSp10X7cI7YE49ChJ3shMJoBmCJF3+1QFBJctGA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace/node_modules/@opentelemetry/resources": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.11.0.tgz", + "integrity": "sha512-Ie7+8q8MDF4FAEQCKVMTx3ReUvxiIAgIiiW3c9JdmP8+HMcDy20puT+AHjexnExgnbvBxjQ9fjkFDWrikJ2jQA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.11.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.43.0.tgz", + "integrity": "sha512-eSYWTm620tTk45EKSedaUL8MFYI8hW164hIXsgIHyxu3VobUB3fFCu5t0hQby6OoWRPsG1KkKUG2M5UadiLiVg==", "dev": true, "license": "Apache-2.0", "engines": { @@ -976,9 +1216,9 @@ "license": "MIT" }, "node_modules/@typespec/ts-http-runtime": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.8.tgz", - "integrity": "sha512-bLMpVcWZNzq6lYOybwFwOAR1IXKcHnhUNqYeHjl1bET/qE3jFPFH+p8Wrh3rU4xwdnifPxmKNESBYnvnmc75aA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.9.tgz", + "integrity": "sha512-edSdeAqkdxBVzA1yL1LrLCml1YjyCVvPMtMqJpbF+6K609tHe8V6sQUzFQSGcYNhcuhOceZtjvN32+mpIth30A==", "dev": true, "license": "MIT", "dependencies": { @@ -1003,6 +1243,20 @@ "uuid": "^14.0.0" } }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", @@ -1013,6 +1267,41 @@ "node": ">= 14" } }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -1034,18 +1323,84 @@ ], "license": "MIT" }, - "node_modules/better-sqlite3": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-13.0.3.tgz", - "integrity": "sha512-RbOBxmLBG8uvFUc15X9+9SFemKcQ0WBuISBVkpuiaUB2qblC8UWlHEjdWVoZ8AdhSwmoEgsiXKfopX0CQxaACQ==", + "node_modules/body-parser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", + "on-finished": "^2.4.1", + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, - "hasInstallScript": true, "license": "MIT", "dependencies": { - "node-addon-api": "^8.0.0" + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { - "node": ">=22" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/character-entities": { @@ -1069,6 +1424,83 @@ "node": ">=22.12.0" } }, + "node_modules/content-disposition": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-2.0.1.tgz", + "integrity": "sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -1101,6 +1533,16 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -1111,16 +1553,6 @@ "node": ">=6" } }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, "node_modules/devlop": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", @@ -1135,165 +1567,645 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/fs-extra": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.0.tgz", - "integrity": "sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA==", + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, "engines": { - "node": ">=14.14" + "node": ">= 0.4" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "dev": true, - "license": "ISC", - "optional": true + "license": "MIT" }, - "node_modules/hono": { - "version": "4.13.7", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.7.tgz", - "integrity": "sha512-c8/gF9ac8Y78/agExVocyLevgR+JlpNB444Py0FSX8pJoPdYUfUzRcXtYEYGwt6l19qIlVZPN5Mfsw9jFShmQQ==", + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, "license": "MIT", "engines": { - "node": ">=16.9.0" + "node": ">= 0.8" } }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, "engines": { - "node": ">= 14" + "node": ">= 0.4" } }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" + "es-errors": "^1.3.0" }, "engines": { - "node": ">= 14" + "node": ">= 0.4" } }, - "node_modules/js-tiktoken": { - "version": "1.0.21", - "resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.21.tgz", - "integrity": "sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g==", + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, "license": "MIT", - "dependencies": { - "base64-js": "^1.5.1" + "engines": { + "node": ">= 0.6" } }, - "node_modules/jsonfile": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", - "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "universalify": "^2.0.0" + "eventsource-parser": "^3.0.1" }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/koffi": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/koffi/-/koffi-3.1.5.tgz", - "integrity": "sha512-XVwwrxg0Ca6IEUQF4YtGIU4XN0LSselFYpYvgfhh8wafCunhEEx5hPr7LZhp5QyeFA/LcRsKHTqncCdjWjWAlg==", + "node_modules/eventsource-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.1.tgz", + "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==", "dev": true, - "hasInstallScript": true, "license": "MIT", - "funding": { - "url": "https://liberapay.com/Koromix" - }, - "optionalDependencies": { - "@koromix/koffi-darwin-arm64": "3.1.5", - "@koromix/koffi-darwin-x64": "3.1.5", - "@koromix/koffi-freebsd-arm64": "3.1.5", - "@koromix/koffi-freebsd-ia32": "3.1.5", - "@koromix/koffi-freebsd-x64": "3.1.5", - "@koromix/koffi-linux-arm64": "3.1.5", - "@koromix/koffi-linux-ia32": "3.1.5", - "@koromix/koffi-linux-loong64": "3.1.5", - "@koromix/koffi-linux-riscv64": "3.1.5", - "@koromix/koffi-linux-x64": "3.1.5", - "@koromix/koffi-openbsd-ia32": "3.1.5", - "@koromix/koffi-openbsd-x64": "3.1.5", - "@koromix/koffi-win32-arm64": "3.1.5", - "@koromix/koffi-win32-ia32": "3.1.5", - "@koromix/koffi-win32-x64": "3.1.5" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/mdast-util-from-markdown": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", - "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", + "node_modules/express": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.3.0.tgz", + "integrity": "sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==", "dev": true, "license": "MIT", "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark": "^4.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-decode-string": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unist-util-stringify-position": "^4.0.0" + "accepts": "^2.0.0", + "body-parser": "^2.3.0", + "content-disposition": "^2.0.1", + "content-type": "^2.0.0", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.8", + "qs": "^6.16.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.1.0", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://opencollective.com/express" } }, - "node_modules/mdast-util-to-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", - "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "node_modules/express-rate-limit": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.7.1.tgz", + "integrity": "sha512-2FXbqkygil3mZiXzEtM0IjE/UBmBNot0J1GEVrJT4JbrvwOSoEtqtO+wHbiMQELWe1eNvHoYRg2dkjOid+6JkA==", "dev": true, "license": "MIT", "dependencies": { - "@types/mdast": "^4.0.0" + "debug": "^4.4.3", + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/express/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://opencollective.com/express" } }, - "node_modules/micromark": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", - "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "funding": [ + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz", + "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fs-extra": { + "version": "11.4.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.1.tgz", + "integrity": "sha512-KYAb4c9BJQI6QqGKthV68OHe0badztdXJWKo0WtBA9IuCFPTKvE5ZdUBglP833aMjhaSPNO4A5j/EkzZtGlKjA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC", + "optional": true + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.13.13", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.13.tgz", + "integrity": "sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.7.4", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.4.tgz", + "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jose": { + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.12.tgz", + "integrity": "sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/js-tiktoken": { + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.21.tgz", + "integrity": "sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g==", + "dev": true, + "license": "MIT", + "dependencies": { + "base64-js": "^1.5.1" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/koffi": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/koffi/-/koffi-3.2.1.tgz", + "integrity": "sha512-0qE3lZ8jllRqPN4Ob6Ajl7c2bJSJDhQWuKLGP5hIEpHLllJWv1ydHFMhHmHc5p/W9GticKVDbYzZd7TBoQ4CZg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "funding": { + "url": "https://liberapay.com/Koromix" + }, + "optionalDependencies": { + "@koromix/koffi-android-arm64": "3.2.1", + "@koromix/koffi-android-x64": "3.2.1", + "@koromix/koffi-darwin-arm64": "3.2.1", + "@koromix/koffi-darwin-x64": "3.2.1", + "@koromix/koffi-freebsd-arm64": "3.2.1", + "@koromix/koffi-freebsd-ia32": "3.2.1", + "@koromix/koffi-freebsd-x64": "3.2.1", + "@koromix/koffi-linux-arm": "3.2.1", + "@koromix/koffi-linux-arm64": "3.2.1", + "@koromix/koffi-linux-ia32": "3.2.1", + "@koromix/koffi-linux-loong64": "3.2.1", + "@koromix/koffi-linux-riscv64": "3.2.1", + "@koromix/koffi-linux-x64": "3.2.1", + "@koromix/koffi-openbsd-ia32": "3.2.1", + "@koromix/koffi-openbsd-x64": "3.2.1", + "@koromix/koffi-win32-arm64": "3.2.1", + "@koromix/koffi-win32-ia32": "3.2.1", + "@koromix/koffi-win32-x64": "3.2.1" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.1.0.tgz", + "integrity": "sha512-KRLgmPaP2H1ul2bpoJkOS+9pAcDAAj9Nu1mqLnh8NLeJG5tlvj42TH80PIGBpROWlRXLk0lDrWNuZCFy/tsB4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/media-typer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz", + "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/micromark": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.3.tgz", + "integrity": "sha512-oGYfQzHSG5dOMovQcJ3fyTmZlWAWpi0XA0sJwJs+i6OT88o1+Jtw/8z0CmdowSLxGhhFK89rQ/oXph/wN02PNw==", + "dev": true, + "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" @@ -1315,6 +2227,7 @@ "micromark-util-chunked": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-edit-map": "^1.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", @@ -1325,9 +2238,241 @@ } }, "node_modules/micromark-core-commonmark": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", - "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.4.tgz", + "integrity": "sha512-wxEeE8v8XVvOrxn1TZj74qYhAtTQsSqufHVS3uNVyT1MupXxhyaHk8/9xDNPh9BmL77QNDgWTkZ3RsYHB2ry7w==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.1.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-edit-map": "^1.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.3" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.1.0.tgz", + "integrity": "sha512-fS8hnLIjnjvdQIj39Geug8wWsR0HrYZ43KShKxNfwT7t2LOHo/LbWZEzEaSOjwtjdCsjoE6syHhonEzW0zv0+Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", "dev": true, "funding": [ { @@ -1341,28 +2486,13 @@ ], "license": "MIT", "dependencies": { - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-factory-destination": "^2.0.0", - "micromark-factory-label": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-factory-title": "^2.0.0", - "micromark-factory-whitespace": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-html-tag-name": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/micromark-factory-destination": { + "node_modules/micromark-util-decode-string": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", - "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", "dev": true, "funding": [ { @@ -1376,15 +2506,16 @@ ], "license": "MIT", "dependencies": { + "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/micromark-factory-label": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", - "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "node_modules/micromark-util-edit-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-edit-map/-/micromark-util-edit-map-1.0.0.tgz", + "integrity": "sha512-Pa2ljlsEL6sVwFaYeyrOLSYbQt73JvGbPOYFq+9AElXiSnfI5Q4465RRZ1sHv7lDjDOnGRDDaqPXqClqWK/q1Q==", "dev": true, "funding": [ { @@ -1398,16 +2529,13 @@ ], "license": "MIT", "dependencies": { - "devlop": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-factory-space": { + "node_modules/micromark-util-encode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", - "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", "dev": true, "funding": [ { @@ -1419,16 +2547,12 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } + "license": "MIT" }, - "node_modules/micromark-factory-title": { + "node_modules/micromark-util-html-tag-name": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", - "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", "dev": true, "funding": [ { @@ -1440,18 +2564,12 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } + "license": "MIT" }, - "node_modules/micromark-factory-whitespace": { + "node_modules/micromark-util-normalize-identifier": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", - "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", "dev": true, "funding": [ { @@ -1465,16 +2583,13 @@ ], "license": "MIT", "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", "dev": true, "funding": [ { @@ -1488,14 +2603,13 @@ ], "license": "MIT", "dependencies": { - "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-chunked": { + "node_modules/micromark-util-sanitize-uri": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", - "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", "dev": true, "funding": [ { @@ -1509,13 +2623,15 @@ ], "license": "MIT", "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, - "node_modules/micromark-util-classify-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", - "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, "funding": [ { @@ -1529,15 +2645,16 @@ ], "license": "MIT", "dependencies": { - "micromark-util-character": "^2.0.0", + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-combine-extensions": { + "node_modules/micromark-util-symbol": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", - "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", "dev": true, "funding": [ { @@ -1549,16 +2666,12 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "dependencies": { - "micromark-util-chunked": "^2.0.0", - "micromark-util-types": "^2.0.0" - } + "license": "MIT" }, - "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", - "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "node_modules/micromark-util-types": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.3.tgz", + "integrity": "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==", "dev": true, "funding": [ { @@ -1570,215 +2683,456 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "dev": true, "license": "MIT", "dependencies": { - "micromark-util-symbol": "^2.0.0" + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/micromark-util-decode-string": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", - "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/negotiator/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/qs": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz", + "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "license": "MIT", "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-symbol": "^2.0.0" + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" } }, - "node_modules/micromark-util-encode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", - "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "license": "MIT" }, - "node_modules/micromark-util-html-tag-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", - "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } }, - "node_modules/micromark-util-normalize-identifier": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", - "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "license": "MIT", "dependencies": { - "micromark-util-symbol": "^2.0.0" + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/micromark-util-resolve-all": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", - "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "license": "MIT", "dependencies": { - "micromark-util-types": "^2.0.0" + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", - "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "license": "MIT", "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/micromark-util-subtokenize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", - "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "license": "MIT", "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/micromark-util-types": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", - "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/node-addon-api": { - "version": "8.9.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.9.2.tgz", - "integrity": "sha512-VijLXbi3UACN69I0JVXJsX4tjACjNoQDgv2gTF6sx2wWEi8tkSg2eX8p5gSIFi8z2+DL3oHmY6OyKce38SDolg==", + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", "engines": { - "node": "^18 || ^20 || >= 21" + "node": ">= 0.8" } }, - "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "node": ">=0.6" } }, "node_modules/tslib": { @@ -1788,6 +3142,39 @@ "dev": true, "license": "0BSD" }, + "node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "dev": true, + "license": "MIT", + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/unist-util-stringify-position": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", @@ -1813,10 +3200,20 @@ "node": ">= 10.0.0" } }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/uuid": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz", - "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.3.tgz", + "integrity": "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==", "dev": true, "funding": [ "https://github.com/sponsors/broofa", @@ -1828,6 +3225,16 @@ "uuid": "dist-node/bin/uuid" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/vscode-jsonrpc": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.1.tgz", @@ -1838,10 +3245,33 @@ "node": ">=14.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, "node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", "dev": true, "license": "ISC", "bin": { @@ -1855,14 +3285,24 @@ } }, "node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "dev": true, + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } } } } diff --git a/eng/common/scripts/eval/package.json b/eng/common/scripts/eval/package.json index b0473fcf8061..89cfac379ca6 100644 --- a/eng/common/scripts/eval/package.json +++ b/eng/common/scripts/eval/package.json @@ -5,12 +5,12 @@ "description": "Vally eval CI glue scripts (matrix sharding, shard runner, JUnit summary) plus the pinned @microsoft/vally-cli the shards install from the committed lockfile. Synced via eng/common; not published.", "type": "module", "engines": { - "node": ">=22.12.0" + "node": ">=24.14.1" }, "scripts": { "test": "node --experimental-strip-types --test" }, "devDependencies": { - "@microsoft/vally-cli": "0.14.0" + "@microsoft/vally-cli": "0.19.0" } } diff --git a/eng/common/scripts/eval/publisher/test/publisher.test.ts b/eng/common/scripts/eval/publisher/test/publisher.test.ts index 8497bb00a448..e566a87e1e28 100644 --- a/eng/common/scripts/eval/publisher/test/publisher.test.ts +++ b/eng/common/scripts/eval/publisher/test/publisher.test.ts @@ -374,7 +374,17 @@ for (const tier of ["workflow", "skill", "live"]) test(`${tier} forwards only th assert.doesNotMatch(content, /eval-dashboard\.yml|EvalDashboardPublicationEnabled|System.DefinitionId|autoPublishDashboardResults|allowAzureStorageNetworkAccess/); const inputs = content.slice(content.indexOf("\nparameters:\n"), content.indexOf("\nvariables:\n")); assert.deepEqual([...inputs.matchAll(/- name: (\w+)/g)].map(match => match[1]), ["publishDashboardResults"]); - assert.doesNotMatch(content, /group: AzSDK_Eval_Variable_group/); assert.match(content, new RegExp(`TestType: ${tier === "live" ? "live" : "mock"}`)); + assert.doesNotMatch(content, /group:\s*AzSDK_Eval_Variable_group/); + assert.match(content, /template: \/eng\/common\/pipelines\/templates\/stages\/archetype-eval\.yml/); + const shard = await readFile(join(root, "pipelines/templates/jobs/eval-shard.yml"), "utf8"); + assert.match(shard, /template: \/eng\/common\/pipelines\/templates\/steps\/login-to-copilot\.yml/); + const login = await readFile(join(root, "pipelines/templates/steps/login-to-copilot.yml"), "utf8"); + assert.match(login, /template: \/eng\/common\/pipelines\/templates\/steps\/login-to-github\.yml/); + assert.match(login, /VariableNamePrefix:\s*COPILOT_GITHUB_TOKEN/); + assert.ok(login.includes("- ${{ split(variables['Build.Repository.Name'], '/')[1] }}")); + assert.match(login, /organization_copilot_requests:\s*read/); + assert.match(login, /metadata:\s*read/); + assert.match(content, new RegExp(`TestType: ${tier === "live" ? "live" : "mock"}`)); if (tier === "live") { assert.match(content, /UseAzSdkAuthentication: true/); assert.match(content, /failOnFailedTests: true/); } if (tier === "skill") assert.match(content, /vallyRoot: \.github\/skills/); }); \ No newline at end of file From f5a37753cacc69bd93d854c177db27970201e6af Mon Sep 17 00:00:00 2001 From: anjaliratnam-msft Date: Thu, 22 Oct 2026 13:53:06 -0700 Subject: [PATCH 26/35] commented out smart tier tests (#49644) --- .../tests/test_blob_storage_account.py | 8 ++- .../tests/test_blob_storage_account_async.py | 8 ++- .../tests/test_block_blob.py | 58 +++++++++--------- .../tests/test_block_blob_async.py | 60 +++++++++---------- .../tests/test_common_blob.py | 38 ++++++------ .../tests/test_common_blob_async.py | 38 ++++++------ 6 files changed, 109 insertions(+), 101 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py index 07b758daaef5..262fc6cef18e 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py @@ -54,8 +54,12 @@ def test_standard_blob_tier_set_tier_api(self, **kwargs): bsc = BlobServiceClient(self.account_url(storage_account_name, "blob"), credential=storage_account_key.secret) self._setup(bsc) - tiers = [StandardBlobTier.Archive, StandardBlobTier.Cool, StandardBlobTier.Hot, StandardBlobTier.SMART] - + tiers = [ + StandardBlobTier.Archive, + StandardBlobTier.Cool, + StandardBlobTier.Hot, + # StandardBlobTier.SMART, + ] for tier in tiers: blob_name = self.get_resource_name(tier.value) blob = bsc.get_blob_client(self.container_name, blob_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py index ef907643f5b5..16d1cefa8462 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py @@ -54,8 +54,12 @@ async def test_standard_blob_tier_set_tier_api(self, **kwargs): bsc = BlobServiceClient(self.account_url(storage_account_name, "blob"), credential=storage_account_key.secret) await self._setup(bsc) - tiers = [StandardBlobTier.Archive, StandardBlobTier.Cool, StandardBlobTier.Hot, StandardBlobTier.SMART] - + tiers = [ + StandardBlobTier.Archive, + StandardBlobTier.Cool, + StandardBlobTier.Hot, + # StandardBlobTier.SMART, + ] for tier in tiers: blob_name = self.get_resource_name(tier.value) blob = bsc.get_blob_client(self.container_name, blob_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index b1c1376af25d..6bcb0a2ff303 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -2132,35 +2132,35 @@ def test_commit_block_list_uds(self, **kwargs): return variables - @BlobPreparer() - @recorded_by_proxy - def test_smart_access_tier(self, **kwargs): - storage_account_name = kwargs.pop("storage_account_name") - storage_account_key = kwargs.pop("storage_account_key") - - self._setup(storage_account_name, storage_account_key) - - data = b"abc123" * 4 - blob1 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) - blob1.upload_blob(data, standard_blob_tier=StandardBlobTier.SMART, overwrite=True) - props = blob1.get_blob_properties() - assert props.blob_tier == StandardBlobTier.SMART - assert props.smart_access_tier is not None - - blob2 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) - blob2.upload_blob(data, standard_blob_tier=StandardBlobTier.COOL, overwrite=True) - props = blob2.get_blob_properties() - assert props.blob_tier == StandardBlobTier.COOL - assert props.smart_access_tier is None - - blob2.set_standard_blob_tier(standard_blob_tier=StandardBlobTier.SMART) - props = blob2.get_blob_properties() - assert props.blob_tier == StandardBlobTier.SMART - assert props.smart_access_tier is not None - - for blob in self.bsc.get_container_client(self.container_name).list_blobs(): - assert blob.blob_tier == StandardBlobTier.SMART - assert blob.smart_access_tier is not None + # @BlobPreparer() + # @recorded_by_proxy + # def test_smart_access_tier(self, **kwargs): + # storage_account_name = kwargs.pop("storage_account_name") + # storage_account_key = kwargs.pop("storage_account_key") + + # self._setup(storage_account_name, storage_account_key) + + # data = b"abc123" * 4 + # blob1 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) + # blob1.upload_blob(data, standard_blob_tier=StandardBlobTier.SMART, overwrite=True) + # props = blob1.get_blob_properties() + # assert props.blob_tier == StandardBlobTier.SMART + # assert props.smart_access_tier is not None + + # blob2 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) + # blob2.upload_blob(data, standard_blob_tier=StandardBlobTier.COOL, overwrite=True) + # props = blob2.get_blob_properties() + # assert props.blob_tier == StandardBlobTier.COOL + # assert props.smart_access_tier is None + + # blob2.set_standard_blob_tier(standard_blob_tier=StandardBlobTier.SMART) + # props = blob2.get_blob_properties() + # assert props.blob_tier == StandardBlobTier.SMART + # assert props.smart_access_tier is not None + + # for blob in self.bsc.get_container_client(self.container_name).list_blobs(): + # assert blob.blob_tier == StandardBlobTier.SMART + # assert blob.smart_access_tier is not None def test_block_blob_upload_generates_unique_ordered_block_ids(self): # Each staged block must get a unique block ID, and the block list must be diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index 0ebbdcb2502e..af0f5d865641 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -2257,36 +2257,36 @@ async def test_commit_block_list_uds(self, **kwargs): return variables - @BlobPreparer() - @recorded_by_proxy_async - async def test_smart_access_tier(self, **kwargs): - storage_account_name = kwargs.pop("storage_account_name") - storage_account_key = kwargs.pop("storage_account_key") - - await self._setup(storage_account_name, storage_account_key) - - data = b"abc123" * 4 - blob1 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) - await blob1.upload_blob(data, standard_blob_tier=StandardBlobTier.SMART, overwrite=True) - props = await blob1.get_blob_properties() - assert props.blob_tier == StandardBlobTier.SMART - assert props.smart_access_tier is not None - - blob2 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) - await blob2.upload_blob(data, standard_blob_tier=StandardBlobTier.COOL, overwrite=True) - props = await blob2.get_blob_properties() - assert props.blob_tier == StandardBlobTier.COOL - assert props.smart_access_tier is None - - await blob2.set_standard_blob_tier(standard_blob_tier=StandardBlobTier.SMART) - props = await blob2.get_blob_properties() - assert props.blob_tier == StandardBlobTier.SMART - assert props.smart_access_tier is not None - - cc = self.bsc.get_container_client(self.container_name) - async for blob in cc.list_blobs(): - assert blob.blob_tier == StandardBlobTier.SMART - assert blob.smart_access_tier is not None + # @BlobPreparer() + # @recorded_by_proxy_async + # async def test_smart_access_tier(self, **kwargs): + # storage_account_name = kwargs.pop("storage_account_name") + # storage_account_key = kwargs.pop("storage_account_key") + + # await self._setup(storage_account_name, storage_account_key) + + # data = b"abc123" * 4 + # blob1 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) + # await blob1.upload_blob(data, standard_blob_tier=StandardBlobTier.SMART, overwrite=True) + # props = await blob1.get_blob_properties() + # assert props.blob_tier == StandardBlobTier.SMART + # assert props.smart_access_tier is not None + + # blob2 = self.bsc.get_blob_client(self.container_name, self._get_blob_reference()) + # await blob2.upload_blob(data, standard_blob_tier=StandardBlobTier.COOL, overwrite=True) + # props = await blob2.get_blob_properties() + # assert props.blob_tier == StandardBlobTier.COOL + # assert props.smart_access_tier is None + + # await blob2.set_standard_blob_tier(standard_blob_tier=StandardBlobTier.SMART) + # props = await blob2.get_blob_properties() + # assert props.blob_tier == StandardBlobTier.SMART + # assert props.smart_access_tier is not None + + # cc = self.bsc.get_container_client(self.container_name) + # async for blob in cc.list_blobs(): + # assert blob.blob_tier == StandardBlobTier.SMART + # assert blob.smart_access_tier is not None def test_block_blob_upload_generates_unique_ordered_block_ids(self): # Each staged block must get a unique block ID, and the block list must be diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index 7bf7aacef7c7..65417231cd3e 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -4030,24 +4030,24 @@ def test_blob_fns_directory_fail(self, **kwargs): return variables - @BlobPreparer() - @recorded_by_proxy - def test_download_blob_returns_access_tier(self, **kwargs): - storage_account_name = kwargs.pop("storage_account_name") - storage_account_key = kwargs.pop("storage_account_key") - - self._setup(storage_account_name, storage_account_key) - blob = self.bsc.get_container_client(self.container_name).get_blob_client(self._get_blob_reference()) - blob.upload_blob(b"hello world", overwrite=True) - blob.set_standard_blob_tier(StandardBlobTier.SMART) - - # Act - downloader = blob.download_blob() - - # Assert - assert StandardBlobTier.SMART == downloader.properties.blob_tier - assert downloader.properties.smart_access_tier is not None - assert downloader.properties.blob_tier_change_time is not None - assert not downloader.properties.blob_tier_inferred + # @BlobPreparer() + # @recorded_by_proxy + # def test_download_blob_returns_access_tier(self, **kwargs): + # storage_account_name = kwargs.pop("storage_account_name") + # storage_account_key = kwargs.pop("storage_account_key") + + # self._setup(storage_account_name, storage_account_key) + # blob = self.bsc.get_container_client(self.container_name).get_blob_client(self._get_blob_reference()) + # blob.upload_blob(b"hello world", overwrite=True) + # blob.set_standard_blob_tier(StandardBlobTier.SMART) + + # # Act + # downloader = blob.download_blob() + + # # Assert + # assert StandardBlobTier.SMART == downloader.properties.blob_tier + # assert downloader.properties.smart_access_tier is not None + # assert downloader.properties.blob_tier_change_time is not None + # assert not downloader.properties.blob_tier_inferred # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index df7a4bc4d1ed..e283c81a4e7d 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -3909,25 +3909,25 @@ async def test_blob_fns_directory_fail(self, **kwargs): return variables - @BlobPreparer() - @recorded_by_proxy_async - async def test_download_blob_returns_access_tier(self, **kwargs): - storage_account_name = kwargs.pop("storage_account_name") - storage_account_key = kwargs.pop("storage_account_key") - - await self._setup(storage_account_name, storage_account_key) - blob = self.bsc.get_container_client(self.container_name).get_blob_client(self._get_blob_reference()) - await blob.upload_blob(b"hello world") - await blob.set_standard_blob_tier(StandardBlobTier.SMART) - - # Act - downloader = await blob.download_blob() - - # Assert - assert StandardBlobTier.SMART == downloader.properties.blob_tier - assert downloader.properties.smart_access_tier is not None - assert downloader.properties.blob_tier_change_time is not None - assert not downloader.properties.blob_tier_inferred + # @BlobPreparer() + # @recorded_by_proxy_async + # async def test_download_blob_returns_access_tier(self, **kwargs): + # storage_account_name = kwargs.pop("storage_account_name") + # storage_account_key = kwargs.pop("storage_account_key") + + # await self._setup(storage_account_name, storage_account_key) + # blob = self.bsc.get_container_client(self.container_name).get_blob_client(self._get_blob_reference()) + # await blob.upload_blob(b"hello world") + # await blob.set_standard_blob_tier(StandardBlobTier.SMART) + + # # Act + # downloader = await blob.download_blob() + + # # Assert + # assert StandardBlobTier.SMART == downloader.properties.blob_tier + # assert downloader.properties.smart_access_tier is not None + # assert downloader.properties.blob_tier_change_time is not None + # assert not downloader.properties.blob_tier_inferred # ------------------------------------------------------------------------------ From eb4f27da55e7d3834bccd5e07828d58ebaea08e0 Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:47:03 -0700 Subject: [PATCH 27/35] Sync .github/skills directory with azure-sdk-tools for PR 17350 (#49671) * Fix Vally 0.19 schema loading outside TypeSpec benchmarks * Fix hermetic eval fixtures and mock prerequisites * Trim eval upgrade to minimal configuration fixes --------- Co-authored-by: helen229 --- .../evals/eval.yaml | 2 +- .../azsdk-common-generate-sdk-locally/evals/eval.yaml | 2 +- .../evals/trigger.eval.yaml | 9 +++++++++ .../azsdk-common-prepare-release-plan/evals/eval.yaml | 2 +- .../evals/schedule-risk.eval.yaml | 4 +++- .../evals/trigger.eval.yaml | 3 +++ .../skills/azsdk-common-sdk-release/evals/eval.yaml | 10 +++++++--- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml b/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml index 22daf2988b0a..b2473a5341b5 100644 --- a/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml +++ b/.github/skills/azsdk-common-apiview-feedback-resolution/evals/eval.yaml @@ -8,7 +8,7 @@ tags: area: azsdk-common-apiview-feedback-resolution type: ci-gate -config: +defaults: runs: 1 timeout: "90s" model: gpt-6.1-sol diff --git a/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml b/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml index 3ce10aed89b6..5856f2c07a64 100644 --- a/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml +++ b/.github/skills/azsdk-common-generate-sdk-locally/evals/eval.yaml @@ -8,7 +8,7 @@ tags: area: azsdk-common-generate-sdk-locally type: ci-gate -config: +defaults: runs: 1 timeout: "90s" model: gpt-6.1-sol diff --git a/.github/skills/azsdk-common-generate-sdk-locally/evals/trigger.eval.yaml b/.github/skills/azsdk-common-generate-sdk-locally/evals/trigger.eval.yaml index 2ebf85d89760..b33524cda990 100644 --- a/.github/skills/azsdk-common-generate-sdk-locally/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-generate-sdk-locally/evals/trigger.eval.yaml @@ -20,6 +20,10 @@ scoring: stimuli: - name: trigger-generate-python-sdk-locally prompt: "Generate the Python SDK locally from my TypeSpec project at specification/compute/resource-manager/Microsoft.Compute/ComputeRP/tspconfig.yaml." + environment: + skills: + - .. + - ../../azsdk-common-sdk-breaking-change graders: - type: skill-invocation config: @@ -28,7 +32,12 @@ stimuli: # Should NOT trigger - name: anti-trigger-mitigate-breaking-change prompt: "Fix the SDK breaking changes" + environment: + skills: + - .. + - ../../azsdk-common-sdk-breaking-change graders: - type: skill-invocation config: + required: ["azsdk-common-sdk-breaking-change"] disallowed: ["azsdk-common-generate-sdk-locally"] diff --git a/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml b/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml index 548a435dd598..615883a4d2e1 100644 --- a/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml +++ b/.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml @@ -8,7 +8,7 @@ tags: area: azsdk-common-prepare-release-plan type: ci-gate -config: +defaults: runs: 1 timeout: "90s" model: gpt-6.1-sol diff --git a/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml b/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml index bc5e8a9bca30..a87fdcf1f099 100644 --- a/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml +++ b/.github/skills/azsdk-common-prepare-release-plan/evals/schedule-risk.eval.yaml @@ -58,6 +58,7 @@ stimuli: config: substring: "https://github.com/Azure/azure-rest-api-specs/pull/12345" + # The new target stays future-proof; the mock's older plan supplies the warning. - name: create-relays-past-due-guidance environment: skills: @@ -65,7 +66,8 @@ stimuli: prompt: | Create a public preview release plan for TypeSpec project specification/contosowidgetmanager/Contoso.WidgetManager with target - release month June 2026, spec PR + release month next calendar month (resolve to an explicit month and year + using the current date), spec PR https://github.com/Azure/azure-rest-api-specs/pull/38387, service tree ID a7f2b8e4-9c1d-4a3e-b6f9-2d8e5a7c3b1f, and product tree ID f1a8c5d2-6e4b-4f7a-9c2d-8b5e1f3a6c9e. Use the Azure SDK MCP tools. diff --git a/.github/skills/azsdk-common-sdk-breaking-change/evals/trigger.eval.yaml b/.github/skills/azsdk-common-sdk-breaking-change/evals/trigger.eval.yaml index 933bdcfb40f5..6a0ba6107815 100644 --- a/.github/skills/azsdk-common-sdk-breaking-change/evals/trigger.eval.yaml +++ b/.github/skills/azsdk-common-sdk-breaking-change/evals/trigger.eval.yaml @@ -20,6 +20,9 @@ scoring: stimuli: - name: trigger-detect-sdk-breaking-changes-for-service prompt: "Detect and mitigate SDK breaking changes for the service webpubsub" + environment: + skills: + - .. graders: - type: skill-invocation config: diff --git a/.github/skills/azsdk-common-sdk-release/evals/eval.yaml b/.github/skills/azsdk-common-sdk-release/evals/eval.yaml index e4604b9e2b05..b73345200b0d 100644 --- a/.github/skills/azsdk-common-sdk-release/evals/eval.yaml +++ b/.github/skills/azsdk-common-sdk-release/evals/eval.yaml @@ -8,7 +8,7 @@ tags: area: azsdk-common-sdk-release type: ci-gate -config: +defaults: runs: 1 timeout: "90s" model: gpt-6.1-sol @@ -60,12 +60,16 @@ stimuli: - name: basic-trigger prompt: "I need to release a new version of my Azure SDK package. Walk me through the process." + environment: + skills: + - .. graders: - type: output-contains config: substring: "release" - constraints: - expect_skills: ["azsdk-common-sdk-release"] + - type: skill-invocation + config: + required: ["azsdk-common-sdk-release"] - name: anti-trigger prompt: "How do I write unit tests for my Azure SDK client?" From 84df362806a0caa4da1ac00578cdf76e97fa57cc Mon Sep 17 00:00:00 2001 From: xitzhang Date: Thu, 22 Oct 2026 17:29:45 -0700 Subject: [PATCH 28/35] [VoiceLive]Fix Voice Live WebSocket credential forwarding on redirects (#49665) * Fix Voice Live WebSocket credential forwarding on redirects Reject HTTP redirects during the WebSocket handshake before credentials can be forwarded. Add same-origin and cross-origin regression coverage and document the fix in the changelog. Validation: 89 targeted tests and 4 live E2E tests passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Make Voice Live redirect tests portable on macOS Bind both local test servers to 127.0.0.1 and retain cross-origin coverage through their distinct ephemeral ports. This avoids relying on an additional loopback address that is not configured on macOS runners. Validation: 89 targeted redirect and connection tests passed locally. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update CHANGELOG.md --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/voicelive/azure-ai-voicelive/CHANGELOG.md | 6 +- .../azure/ai/voicelive/aio/_patch.py | 15 +- .../unit/test_unit_websocket_redirects.py | 132 ++++++++++++++++++ 3 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_websocket_redirects.py diff --git a/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md b/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md index e75018f44514..73b0231bdd93 100644 --- a/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md +++ b/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md @@ -1,6 +1,10 @@ # Release History -## 1.3.1 (Unreleased) +## 1.3.1 (2026-10-23) + +### Bugs Fixed + +- WebSocket connections now reject HTTP redirects to prevent forwarding authentication headers to redirected endpoints. ### Other Changes diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py index 2c86c78cd0c4..cc6cd54d7e09 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py @@ -13,6 +13,7 @@ import json import logging from contextlib import AbstractAsyncContextManager +from types import SimpleNamespace from urllib.parse import urlparse, urlunparse, urlencode, parse_qs from typing import Any, Mapping, Optional, Sequence, Union, AsyncIterator, cast, overload @@ -665,6 +666,15 @@ class WebsocketConnectionOptions(TypedDict, total=False): vendor_options: NotRequired[Mapping[str, Any]] +async def _reject_websocket_redirect( + _session: aiohttp.ClientSession, + _trace_config_ctx: SimpleNamespace, + params: aiohttp.TraceRequestRedirectParams, +) -> None: + params.response.close() + raise aiohttp.ClientError("WebSocket redirects are not supported.") + + class _VoiceLiveConnectionManager( AbstractAsyncContextManager["VoiceLiveConnection"] ): # pylint: disable=too-many-instance-attributes @@ -782,7 +792,10 @@ async def __aenter__(self) -> VoiceLiveConnection: if not any(name.lower() == "user-agent" for name in headers): headers["User-Agent"] = _USER_AGENT - session = aiohttp.ClientSession() + # ws_connect does not expose allow_redirects; reject before credentials can be forwarded. + trace_config = aiohttp.TraceConfig() + trace_config.on_request_redirect.append(_reject_websocket_redirect) + session = aiohttp.ClientSession(trace_configs=[trace_config]) try: connection_obj = await session.ws_connect(str(url), headers=headers, **self.__connection_options) self.__connection = VoiceLiveConnection( diff --git a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_websocket_redirects.py b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_websocket_redirects.py new file mode 100644 index 000000000000..dc60c0799938 --- /dev/null +++ b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_websocket_redirects.py @@ -0,0 +1,132 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# -------------------------------------------------------------------------- + +from unittest.mock import AsyncMock + +import pytest + +aiohttp = pytest.importorskip( + "aiohttp", + reason="Skipping aio tests: aiohttp not installed (whl_no_aio).", +) + +from aiohttp import web +from aiohttp.test_utils import TestServer as AiohttpTestServer + +from azure.ai.voicelive.aio import ConnectionError, connect +from azure.core.credentials import AccessToken, AzureKeyCredential +from azure.core.credentials_async import AsyncTokenCredential + + +@pytest.fixture(params=["api-key", "Authorization"]) +def credential_and_headers(request): + if request.param == "api-key": + return AzureKeyCredential("fake-key"), {"api-key": "fake-key"} + + credential = AsyncMock(spec=AsyncTokenCredential) + credential.get_token.return_value = AccessToken("fake-token", 2147483647) + return credential, {"Authorization": "Bearer fake-token"} + + +@pytest.fixture(params=["model", "agent"]) +def connection_kwargs(request): + if request.param == "model": + return {"model": "gpt-4o"} + return {"agent_name": "test-agent", "project_name": "test-project"} + + +@pytest.fixture +def client_sessions(monkeypatch): + sessions = [] + original_client_session = aiohttp.ClientSession + + def create_session(*args, **kwargs): + session = original_client_session(*args, **kwargs) + sessions.append(session) + return session + + monkeypatch.setattr(aiohttp, "ClientSession", create_session) + return sessions + + +@pytest.mark.asyncio +@pytest.mark.parametrize("status", [301, 302, 303, 307, 308]) +@pytest.mark.parametrize("cross_origin", [False, True], ids=["same-origin", "cross-origin"]) +async def test_websocket_redirects_are_rejected( + status, cross_origin, credential_and_headers, connection_kwargs, client_sessions +): + credential, expected_headers = credential_and_headers + initial_requests = [] + redirected_requests = [] + + async def capture_redirect(request): + redirected_requests.append(dict(request.headers)) + return web.Response(status=403) + + target_app = web.Application() + target_app.router.add_get("/redirected", capture_redirect) + + # Different ports provide cross-origin coverage without requiring another loopback address. + async with AiohttpTestServer(target_app, host="127.0.0.1") as target: + + async def redirect(request): + initial_requests.append(dict(request.headers)) + location = str(target.make_url("/redirected")) if cross_origin else "/redirected" + return web.Response(status=status, headers={"Location": location}) + + source_app = web.Application() + source_app.router.add_get("/voice-live/realtime", redirect) + source_app.router.add_get("/redirected", capture_redirect) + + async with AiohttpTestServer(source_app, host="127.0.0.1") as source: + with pytest.raises(ConnectionError) as exc_info: + async with connect( + credential=credential, + endpoint=str(source.make_url("")), + **connection_kwargs, + ): + pytest.fail("A redirected WebSocket handshake must not succeed.") + + assert len(initial_requests) == 1 + for header, value in expected_headers.items(): + assert initial_requests[0][header] == value + assert redirected_requests == [] + assert "WebSocket redirects are not supported." in str(exc_info.value) + assert isinstance(exc_info.value.__cause__, aiohttp.ClientError) + assert len(client_sessions) == 1 + assert client_sessions[0].closed + + +@pytest.mark.asyncio +async def test_nonredirected_websocket_handshake_succeeds( + credential_and_headers, connection_kwargs, client_sessions +): + credential, expected_headers = credential_and_headers + initial_requests = [] + + async def accept_websocket(request): + initial_requests.append(dict(request.headers)) + websocket = web.WebSocketResponse() + await websocket.prepare(request) + await websocket.close() + return websocket + + app = web.Application() + app.router.add_get("/voice-live/realtime", accept_websocket) + + async with AiohttpTestServer(app, host="127.0.0.1") as server: + async with connect( + credential=credential, + endpoint=str(server.make_url("")), + **connection_kwargs, + ): + assert len(client_sessions) == 1 + assert not client_sessions[0].closed + + assert len(initial_requests) == 1 + for header, value in expected_headers.items(): + assert initial_requests[0][header] == value + assert client_sessions[0].closed From 9cff46f49bef32f7508d40bd68cc86205c62b3ca Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 20:34:46 -0700 Subject: [PATCH 29/35] [AutoPR azure-mgmt-netapp]-generated-from-SDK Generation - Python-6982798 (#49621) * Configurations: 'specification/netapp/resource-manager/Microsoft.NetApp/NetApp/tspconfig.yaml', API Version: 2026-08-01, SDK Release Type: stable, and CommitSHA: '52d43820f214975f29c5d263e0311210dd7e336b' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6979692 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * generated-from-SDK Generation - Python-6979692- #49621 * Configurations: 'specification/netapp/resource-manager/Microsoft.NetApp/NetApp/tspconfig.yaml', and CommitSHA: '2371f14ab26ab99500de46ac5c507476a8e0fc61' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6982798 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md --------- Co-authored-by: azure-sdk Co-authored-by: Nandakumar Siddavaram Co-authored-by: Nandakumar Siddavaram <123510087+nandakus2@users.noreply.github.com> Co-authored-by: Chenxi Jiang <119990644+ChenxiJiang333@users.noreply.github.com> --- sdk/netapp/azure-mgmt-netapp/CHANGELOG.md | 26 + sdk/netapp/azure-mgmt-netapp/_metadata.json | 10 +- sdk/netapp/azure-mgmt-netapp/api.md | 14289 ++++----- sdk/netapp/azure-mgmt-netapp/api.metadata.yml | 5 +- .../azure-mgmt-netapp/apiview-properties.json | 201 +- sdk/netapp/azure-mgmt-netapp/assets.json | 2 +- .../azure/mgmt/netapp/_client.py | 59 +- .../azure/mgmt/netapp/_configuration.py | 9 +- .../azure/mgmt/netapp/_version.py | 2 +- .../azure/mgmt/netapp/aio/_client.py | 61 +- .../azure/mgmt/netapp/aio/_configuration.py | 9 +- .../mgmt/netapp/aio/operations/__init__.py | 18 - .../mgmt/netapp/aio/operations/_operations.py | 9992 +----- .../azure/mgmt/netapp/models/__init__.py | 170 +- .../azure/mgmt/netapp/models/_enums.py | 243 +- .../azure/mgmt/netapp/models/_models.py | 3427 +-- .../azure/mgmt/netapp/operations/__init__.py | 18 - .../mgmt/netapp/operations/_operations.py | 25355 +++++----------- .../azure/mgmt/netapp/types.py | 2089 +- .../accounts_change_key_vault.py | 2 +- .../accounts_create_or_update.py | 2 +- .../accounts_create_or_update_ad.py | 2 +- .../accounts_create_or_update_ldap_config.py | 2 +- .../generated_samples/accounts_delete.py | 2 +- .../generated_samples/accounts_get.py | 2 +- ...counts_get_change_key_vault_information.py | 2 +- .../generated_samples/accounts_list.py | 2 +- .../accounts_list_by_subscription.py | 2 +- .../accounts_refresh_ldap_bind_password.py | 2 +- .../accounts_renew_credentials.py | 2 +- .../accounts_transition_encryption_key.py | 2 +- .../generated_samples/accounts_update.py | 2 +- ...tive_directory_configs_create_or_update.py | 73 - .../active_directory_configs_delete.py | 41 - .../active_directory_configs_get.py | 42 - ...irectory_configs_list_by_resource_group.py | 42 - ..._directory_configs_list_by_subscription.py | 40 - .../active_directory_configs_update.py | 43 - .../backup_policies_create.py | 2 +- .../backup_policies_delete.py | 2 +- .../generated_samples/backup_policies_get.py | 2 +- .../generated_samples/backup_policies_list.py | 2 +- .../backup_policies_update.py | 2 +- .../generated_samples/backup_vaults_create.py | 2 +- .../generated_samples/backup_vaults_delete.py | 2 +- .../generated_samples/backup_vaults_get.py | 2 +- .../generated_samples/backup_vaults_list.py | 2 +- .../generated_samples/backup_vaults_update.py | 2 +- .../backups_list_by_vault.py | 2 +- .../backups_under_account_migrate.py | 2 +- .../backups_under_backup_vault_create.py | 2 +- .../backups_under_backup_vault_delete.py | 2 +- .../backups_under_backup_vault_get.py | 2 +- ..._under_backup_vault_single_file_restore.py | 2 +- .../backups_under_backup_vault_update.py | 2 +- .../backups_under_volume_migrate.py | 2 +- .../buckets_create_or_update.py | 2 +- .../buckets_create_or_update_with_akv.py | 5 +- .../generated_samples/buckets_delete.py | 2 +- .../buckets_generate_akv_credentials.py | 2 +- .../buckets_generate_credentials.py | 2 +- .../generated_samples/buckets_get.py | 2 +- .../generated_samples/buckets_list.py | 2 +- .../buckets_refresh_certificate.py | 2 +- .../generated_samples/buckets_update.py | 2 +- .../buckets_update_with_akv.py | 5 +- .../caches_create_or_update.py | 2 +- .../generated_samples/caches_delete.py | 2 +- .../generated_samples/caches_get.py | 2 +- .../generated_samples/caches_list.py | 2 +- .../caches_list_peering_passphrases.py | 2 +- .../generated_samples/caches_pool_change.py | 2 +- .../caches_reset_smb_password.py | 2 +- .../generated_samples/caches_update.py | 2 +- .../check_file_path_availability.py | 2 +- .../check_name_availability.py | 2 +- .../check_quota_availability.py | 2 +- .../elastic_accounts_create_or_update.py | 43 - .../elastic_accounts_delete.py | 41 - .../generated_samples/elastic_accounts_get.py | 42 - ...elastic_accounts_list_by_resource_group.py | 42 - .../elastic_accounts_list_by_subscription.py | 40 - .../elastic_accounts_update.py | 43 - ...lastic_backup_policies_create_or_update.py | 52 - .../elastic_backup_policies_delete.py | 42 - .../elastic_backup_policies_get.py | 43 - .../elastic_backup_policies_list.py | 43 - .../elastic_backup_policies_update.py | 51 - .../elastic_backup_vaults_create.py | 44 - .../elastic_backup_vaults_delete.py | 42 - .../elastic_backup_vaults_get.py | 43 - ...c_backup_vaults_list_by_elastic_account.py | 43 - .../elastic_backup_vaults_update.py | 44 - .../elastic_backups_create_or_update.py | 53 - .../elastic_backups_delete.py | 43 - .../generated_samples/elastic_backups_get.py | 44 - .../elastic_backups_list_by_vault.py | 44 - .../elastic_backups_update.py | 72 - .../elastic_capacity_pools_change_zone.py | 44 - ...ols_check_volume_file_path_availability.py | 44 - ...elastic_capacity_pools_create_or_update.py | 54 - ...tic_capacity_pools_create_or_update_cmk.py | 58 - .../elastic_capacity_pools_delete.py | 42 - .../elastic_capacity_pools_get.py | 43 - ..._capacity_pools_list_by_elastic_account.py | 43 - .../elastic_capacity_pools_update.py | 50 - ...stic_snapshot_policies_create_or_update.py | 53 - .../elastic_snapshot_policies_delete.py | 42 - .../elastic_snapshot_policies_get.py | 43 - ...apshot_policies_list_by_elastic_account.py | 43 - ..._snapshot_policies_list_elastic_volumes.py | 44 - .../elastic_snapshot_policies_update.py | 52 - .../elastic_snapshots_create_or_update.py | 59 - .../elastic_snapshots_delete.py | 44 - .../elastic_snapshots_get.py | 45 - ...lastic_snapshots_list_by_elastic_volume.py | 45 - .../elastic_volumes_create_or_update.py | 75 - .../elastic_volumes_delete.py | 43 - .../generated_samples/elastic_volumes_get.py | 44 - .../elastic_volumes_list_by_elastic_pool.py | 44 - .../elastic_volumes_revert.py | 48 - .../elastic_volumes_update.py | 66 - .../group_id_list_for_ldap_user.py | 2 +- ...t_app_resource_quota_limits_account_get.py | 2 +- ..._app_resource_quota_limits_account_list.py | 2 +- .../net_app_resource_quota_limits_get.py | 2 +- .../net_app_resource_quota_limits_list.py | 2 +- .../network_sibling_set_query.py | 2 +- .../network_sibling_set_update.py | 2 +- .../generated_samples/operation_list.py | 2 +- .../pools_create_or_update.py | 2 +- ...ools_create_or_update_custom_throughput.py | 2 +- .../generated_samples/pools_delete.py | 2 +- .../generated_samples/pools_get.py | 2 +- .../pools_get_custom_throughput.py | 2 +- .../generated_samples/pools_list.py | 2 +- .../generated_samples/pools_update.py | 2 +- .../pools_update_custom_throughput.py | 2 +- .../ransomware_reports_clear_suspects.py | 2 +- .../ransomware_reports_get.py | 2 +- .../ransomware_reports_list.py | 2 +- .../generated_samples/region_info.py | 2 +- .../generated_samples/region_infos_get.py | 2 +- .../generated_samples/region_infos_list.py | 2 +- .../snapshot_policies_create.py | 2 +- .../snapshot_policies_delete.py | 2 +- .../snapshot_policies_get.py | 2 +- .../snapshot_policies_list.py | 2 +- .../snapshot_policies_list_volumes.py | 2 +- .../snapshot_policies_update.py | 2 +- .../generated_samples/snapshots_create.py | 2 +- .../generated_samples/snapshots_delete.py | 2 +- .../generated_samples/snapshots_get.py | 2 +- .../generated_samples/snapshots_list.py | 2 +- .../snapshots_single_file_restore.py | 2 +- .../generated_samples/snapshots_update.py | 2 +- .../generated_samples/subvolumes_create.py | 2 +- .../generated_samples/subvolumes_delete.py | 2 +- .../generated_samples/subvolumes_get.py | 2 +- .../generated_samples/subvolumes_list.py | 2 +- .../generated_samples/subvolumes_metadata.py | 2 +- .../generated_samples/subvolumes_update.py | 2 +- .../generated_samples/usages_get.py | 2 +- .../generated_samples/usages_list.py | 2 +- .../volume_groups_create_custom.py | 2 +- .../volume_groups_create_custom_smb.py | 2 +- .../volume_groups_create_oracle.py | 2 +- .../volume_groups_create_sap_hana.py | 2 +- .../generated_samples/volume_groups_delete.py | 2 +- .../volume_groups_get_custom.py | 2 +- .../volume_groups_get_custom_smb.py | 2 +- .../volume_groups_get_oracle.py | 2 +- .../volume_groups_get_sap_hana.py | 2 +- .../volume_groups_list_custom.py | 2 +- .../volume_groups_list_oracle.py | 2 +- .../volume_groups_list_sap_hana.py | 2 +- .../volume_quota_rules_create.py | 2 +- .../volume_quota_rules_delete.py | 2 +- .../volume_quota_rules_get.py | 2 +- .../volume_quota_rules_list.py | 2 +- .../volume_quota_rules_update.py | 2 +- .../volumes_authorize_external_replication.py | 2 +- .../volumes_authorize_replication.py | 2 +- .../volumes_break_file_locks.py | 2 +- .../volumes_break_replication.py | 2 +- .../volumes_create_or_update.py | 2 +- .../generated_samples/volumes_delete.py | 2 +- .../volumes_delete_replication.py | 2 +- .../volumes_extra_large_volumes_get.py | 2 +- .../volumes_extra_large_volumes_list.py | 2 +- .../volumes_finalize_external_replication.py | 2 +- .../volumes_finalize_relocation.py | 2 +- .../generated_samples/volumes_get.py | 2 +- .../volumes_latest_backup_status.py | 2 +- .../volumes_latest_restore_status.py | 2 +- .../generated_samples/volumes_list.py | 2 +- .../volumes_list_quota_report.py | 2 +- .../volumes_list_replications.py | 2 +- .../volumes_peer_external_cluster.py | 2 +- .../volumes_perform_replication_transfer.py | 2 +- .../generated_samples/volumes_pool_change.py | 2 +- .../volumes_populate_availability_zones.py | 2 +- .../volumes_re_initialize_replication.py | 2 +- .../volumes_reestablish_replication.py | 2 +- .../generated_samples/volumes_relocate.py | 2 +- .../volumes_replication_status.py | 2 +- .../volumes_reset_cifs_password.py | 2 +- .../volumes_resync_replication.py | 2 +- .../generated_samples/volumes_revert.py | 2 +- .../volumes_revert_relocation.py | 2 +- .../generated_samples/volumes_split_clone.py | 2 +- .../generated_samples/volumes_update.py | 2 +- ..._net_app_management_accounts_operations.py | 32 +- ...pp_management_accounts_operations_async.py | 36 +- ...ent_active_directory_configs_operations.py | 144 - ...tive_directory_configs_operations_async.py | 151 - ...t_net_app_management_buckets_operations.py | 24 +- ...app_management_buckets_operations_async.py | 24 +- ..._management_elastic_accounts_operations.py | 137 - ...ement_elastic_accounts_operations_async.py | 152 - ...ment_elastic_backup_policies_operations.py | 111 - ...lastic_backup_policies_operations_async.py | 118 - ...gement_elastic_backup_vaults_operations.py | 96 - ..._elastic_backup_vaults_operations_async.py | 103 - ...p_management_elastic_backups_operations.py | 139 - ...gement_elastic_backups_operations_async.py | 146 - ...ement_elastic_capacity_pools_operations.py | 140 - ...elastic_capacity_pools_operations_async.py | 155 - ...nt_elastic_snapshot_policies_operations.py | 124 - ...stic_snapshot_policies_operations_async.py | 131 - ...management_elastic_snapshots_operations.py | 88 - ...ment_elastic_snapshots_operations_async.py | 93 - ...p_management_elastic_volumes_operations.py | 175 - ...gement_elastic_volumes_operations_async.py | 184 - ...app_management_volume_groups_operations.py | 3 - ...nagement_volume_groups_operations_async.py | 3 - ...t_net_app_management_volumes_operations.py | 3 - ...app_management_volumes_operations_async.py | 3 - sdk/netapp/azure-mgmt-netapp/pyproject.toml | 4 +- .../azure-mgmt-netapp/tsp-location.yaml | 2 +- 240 files changed, 13351 insertions(+), 47848 deletions(-) delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_resource_group.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_subscription.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_resource_group.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_subscription.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_list.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_create.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_list_by_elastic_account.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_list_by_vault.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_change_zone.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_check_volume_file_path_availability.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update_cmk.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_list_by_elastic_account.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_by_elastic_account.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_elastic_volumes.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_list_by_elastic_volume.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_create_or_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_delete.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_get.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_list_by_elastic_pool.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_revert.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_update.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations_async.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations.py delete mode 100644 sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations_async.py diff --git a/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md b/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md index 96b215f3c2a5..aa99d232d725 100644 --- a/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md +++ b/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History +## 18.0.0 (2026-10-21) + +### Features Added + + - Model `AccountProperties` added property `ldap_configuration` + - Enum `NetAppProvisioningState` added member `CANCELED` + - Added model `AccountEncryptionPatch` + - Added model `AccountPropertiesPatch` + - Added model `ActiveDirectoryPatch` + - Added enum `BindAuthenticationLevel` + - Added model `BindPasswordAkvConfig` + - Added model `BindPasswordAkvConfigPatch` + - Added model `EncryptionIdentityPatch` + - Added model `KeyVaultPropertiesPatch` + - Added model `LdapConfiguration` + - Added model `LdapConfigurationPatch` + - Added enum `SecureLdapType` + - Operation group `AccountsOperations` added method `begin_refresh_ldap_bind_password` + +### Breaking Changes + + - Model `NetAppAccountPatch` deleted or renamed its instance variable `id` + - Model `NetAppAccountPatch` deleted or renamed its instance variable `location` + - Model `NetAppAccountPatch` deleted or renamed its instance variable `name` + - Model `NetAppAccountPatch` deleted or renamed its instance variable `type` + ## 18.0.0b3 (2026-08-26) ### Features Added diff --git a/sdk/netapp/azure-mgmt-netapp/_metadata.json b/sdk/netapp/azure-mgmt-netapp/_metadata.json index 432b09ca935c..e24f1a62e6c9 100644 --- a/sdk/netapp/azure-mgmt-netapp/_metadata.json +++ b/sdk/netapp/azure-mgmt-netapp/_metadata.json @@ -1,11 +1,11 @@ { - "apiVersion": "2026-06-15-preview", + "apiVersion": "2026-08-01", "apiVersions": { - "Microsoft.NetApp": "2026-06-15-preview" + "Microsoft.NetApp": "2026-08-01" }, - "commit": "7b37a9458cffc3977f2c84f487fcb3ccc429f8a7", + "commit": "2371f14ab26ab99500de46ac5c507476a8e0fc61", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/netapp/resource-manager/Microsoft.NetApp/NetApp", - "emitterVersion": "0.63.5", - "httpClientPythonVersion": "^0.36.0" + "emitterVersion": "0.63.10", + "httpClientPythonVersion": "0.39.0" } \ No newline at end of file diff --git a/sdk/netapp/azure-mgmt-netapp/api.md b/sdk/netapp/azure-mgmt-netapp/api.md index 4853c7271421..032ca0638c7d 100644 --- a/sdk/netapp/azure-mgmt-netapp/api.md +++ b/sdk/netapp/azure-mgmt-netapp/api.md @@ -3,7 +3,6 @@ namespace azure.mgmt.netapp class azure.mgmt.netapp.NetAppManagementClient: implements ContextManager accounts: AccountsOperations - active_directory_configs: ActiveDirectoryConfigsOperations backup_policies: BackupPoliciesOperations backup_vaults: BackupVaultsOperations backups: BackupsOperations @@ -12,14 +11,6 @@ namespace azure.mgmt.netapp backups_under_volume: BackupsUnderVolumeOperations buckets: BucketsOperations caches: CachesOperations - elastic_accounts: ElasticAccountsOperations - elastic_backup_policies: ElasticBackupPoliciesOperations - elastic_backup_vaults: ElasticBackupVaultsOperations - elastic_backups: ElasticBackupsOperations - elastic_capacity_pools: ElasticCapacityPoolsOperations - elastic_snapshot_policies: ElasticSnapshotPoliciesOperations - elastic_snapshots: ElasticSnapshotsOperations - elastic_volumes: ElasticVolumesOperations net_app_resource: NetAppResourceOperations net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations net_app_resource_quota_limits_account: NetAppResourceQuotaLimitsAccountOperations @@ -62,7 +53,6 @@ namespace azure.mgmt.netapp.aio class azure.mgmt.netapp.aio.NetAppManagementClient: implements AsyncContextManager accounts: AccountsOperations - active_directory_configs: ActiveDirectoryConfigsOperations backup_policies: BackupPoliciesOperations backup_vaults: BackupVaultsOperations backups: BackupsOperations @@ -71,14 +61,6 @@ namespace azure.mgmt.netapp.aio backups_under_volume: BackupsUnderVolumeOperations buckets: BucketsOperations caches: CachesOperations - elastic_accounts: ElasticAccountsOperations - elastic_backup_policies: ElasticBackupPoliciesOperations - elastic_backup_vaults: ElasticBackupVaultsOperations - elastic_backups: ElasticBackupsOperations - elastic_capacity_pools: ElasticCapacityPoolsOperations - elastic_snapshot_policies: ElasticSnapshotPoliciesOperations - elastic_snapshots: ElasticSnapshotsOperations - elastic_volumes: ElasticVolumesOperations net_app_resource: NetAppResourceOperations net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations net_app_resource_quota_limits_account: NetAppResourceQuotaLimitsAccountOperations @@ -210,7 +192,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncLROPoller[GetKeyVaultStatusResponse]: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-04-15-preview', params_added_on={'2026-04-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name']}, api_versions_list=['2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) + @api_version_validation(method_added_on='2026-04-15-preview', params_added_on={'2026-04-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name']}, api_versions_list=['2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def begin_refresh_ldap_bind_password( self, resource_group_name: str, @@ -311,111 +293,6 @@ namespace azure.mgmt.netapp.aio.operations def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[NetAppAccount]: ... - class azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ActiveDirectoryConfig]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ActiveDirectoryConfig]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ActiveDirectoryConfig]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'active_directory_config_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - active_directory_config_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfigUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ActiveDirectoryConfig]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfigUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ActiveDirectoryConfig]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ActiveDirectoryConfig]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'active_directory_config_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def get( - self, - resource_group_name: str, - active_directory_config_name: str, - **kwargs: Any - ) -> ActiveDirectoryConfig: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncItemPaged[ActiveDirectoryConfig]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[ActiveDirectoryConfig]: ... - - class azure.mgmt.netapp.aio.operations.BackupPoliciesOperations: def __init__( @@ -957,7 +834,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncLROPoller[Bucket]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def begin_delete( self, resource_group_name: str, @@ -1011,7 +888,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncLROPoller[None]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def begin_refresh_certificate( self, resource_group_name: str, @@ -1107,7 +984,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> BucketGenerateCredentials: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def get( self, resource_group_name: str, @@ -1119,7 +996,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> Bucket: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) def list( self, resource_group_name: str, @@ -1178,7 +1055,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncLROPoller[Cache]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def begin_delete( self, resource_group_name: str, @@ -1228,7 +1105,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncLROPoller[Cache]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def begin_reset_smb_password( self, resource_group_name: str, @@ -1278,7 +1155,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncLROPoller[Cache]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def get( self, resource_group_name: str, @@ -1289,7 +1166,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> Cache: ... @distributed_trace - @api_version_validation(method_added_on='2026-01-01', params_added_on={'2026-01-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2026-01-01', params_added_on={'2026-01-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) def list( self, resource_group_name: str, @@ -1299,7 +1176,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> AsyncItemPaged[Cache]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def list_peering_passphrases( self, resource_group_name: str, @@ -1310,7 +1187,7 @@ namespace azure.mgmt.netapp.aio.operations ) -> PeeringPassphrases: ... - class azure.mgmt.netapp.aio.operations.ElasticAccountsOperations: + class azure.mgmt.netapp.aio.operations.NetAppResourceOperations: def __init__( self, @@ -1319,213 +1196,192 @@ namespace azure.mgmt.netapp.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_update_network_sibling_set( self, - resource_group_name: str, - account_name: str, - body: ElasticAccount, + location: str, + body: UpdateNetworkSiblingSetRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticAccount]: ... + ) -> AsyncLROPoller[NetworkSiblingSet]: ... @overload - async def begin_create_or_update( + async def begin_update_network_sibling_set( self, - resource_group_name: str, - account_name: str, - body: ElasticAccount, + location: str, + body: UpdateNetworkSiblingSetRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticAccount]: ... + ) -> AsyncLROPoller[NetworkSiblingSet]: ... @overload - async def begin_create_or_update( + async def begin_update_network_sibling_set( self, - resource_group_name: str, - account_name: str, + location: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticAccount]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> AsyncLROPoller[NetworkSiblingSet]: ... @overload - async def begin_update( + async def check_file_path_availability( self, - resource_group_name: str, - account_name: str, - body: ElasticAccountUpdate, + location: str, + body: FilePathAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticAccount]: ... + ) -> CheckAvailabilityResponse: ... @overload - async def begin_update( + async def check_file_path_availability( self, - resource_group_name: str, - account_name: str, - body: ElasticAccountUpdate, + location: str, + body: FilePathAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticAccount]: ... + ) -> CheckAvailabilityResponse: ... @overload - async def begin_update( + async def check_file_path_availability( self, - resource_group_name: str, - account_name: str, + location: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticAccount]: ... + ) -> CheckAvailabilityResponse: ... - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def get( + @overload + async def check_name_availability( self, - resource_group_name: str, - account_name: str, + location: str, + body: ResourceNameAvailabilityRequest, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ElasticAccount: ... + ) -> CheckAvailabilityResponse: ... - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_resource_group( + @overload + async def check_name_availability( self, - resource_group_name: str, + location: str, + body: ResourceNameAvailabilityRequest, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[ElasticAccount]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[ElasticAccount]: ... - - - class azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> CheckAvailabilityResponse: ... @overload - async def begin_create_or_update( + async def check_name_availability( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicy, + location: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupPolicy]: ... + ) -> CheckAvailabilityResponse: ... @overload - async def begin_create_or_update( + async def check_quota_availability( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicy, + location: str, + body: QuotaAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupPolicy]: ... + ) -> CheckAvailabilityResponse: ... @overload - async def begin_create_or_update( + async def check_quota_availability( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: IO[bytes], + location: str, + body: QuotaAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupPolicy]: ... + ) -> CheckAvailabilityResponse: ... - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_policy_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def begin_delete( + @overload + async def check_quota_availability( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, + location: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> CheckAvailabilityResponse: ... @overload - async def begin_update( + async def query_network_sibling_set( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicyUpdate, + location: str, + body: QueryNetworkSiblingSetRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupPolicy]: ... + ) -> NetworkSiblingSet: ... @overload - async def begin_update( + async def query_network_sibling_set( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicyUpdate, + location: str, + body: QueryNetworkSiblingSetRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupPolicy]: ... + ) -> NetworkSiblingSet: ... @overload - async def begin_update( + async def query_network_sibling_set( self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, + location: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupPolicy]: ... + ) -> NetworkSiblingSet: ... + + @distributed_trace_async + async def query_region_info( + self, + location: str, + **kwargs: Any + ) -> RegionInfo: ... + + + class azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsAccountOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_policy_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'quota_limit_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) async def get( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + quota_limit_name: str, **kwargs: Any - ) -> ElasticBackupPolicy: ... + ) -> QuotaItem: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticBackupPolicy]: ... + ) -> AsyncItemPaged[QuotaItem]: ... - class azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations: + class azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsOperations: def __init__( self, @@ -1533,109 +1389,82 @@ namespace azure.mgmt.netapp.aio.operations **kwargs ) -> None: ... - @overload - async def begin_create_or_update( + @distributed_trace_async + async def get( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVault, - *, - content_type: str = "application/json", + location: str, + quota_limit_name: str, **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupVault]: ... + ) -> QuotaItem: ... - @overload - async def begin_create_or_update( + @distributed_trace + def list( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVault, - *, - content_type: str = "application/json", + location: str, **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupVault]: ... + ) -> AsyncItemPaged[QuotaItem]: ... - @overload - async def begin_create_or_update( + + class azure.mgmt.netapp.aio.operations.NetAppResourceRegionInfosOperations: + + def __init__( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupVault]: ... + *args, + **kwargs + ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def begin_delete( + async def get( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, + location: str, **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> RegionInfoResource: ... - @overload - async def begin_update( + @distributed_trace + def list( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVaultUpdate, - *, - content_type: str = "application/json", + location: str, **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupVault]: ... + ) -> AsyncItemPaged[RegionInfoResource]: ... - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVaultUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupVault]: ... - @overload - async def begin_update( + class azure.mgmt.netapp.aio.operations.NetAppResourceUsagesOperations: + + def __init__( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ElasticBackupVault]: ... + *args, + **kwargs + ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def get( self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, + location: str, + usage_type: str, **kwargs: Any - ) -> ElasticBackupVault: ... + ) -> UsageResult: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( + def list( self, - resource_group_name: str, - account_name: str, + location: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticBackupVault]: ... + ) -> AsyncItemPaged[UsageResult]: ... + + + class azure.mgmt.netapp.aio.operations.Operations: + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... - class azure.mgmt.netapp.aio.operations.ElasticBackupsOperations: + + class azure.mgmt.netapp.aio.operations.PoolsOperations: def __init__( self, @@ -1648,48 +1477,43 @@ namespace azure.mgmt.netapp.aio.operations self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, + pool_name: str, + body: CapacityPool, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackup]: ... + ) -> AsyncLROPoller[CapacityPool]: ... @overload async def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, + pool_name: str, + body: CapacityPool, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackup]: ... + ) -> AsyncLROPoller[CapacityPool]: ... @overload async def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackup]: ... + ) -> AsyncLROPoller[CapacityPool]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'backup_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def begin_delete( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @@ -1698,63 +1522,56 @@ namespace azure.mgmt.netapp.aio.operations self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, + pool_name: str, + body: CapacityPoolPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackup]: ... + ) -> AsyncLROPoller[CapacityPool]: ... @overload async def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, + pool_name: str, + body: CapacityPoolPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackup]: ... + ) -> AsyncLROPoller[CapacityPool]: ... @overload async def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticBackup]: ... + ) -> AsyncLROPoller[CapacityPool]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'backup_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def get( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, **kwargs: Any - ) -> ElasticBackup: ... + ) -> CapacityPool: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_vault( + def list( self, resource_group_name: str, account_name: str, - backup_vault_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticBackup]: ... + ) -> AsyncItemPaged[CapacityPool]: ... - class azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations: + class azure.mgmt.netapp.aio.operations.RansomwareReportsOperations: def __init__( self, @@ -1763,84 +1580,85 @@ namespace azure.mgmt.netapp.aio.operations ) -> None: ... @overload - async def begin_change_zone( + async def begin_clear_suspects( self, resource_group_name: str, account_name: str, pool_name: str, - body: ChangeZoneRequest, + volume_name: str, + ransomware_report_name: str, + body: RansomwareSuspectsClearRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_change_zone( + async def begin_clear_suspects( self, resource_group_name: str, account_name: str, pool_name: str, - body: ChangeZoneRequest, + volume_name: str, + ransomware_report_name: str, + body: RansomwareSuspectsClearRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_change_zone( + async def begin_clear_suspects( self, resource_group_name: str, account_name: str, pool_name: str, + volume_name: str, + ransomware_report_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncLROPoller[None]: ... - @overload - async def begin_create_or_update( + @distributed_trace_async + @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'ransomware_report_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + async def get( self, resource_group_name: str, account_name: str, pool_name: str, - body: ElasticCapacityPool, - *, - content_type: str = "application/json", + volume_name: str, + ransomware_report_name: str, **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> RansomwareReport: ... - @overload - async def begin_create_or_update( + @distributed_trace + @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list( self, resource_group_name: str, account_name: str, pool_name: str, - body: ElasticCapacityPool, - *, - content_type: str = "application/json", + volume_name: str, **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncItemPaged[RansomwareReport]: ... - @overload - async def begin_create_or_update( + + class azure.mgmt.netapp.aio.operations.SnapshotPoliciesOperations: + + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + *args, + **kwargs + ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def begin_delete( self, resource_group_name: str, account_name: str, - pool_name: str, + snapshot_policy_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @@ -1849,94 +1667,101 @@ namespace azure.mgmt.netapp.aio.operations self, resource_group_name: str, account_name: str, - pool_name: str, - body: ElasticCapacityPoolUpdate, + snapshot_policy_name: str, + body: SnapshotPolicyPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncLROPoller[SnapshotPolicy]: ... @overload async def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - body: ElasticCapacityPoolUpdate, + snapshot_policy_name: str, + body: SnapshotPolicyPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncLROPoller[SnapshotPolicy]: ... @overload async def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, + snapshot_policy_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticCapacityPool]: ... + ) -> AsyncLROPoller[SnapshotPolicy]: ... @overload - async def check_volume_file_path_availability( + async def create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: CheckElasticVolumeFilePathAvailabilityRequest, + snapshot_policy_name: str, + body: SnapshotPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckElasticResourceAvailabilityResponse: ... + ) -> SnapshotPolicy: ... @overload - async def check_volume_file_path_availability( + async def create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: CheckElasticVolumeFilePathAvailabilityRequest, + snapshot_policy_name: str, + body: SnapshotPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckElasticResourceAvailabilityResponse: ... + ) -> SnapshotPolicy: ... @overload - async def check_volume_file_path_availability( + async def create( self, resource_group_name: str, account_name: str, - pool_name: str, + snapshot_policy_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> CheckElasticResourceAvailabilityResponse: ... + ) -> SnapshotPolicy: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def get( self, resource_group_name: str, account_name: str, - pool_name: str, + snapshot_policy_name: str, **kwargs: Any - ) -> ElasticCapacityPool: ... + ) -> SnapshotPolicy: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( + def list( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticCapacityPool]: ... + ) -> AsyncItemPaged[SnapshotPolicy]: ... + + @distributed_trace_async + async def list_volumes( + self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + **kwargs: Any + ) -> SnapshotPolicyVolumeList: ... - class azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations: + class azure.mgmt.netapp.aio.operations.SnapshotsOperations: def __init__( self, @@ -1945,118 +1770,165 @@ namespace azure.mgmt.netapp.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicy, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Snapshot, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshotPolicy]: ... + ) -> AsyncLROPoller[Snapshot]: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicy, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Snapshot, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshotPolicy]: ... + ) -> AsyncLROPoller[Snapshot]: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshotPolicy]: ... + ) -> AsyncLROPoller[Snapshot]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'snapshot_policy_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def begin_delete( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_restore_files( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicyUpdate, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotRestoreFiles, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshotPolicy]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_restore_files( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicyUpdate, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotRestoreFiles, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshotPolicy]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_restore_files( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshotPolicy]: ... + ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'snapshot_policy_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - async def get( + @overload + async def begin_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotPatch, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ElasticSnapshotPolicy: ... + ) -> AsyncLROPoller[Snapshot]: ... - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Snapshot]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Snapshot]: ... + + @distributed_trace_async + async def get( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticSnapshotPolicy]: ... + ) -> Snapshot: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'snapshot_policy_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_elastic_volumes( + def list( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticVolume]: ... + ) -> AsyncItemPaged[Snapshot]: ... - class azure.mgmt.netapp.aio.operations.ElasticSnapshotsOperations: + class azure.mgmt.netapp.aio.operations.SubvolumesOperations: def __init__( self, @@ -2065,84 +1937,134 @@ namespace azure.mgmt.netapp.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: ElasticSnapshot, + subvolume_name: str, + body: SubvolumeInfo, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshot]: ... + ) -> AsyncLROPoller[SubvolumeInfo]: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: ElasticSnapshot, + subvolume_name: str, + body: SubvolumeInfo, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshot]: ... + ) -> AsyncLROPoller[SubvolumeInfo]: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, + subvolume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticSnapshot]: ... + ) -> AsyncLROPoller[SubvolumeInfo]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'snapshot_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def begin_delete( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, + subvolume_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'snapshot_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) + async def begin_get_metadata( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> AsyncLROPoller[SubvolumeModel]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: SubvolumePatchRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SubvolumeInfo]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: SubvolumePatchRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SubvolumeInfo]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SubvolumeInfo]: ... + + @distributed_trace_async async def get( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, + subvolume_name: str, **kwargs: Any - ) -> ElasticSnapshot: ... + ) -> SubvolumeInfo: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_volume( + def list_by_volume( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticSnapshot]: ... + ) -> AsyncItemPaged[SubvolumeInfo]: ... - class azure.mgmt.netapp.aio.operations.ElasticVolumesOperations: + class azure.mgmt.netapp.aio.operations.VolumeGroupsOperations: def __init__( self, @@ -2151,93 +2073,128 @@ namespace azure.mgmt.netapp.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolume, + volume_group_name: str, + body: VolumeGroupDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeGroupDetails]: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolume, + volume_group_name: str, + body: VolumeGroupDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeGroupDetails]: ... @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, + volume_group_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeGroupDetails]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def begin_delete( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, + volume_group_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... + @distributed_trace_async + async def get( + self, + resource_group_name: str, + account_name: str, + volume_group_name: str, + **kwargs: Any + ) -> VolumeGroupDetails: ... + + @distributed_trace + def list_by_net_app_account( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncItemPaged[VolumeGroup]: ... + + + class azure.mgmt.netapp.aio.operations.VolumeQuotaRulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + @overload - async def begin_revert( + async def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: ElasticVolumeRevert, + volume_quota_rule_name: str, + body: VolumeQuotaRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeQuotaRule]: ... @overload - async def begin_revert( + async def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: ElasticVolumeRevert, + volume_quota_rule_name: str, + body: VolumeQuotaRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeQuotaRule]: ... @overload - async def begin_revert( + async def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, + volume_quota_rule_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeQuotaRule]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload async def begin_update( @@ -2246,11 +2203,12 @@ namespace azure.mgmt.netapp.aio.operations account_name: str, pool_name: str, volume_name: str, - body: ElasticVolumeUpdate, + volume_quota_rule_name: str, + body: VolumeQuotaRulePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeQuotaRule]: ... @overload async def begin_update( @@ -2259,11 +2217,12 @@ namespace azure.mgmt.netapp.aio.operations account_name: str, pool_name: str, volume_name: str, - body: ElasticVolumeUpdate, + volume_quota_rule_name: str, + body: VolumeQuotaRulePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeQuotaRule]: ... @overload async def begin_update( @@ -2272,35 +2231,36 @@ namespace azure.mgmt.netapp.aio.operations account_name: str, pool_name: str, volume_name: str, + volume_quota_rule_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ElasticVolume]: ... + ) -> AsyncLROPoller[VolumeQuotaRule]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) async def get( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, + volume_quota_rule_name: str, **kwargs: Any - ) -> ElasticVolume: ... + ) -> VolumeQuotaRule: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_pool( + def list_by_volume( self, resource_group_name: str, account_name: str, pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncItemPaged[ElasticVolume]: ... + ) -> AsyncItemPaged[VolumeQuotaRule]: ... - class azure.mgmt.netapp.aio.operations.NetAppResourceOperations: + class azure.mgmt.netapp.aio.operations.VolumesOperations: def __init__( self, @@ -2308,3935 +2268,3774 @@ namespace azure.mgmt.netapp.aio.operations **kwargs ) -> None: ... - @overload - async def begin_update_network_sibling_set( + @distributed_trace_async + async def begin_authorize_external_replication( self, - location: str, - body: UpdateNetworkSiblingSetRequest, - *, - content_type: str = "application/json", + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncLROPoller[NetworkSiblingSet]: ... + ) -> AsyncLROPoller[SvmPeerCommandResponse]: ... @overload - async def begin_update_network_sibling_set( + async def begin_authorize_replication( self, - location: str, - body: UpdateNetworkSiblingSetRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: AuthorizeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[NetworkSiblingSet]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_update_network_sibling_set( + async def begin_authorize_replication( self, - location: str, - body: IO[bytes], + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: AuthorizeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[NetworkSiblingSet]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_file_path_availability( + async def begin_authorize_replication( self, - location: str, - body: FilePathAvailabilityRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_file_path_availability( + async def begin_break_file_locks( self, - location: str, - body: FilePathAvailabilityRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[BreakFileLocksRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_file_path_availability( + async def begin_break_file_locks( self, - location: str, - body: IO[bytes], + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[BreakFileLocksRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_name_availability( + async def begin_break_file_locks( self, - location: str, - body: ResourceNameAvailabilityRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_name_availability( + async def begin_break_replication( self, - location: str, - body: ResourceNameAvailabilityRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[BreakReplicationRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_name_availability( + async def begin_break_replication( self, - location: str, - body: IO[bytes], + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[BreakReplicationRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_quota_availability( + async def begin_break_replication( self, - location: str, - body: QuotaAvailabilityRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[None]: ... @overload - async def check_quota_availability( + async def begin_create_or_update( self, - location: str, - body: QuotaAvailabilityRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Volume, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[Volume]: ... @overload - async def check_quota_availability( + async def begin_create_or_update( self, - location: str, - body: IO[bytes], + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Volume, *, content_type: str = "application/json", **kwargs: Any - ) -> CheckAvailabilityResponse: ... + ) -> AsyncLROPoller[Volume]: ... @overload - async def query_network_sibling_set( + async def begin_create_or_update( self, - location: str, - body: QueryNetworkSiblingSetRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> NetworkSiblingSet: ... + ) -> AsyncLROPoller[Volume]: ... - @overload - async def query_network_sibling_set( + @distributed_trace_async + async def begin_delete( self, - location: str, - body: QueryNetworkSiblingSetRequest, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, *, - content_type: str = "application/json", + force_delete: Optional[bool] = ..., **kwargs: Any - ) -> NetworkSiblingSet: ... + ) -> AsyncLROPoller[None]: ... - @overload - async def query_network_sibling_set( + @distributed_trace_async + async def begin_delete_replication( self, - location: str, - body: IO[bytes], - *, - content_type: str = "application/json", + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> NetworkSiblingSet: ... + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def query_region_info( + async def begin_finalize_external_replication( self, - location: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> RegionInfo: ... - - - class azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsAccountOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'quota_limit_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - async def get( + async def begin_finalize_relocation( self, resource_group_name: str, account_name: str, - quota_limit_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> QuotaItem: ... + ) -> AsyncLROPoller[None]: ... - @distributed_trace - @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def list( + @overload + async def begin_list_get_group_id_list_for_ldap_user( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + body: GetGroupIdListForLDAPUserRequest, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[QuotaItem]: ... - - - class azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsOperations: + ) -> AsyncLROPoller[GetGroupIdListForLDAPUserResponse]: ... - def __init__( + @overload + async def begin_list_get_group_id_list_for_ldap_user( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: GetGroupIdListForLDAPUserRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GetGroupIdListForLDAPUserResponse]: ... - @distributed_trace_async - async def get( + @overload + async def begin_list_get_group_id_list_for_ldap_user( self, - location: str, - quota_limit_name: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> QuotaItem: ... + ) -> AsyncLROPoller[GetGroupIdListForLDAPUserResponse]: ... - @distributed_trace - def list( + @overload + async def begin_list_quota_report( self, - location: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[QuotaReportFilterRequest] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[QuotaItem]: ... - - - class azure.mgmt.netapp.aio.operations.NetAppResourceRegionInfosOperations: + ) -> AsyncLROPoller[ListQuotaReportResult]: ... - def __init__( + @overload + async def begin_list_quota_report( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[QuotaReportFilterRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ListQuotaReportResult]: ... - @distributed_trace_async - async def get( + @overload + async def begin_list_quota_report( self, - location: str, - **kwargs: Any - ) -> RegionInfoResource: ... - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncItemPaged[RegionInfoResource]: ... - - - class azure.mgmt.netapp.aio.operations.NetAppResourceUsagesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def get( - self, - location: str, - usage_type: str, - **kwargs: Any - ) -> UsageResult: ... - - @distributed_trace - def list( - self, - location: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[UsageResult]: ... - - - class azure.mgmt.netapp.aio.operations.Operations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... - - - class azure.mgmt.netapp.aio.operations.PoolsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncLROPoller[ListQuotaReportResult]: ... @overload - async def begin_create_or_update( + async def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, - body: CapacityPool, + volume_name: str, + body: PeerClusterForVolumeMigrationRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[CapacityPool]: ... + ) -> AsyncLROPoller[ClusterPeerCommandResponse]: ... @overload - async def begin_create_or_update( + async def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, - body: CapacityPool, + volume_name: str, + body: PeerClusterForVolumeMigrationRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[CapacityPool]: ... + ) -> AsyncLROPoller[ClusterPeerCommandResponse]: ... @overload - async def begin_create_or_update( + async def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[CapacityPool]: ... + ) -> AsyncLROPoller[ClusterPeerCommandResponse]: ... @distributed_trace_async - async def begin_delete( + async def begin_perform_replication_transfer( self, resource_group_name: str, account_name: str, pool_name: str, + volume_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, - body: CapacityPoolPatch, + volume_name: str, + body: PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[CapacityPool]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, - body: CapacityPoolPatch, + volume_name: str, + body: PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[CapacityPool]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[CapacityPool]: ... + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def get( + async def begin_populate_availability_zone( self, resource_group_name: str, account_name: str, pool_name: str, + volume_name: str, **kwargs: Any - ) -> CapacityPool: ... + ) -> AsyncLROPoller[Volume]: ... - @distributed_trace - def list( + @distributed_trace_async + async def begin_re_initialize_replication( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncItemPaged[CapacityPool]: ... - - - class azure.mgmt.netapp.aio.operations.RansomwareReportsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncLROPoller[None]: ... @overload - async def begin_clear_suspects( + async def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, - body: RansomwareSuspectsClearRequest, + body: ReestablishReplicationRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload - async def begin_clear_suspects( + async def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, - body: RansomwareSuspectsClearRequest, + body: ReestablishReplicationRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload - async def begin_clear_suspects( + async def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'ransomware_report_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - async def get( + @overload + async def begin_relocate( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, + body: Optional[RelocateVolumeRequest] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> RansomwareReport: ... + ) -> AsyncLROPoller[None]: ... - @distributed_trace - @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def list( + @overload + async def begin_relocate( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - **kwargs: Any - ) -> AsyncItemPaged[RansomwareReport]: ... - - - class azure.mgmt.netapp.aio.operations.SnapshotPoliciesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, + body: Optional[RelocateVolumeRequest] = None, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_relocate( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicyPatch, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[SnapshotPolicy]: ... + ) -> AsyncLROPoller[None]: ... - @overload - async def begin_update( + @distributed_trace_async + async def begin_reset_cifs_password( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicyPatch, - *, - content_type: str = "application/json", + pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncLROPoller[SnapshotPolicy]: ... + ) -> AsyncLROPoller[None]: ... - @overload - async def begin_update( + @distributed_trace_async + async def begin_resync_replication( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", + pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncLROPoller[SnapshotPolicy]: ... + ) -> AsyncLROPoller[None]: ... @overload - async def create( + async def begin_revert( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicy, + pool_name: str, + volume_name: str, + body: VolumeRevert, *, content_type: str = "application/json", **kwargs: Any - ) -> SnapshotPolicy: ... + ) -> AsyncLROPoller[None]: ... @overload - async def create( + async def begin_revert( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicy, + pool_name: str, + volume_name: str, + body: VolumeRevert, *, content_type: str = "application/json", **kwargs: Any - ) -> SnapshotPolicy: ... + ) -> AsyncLROPoller[None]: ... @overload - async def create( + async def begin_revert( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> SnapshotPolicy: ... + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def get( + async def begin_revert_relocation( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> SnapshotPolicy: ... + ) -> AsyncLROPoller[None]: ... - @distributed_trace - def list( + @distributed_trace_async + async def begin_split_clone_from_parent( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> AsyncItemPaged[SnapshotPolicy]: ... + ) -> AsyncLROPoller[Volume]: ... - @distributed_trace_async - async def list_volumes( + @overload + async def begin_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + pool_name: str, + volume_name: str, + body: VolumePatch, + *, + content_type: str = "application/json", **kwargs: Any - ) -> SnapshotPolicyVolumeList: ... - - - class azure.mgmt.netapp.aio.operations.SnapshotsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Snapshot]: ... + ) -> AsyncLROPoller[Volume]: ... @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: Snapshot, + body: VolumePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Snapshot]: ... + ) -> AsyncLROPoller[Volume]: ... @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Snapshot]: ... + ) -> AsyncLROPoller[Volume]: ... @distributed_trace_async - async def begin_delete( + async def get( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> Volume: ... - @overload - async def begin_restore_files( + @distributed_trace + def list( self, resource_group_name: str, account_name: str, pool_name: str, - volume_name: str, - snapshot_name: str, - body: SnapshotRestoreFiles, - *, - content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> AsyncItemPaged[Volume]: ... @overload - async def begin_restore_files( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: SnapshotRestoreFiles, + body: Optional[ListReplicationsRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> AsyncItemPaged[Replication]: ... @overload - async def begin_restore_files( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: IO[bytes], + body: Optional[ListReplicationsRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> AsyncItemPaged[Replication]: ... @overload - async def begin_update( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: SnapshotPatch, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Snapshot]: ... + ) -> AsyncItemPaged[Replication]: ... - @overload - async def begin_update( + @distributed_trace_async + async def replication_status( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, - body: SnapshotPatch, - *, - content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Snapshot]: ... + ) -> ReplicationStatus: ... - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Snapshot]: ... - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> Snapshot: ... +namespace azure.mgmt.netapp.models - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncItemPaged[Snapshot]: ... + class azure.mgmt.netapp.models.AcceptGrowCapacityPoolForShortTermCloneSplit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + DECLINED = "Declined" - class azure.mgmt.netapp.aio.operations.SubvolumesOperations: + class azure.mgmt.netapp.models.AccountEncryption(_Model): + identity: Optional[EncryptionIdentity] + key_source: Optional[Union[str, KeySource]] + key_vault_properties: Optional[KeyVaultProperties] + @overload def __init__( self, - *args, - **kwargs + *, + identity: Optional[EncryptionIdentity] = ..., + key_source: Optional[Union[str, KeySource]] = ..., + key_vault_properties: Optional[KeyVaultProperties] = ... ) -> None: ... @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumeInfo, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeInfo]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.AccountEncryptionPatch(_Model): + identity: Optional[EncryptionIdentityPatch] + key_source: Optional[Union[str, KeySource]] + key_vault_properties: Optional[KeyVaultPropertiesPatch] @overload - async def begin_create( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumeInfo, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeInfo]: ... + identity: Optional[EncryptionIdentityPatch] = ..., + key_source: Optional[Union[str, KeySource]] = ..., + key_vault_properties: Optional[KeyVaultPropertiesPatch] = ... + ) -> None: ... @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeInfo]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - async def begin_get_metadata( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeModel]: ... + class azure.mgmt.netapp.models.AccountProperties(_Model): + active_directories: Optional[list[ActiveDirectory]] + disable_showmount: Optional[bool] + encryption: Optional[AccountEncryption] + ldap_configuration: Optional[LdapConfiguration] + multi_ad_status: Optional[Union[str, MultiAdStatus]] + nfs_v4_id_domain: Optional[str] + provisioning_state: Optional[str] @overload - async def begin_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumePatchRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeInfo]: ... + active_directories: Optional[list[ActiveDirectory]] = ..., + encryption: Optional[AccountEncryption] = ..., + ldap_configuration: Optional[LdapConfiguration] = ..., + nfs_v4_id_domain: Optional[str] = ... + ) -> None: ... @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumePatchRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeInfo]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.AccountPropertiesPatch(_Model): + active_directories: Optional[list[ActiveDirectoryPatch]] + encryption: Optional[AccountEncryptionPatch] + ldap_configuration: Optional[LdapConfigurationPatch] + nfs_v4_id_domain: Optional[str] @overload - async def begin_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[SubvolumeInfo]: ... + active_directories: Optional[list[ActiveDirectoryPatch]] = ..., + encryption: Optional[AccountEncryptionPatch] = ..., + ldap_configuration: Optional[LdapConfigurationPatch] = ..., + nfs_v4_id_domain: Optional[str] = ... + ) -> None: ... - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - **kwargs: Any - ) -> SubvolumeInfo: ... - - @distributed_trace - def list_by_volume( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncItemPaged[SubvolumeInfo]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.aio.operations.VolumeGroupsOperations: + class azure.mgmt.netapp.models.ActiveDirectory(_Model): + active_directory_id: Optional[str] + ad_name: Optional[str] + administrators: Optional[list[str]] + aes_encryption: Optional[bool] + allow_local_nfs_users_with_ldap: Optional[bool] + backup_operators: Optional[list[str]] + dns: Optional[str] + domain: Optional[str] + encrypt_dc_connections: Optional[bool] + kdc_ip: Optional[str] + ldap_over_tls: Optional[bool] + ldap_search_scope: Optional[LdapSearchScopeOpt] + ldap_signing: Optional[bool] + organizational_unit: Optional[str] + password: Optional[str] + preferred_servers_for_ldap_client: Optional[str] + security_operators: Optional[list[str]] + server_root_ca_certificate: Optional[str] + site: Optional[str] + smb_server_name: Optional[str] + status: Optional[Union[str, ActiveDirectoryStatus]] + status_details: Optional[str] + username: Optional[str] + @overload def __init__( self, - *args, - **kwargs + *, + active_directory_id: Optional[str] = ..., + ad_name: Optional[str] = ..., + administrators: Optional[list[str]] = ..., + aes_encryption: Optional[bool] = ..., + allow_local_nfs_users_with_ldap: Optional[bool] = ..., + backup_operators: Optional[list[str]] = ..., + dns: Optional[str] = ..., + domain: Optional[str] = ..., + encrypt_dc_connections: Optional[bool] = ..., + kdc_ip: Optional[str] = ..., + ldap_over_tls: Optional[bool] = ..., + ldap_search_scope: Optional[LdapSearchScopeOpt] = ..., + ldap_signing: Optional[bool] = ..., + organizational_unit: Optional[str] = ..., + password: Optional[str] = ..., + preferred_servers_for_ldap_client: Optional[str] = ..., + security_operators: Optional[list[str]] = ..., + server_root_ca_certificate: Optional[str] = ..., + site: Optional[str] = ..., + smb_server_name: Optional[str] = ..., + username: Optional[str] = ... ) -> None: ... @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: VolumeGroupDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeGroupDetails]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.ActiveDirectoryPatch(_Model): + active_directory_id: Optional[str] + ad_name: Optional[str] + administrators: Optional[list[str]] + aes_encryption: Optional[bool] + allow_local_nfs_users_with_ldap: Optional[bool] + backup_operators: Optional[list[str]] + dns: Optional[str] + domain: Optional[str] + encrypt_dc_connections: Optional[bool] + kdc_ip: Optional[str] + ldap_over_tls: Optional[bool] + ldap_search_scope: Optional[LdapSearchScopeOpt] + ldap_signing: Optional[bool] + organizational_unit: Optional[str] + password: Optional[str] + preferred_servers_for_ldap_client: Optional[str] + security_operators: Optional[list[str]] + server_root_ca_certificate: Optional[str] + site: Optional[str] + smb_server_name: Optional[str] + username: Optional[str] @overload - async def begin_create( + def __init__( self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: VolumeGroupDetails, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeGroupDetails]: ... + active_directory_id: Optional[str] = ..., + ad_name: Optional[str] = ..., + administrators: Optional[list[str]] = ..., + aes_encryption: Optional[bool] = ..., + allow_local_nfs_users_with_ldap: Optional[bool] = ..., + backup_operators: Optional[list[str]] = ..., + dns: Optional[str] = ..., + domain: Optional[str] = ..., + encrypt_dc_connections: Optional[bool] = ..., + kdc_ip: Optional[str] = ..., + ldap_over_tls: Optional[bool] = ..., + ldap_search_scope: Optional[LdapSearchScopeOpt] = ..., + ldap_signing: Optional[bool] = ..., + organizational_unit: Optional[str] = ..., + password: Optional[str] = ..., + preferred_servers_for_ldap_client: Optional[str] = ..., + security_operators: Optional[list[str]] = ..., + server_root_ca_certificate: Optional[str] = ..., + site: Optional[str] = ..., + smb_server_name: Optional[str] = ..., + username: Optional[str] = ... + ) -> None: ... @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeGroupDetails]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - **kwargs: Any - ) -> VolumeGroupDetails: ... + class azure.mgmt.netapp.models.ActiveDirectoryStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATED = "Created" + DELETED = "Deleted" + ERROR = "Error" + IN_USE = "InUse" + UPDATING = "Updating" - @distributed_trace - def list_by_net_app_account( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> AsyncItemPaged[VolumeGroup]: ... + + class azure.mgmt.netapp.models.ActualRansomwareProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + LEARNING = "Learning" + PAUSED = "Paused" - class azure.mgmt.netapp.aio.operations.VolumeQuotaRulesOperations: + class azure.mgmt.netapp.models.ApplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ORACLE = "ORACLE" + SAP_HANA = "SAP-HANA" + + + class azure.mgmt.netapp.models.AuthorizeRequest(_Model): + remote_volume_resource_id: Optional[str] + @overload def __init__( self, - *args, - **kwargs + *, + remote_volume_resource_id: Optional[str] = ... ) -> None: ... @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeQuotaRule]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.AvsDataStore(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.AzureKeyVaultDetails(_Model): + certificate_akv_details: Optional[CertificateAkvDetails] + credentials_akv_details: Optional[CredentialsAkvDetails] @overload - async def begin_create( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRule, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeQuotaRule]: ... + certificate_akv_details: Optional[CertificateAkvDetails] = ..., + credentials_akv_details: Optional[CredentialsAkvDetails] = ... + ) -> None: ... @overload - async def begin_create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.Backup(ProxyResource): + id: str + name: str + properties: BackupProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeQuotaRule]: ... + properties: BackupProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + + class azure.mgmt.netapp.models.BackupPatch(_Model): + properties: Optional[BackupPatchProperties] + + def __getattr__(self, name: str) -> Any: ... @overload - async def begin_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRulePatch, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeQuotaRule]: ... + properties: Optional[BackupPatchProperties] = ... + ) -> None: ... @overload - async def begin_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeQuotaRule]: ... + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.BackupPatchProperties(_Model): + label: Optional[str] @overload - async def begin_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[VolumeQuotaRule]: ... + label: Optional[str] = ... + ) -> None: ... - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - **kwargs: Any - ) -> VolumeQuotaRule: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_by_volume( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncItemPaged[VolumeQuotaRule]: ... + class azure.mgmt.netapp.models.BackupPolicy(TrackedResource): + etag: Optional[str] + id: str + location: str + name: str + properties: BackupPolicyProperties + system_data: SystemData + tags: dict[str, str] + type: str - class azure.mgmt.netapp.aio.operations.VolumesOperations: + def __getattr__(self, name: str) -> Any: ... + @overload def __init__( self, - *args, - **kwargs + *, + location: str, + properties: BackupPolicyProperties, + tags: Optional[dict[str, str]] = ... ) -> None: ... - @distributed_trace_async - async def begin_authorize_external_replication( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[SvmPeerCommandResponse]: ... + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.BackupPolicyPatch(_Model): + id: Optional[str] + location: Optional[str] + name: Optional[str] + properties: Optional[BackupPolicyProperties] + tags: Optional[dict[str, str]] + type: Optional[str] + + def __getattr__(self, name: str) -> Any: ... @overload - async def begin_authorize_replication( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: AuthorizeRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + location: Optional[str] = ..., + properties: Optional[BackupPolicyProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... @overload - async def begin_authorize_replication( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: AuthorizeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.BackupPolicyProperties(_Model): + backup_policy_id: Optional[str] + daily_backups_to_keep: Optional[int] + enabled: Optional[bool] + monthly_backups_to_keep: Optional[int] + provisioning_state: Optional[str] + volume_backups: Optional[list[VolumeBackups]] + volumes_assigned: Optional[int] + weekly_backups_to_keep: Optional[int] @overload - async def begin_authorize_replication( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + daily_backups_to_keep: Optional[int] = ..., + enabled: Optional[bool] = ..., + monthly_backups_to_keep: Optional[int] = ..., + weekly_backups_to_keep: Optional[int] = ... + ) -> None: ... @overload - async def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakFileLocksRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BackupProperties(_Model): + backup_id: Optional[str] + backup_policy_resource_id: Optional[str] + backup_type: Optional[Union[str, BackupType]] + completion_date: Optional[datetime] + creation_date: Optional[datetime] + failure_reason: Optional[str] + is_large_volume: Optional[bool] + label: Optional[str] + provisioning_state: Optional[str] + size: Optional[int] + snapshot_creation_date: Optional[datetime] + snapshot_name: Optional[str] + use_existing_snapshot: Optional[bool] + volume_resource_id: str @overload - async def begin_break_file_locks( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakFileLocksRequest] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + label: Optional[str] = ..., + snapshot_name: Optional[str] = ..., + use_existing_snapshot: Optional[bool] = ..., + volume_resource_id: str + ) -> None: ... @overload - async def begin_break_file_locks( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BackupRestoreFiles(_Model): + destination_volume_id: str + file_list: list[str] + restore_file_path: Optional[str] + + @overload + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + destination_volume_id: str, + file_list: list[str], + restore_file_path: Optional[str] = ... + ) -> None: ... @overload - async def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakReplicationRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BackupStatus(_Model): + error_message: Optional[str] + healthy: Optional[bool] + last_transfer_size: Optional[int] + last_transfer_type: Optional[str] + mirror_state: Optional[Union[str, MirrorState]] + relationship_status: Optional[Union[str, VolumeBackupRelationshipStatus]] + total_transfer_bytes: Optional[int] + transfer_progress_bytes: Optional[int] + unhealthy_reason: Optional[str] + + + class azure.mgmt.netapp.models.BackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANUAL = "Manual" + SCHEDULED = "Scheduled" + + + class azure.mgmt.netapp.models.BackupVault(TrackedResource): + id: str + location: str + name: str + properties: Optional[BackupVaultProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... @overload - async def begin_break_replication( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakReplicationRequest] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + location: str, + properties: Optional[BackupVaultProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... @overload - async def begin_break_replication( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.BackupVaultPatch(_Model): + tags: Optional[dict[str, str]] @overload - async def begin_create_or_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Volume, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + tags: Optional[dict[str, str]] = ... + ) -> None: ... @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Volume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BackupVaultProperties(_Model): + provisioning_state: Optional[str] + + + class azure.mgmt.netapp.models.BackupsMigrationRequest(_Model): + backup_vault_id: str @overload - async def begin_create_or_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + backup_vault_id: str + ) -> None: ... - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - *, - force_delete: Optional[bool] = ..., - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_delete_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - async def begin_finalize_external_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + class azure.mgmt.netapp.models.BindAuthenticationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "Anonymous" + SIMPLE = "Simple" - @distributed_trace_async - async def begin_finalize_relocation( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + + class azure.mgmt.netapp.models.BindPasswordAkvConfig(_Model): + azure_key_vault_uri: str + secret_name: str + user_assigned_identity: Optional[str] @overload - async def begin_list_get_group_id_list_for_ldap_user( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: GetGroupIdListForLDAPUserRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[GetGroupIdListForLDAPUserResponse]: ... + azure_key_vault_uri: str, + secret_name: str, + user_assigned_identity: Optional[str] = ... + ) -> None: ... @overload - async def begin_list_get_group_id_list_for_ldap_user( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: GetGroupIdListForLDAPUserRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[GetGroupIdListForLDAPUserResponse]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BindPasswordAkvConfigPatch(_Model): + azure_key_vault_uri: Optional[str] + secret_name: Optional[str] + user_assigned_identity: Optional[str] @overload - async def begin_list_get_group_id_list_for_ldap_user( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[GetGroupIdListForLDAPUserResponse]: ... + azure_key_vault_uri: Optional[str] = ..., + secret_name: Optional[str] = ..., + user_assigned_identity: Optional[str] = ... + ) -> None: ... @overload - async def begin_list_quota_report( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BreakFileLocksRequest(_Model): + client_ip: Optional[str] + confirm_running_disruptive_operation: Optional[bool] + + @overload + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[QuotaReportFilterRequest] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ListQuotaReportResult]: ... + client_ip: Optional[str] = ..., + confirm_running_disruptive_operation: Optional[bool] = ... + ) -> None: ... @overload - async def begin_list_quota_report( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BreakReplicationRequest(_Model): + force_break_replication: Optional[bool] + + @overload + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[QuotaReportFilterRequest] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ListQuotaReportResult]: ... + force_break_replication: Optional[bool] = ... + ) -> None: ... @overload - async def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ListQuotaReportResult]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @overload - async def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PeerClusterForVolumeMigrationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ClusterPeerCommandResponse]: ... + + class azure.mgmt.netapp.models.BreakthroughMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.Bucket(ProxyResource): + id: str + name: str + properties: Optional[BucketProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... @overload - async def begin_peer_external_cluster( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PeerClusterForVolumeMigrationRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ClusterPeerCommandResponse]: ... + properties: Optional[BucketProperties] = ... + ) -> None: ... @overload - async def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ClusterPeerCommandResponse]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_perform_replication_transfer( + def __setattr__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.BucketCredentialsExpiry(_Model): + key_pair_expiry_days: Optional[int] @overload - async def begin_pool_change( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PoolChangeRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + key_pair_expiry_days: Optional[int] = ... + ) -> None: ... @overload - async def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BucketGenerateCredentials(_Model): + access_key: Optional[str] + key_pair_expiry: Optional[datetime] + secret_key: Optional[str] + + + class azure.mgmt.netapp.models.BucketPatch(ProxyResource): + id: str + name: str + properties: Optional[BucketPatchProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... @overload - async def begin_pool_change( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + properties: Optional[BucketPatchProperties] = ... + ) -> None: ... - @distributed_trace_async - async def begin_populate_availability_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_re_initialize_replication( + def __setattr__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.BucketPatchPermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + + + class azure.mgmt.netapp.models.BucketPatchProperties(_Model): + akv_details: Optional[AzureKeyVaultDetails] + file_system_user: Optional[FileSystemUser] + permissions: Optional[Union[str, BucketPatchPermissions]] + provisioning_state: Optional[Union[str, NetAppProvisioningState]] + server: Optional[BucketServerPatchProperties] @overload - async def begin_reestablish_replication( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ReestablishReplicationRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + akv_details: Optional[AzureKeyVaultDetails] = ..., + file_system_user: Optional[FileSystemUser] = ..., + permissions: Optional[Union[str, BucketPatchPermissions]] = ..., + server: Optional[BucketServerPatchProperties] = ... + ) -> None: ... @overload - async def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ReestablishReplicationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BucketPermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + + + class azure.mgmt.netapp.models.BucketProperties(_Model): + akv_details: Optional[AzureKeyVaultDetails] + file_system_user: Optional[FileSystemUser] + path: Optional[str] + permissions: Optional[Union[str, BucketPermissions]] + provisioning_state: Optional[Union[str, NetAppProvisioningState]] + server: Optional[BucketServerProperties] + status: Optional[Union[str, CredentialsStatus]] @overload - async def begin_reestablish_replication( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + akv_details: Optional[AzureKeyVaultDetails] = ..., + file_system_user: Optional[FileSystemUser] = ..., + path: Optional[str] = ..., + permissions: Optional[Union[str, BucketPermissions]] = ..., + server: Optional[BucketServerProperties] = ... + ) -> None: ... @overload - async def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[RelocateVolumeRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.BucketServerPatchProperties(_Model): + certificate_object: Optional[str] + fqdn: Optional[str] + on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] @overload - async def begin_relocate( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[RelocateVolumeRequest] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + certificate_object: Optional[str] = ..., + fqdn: Optional[str] = ..., + on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] = ... + ) -> None: ... @overload - async def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_reset_cifs_password( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - async def begin_resync_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + class azure.mgmt.netapp.models.BucketServerProperties(_Model): + certificate_common_name: Optional[str] + certificate_expiry_date: Optional[datetime] + certificate_object: Optional[str] + fqdn: Optional[str] + ip_address: Optional[str] + on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] @overload - async def begin_revert( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumeRevert, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + certificate_object: Optional[str] = ..., + fqdn: Optional[str] = ..., + on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] = ... + ) -> None: ... @overload - async def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.Cache(TrackedResource): + etag: Optional[str] + id: str + location: str + name: str + properties: CacheProperties + system_data: SystemData + tags: dict[str, str] + type: str + zones: Optional[list[str]] @overload - async def begin_revert( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + location: str, + properties: CacheProperties, + tags: Optional[dict[str, str]] = ..., + zones: Optional[list[str]] = ... + ) -> None: ... - @distributed_trace_async - async def begin_revert_relocation( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace_async - async def begin_split_clone_from_parent( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + + class azure.mgmt.netapp.models.CacheFileAccessLogs(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.CacheLifeCycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLUSTER_PEERING_OFFER_SENT = "ClusterPeeringOfferSent" + CREATING = "Creating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + VSERVER_PEERING_OFFER_SENT = "VserverPeeringOfferSent" + + + class azure.mgmt.netapp.models.CacheMountTargetProperties(_Model): + ip_address: Optional[str] + mount_target_id: Optional[str] + smb_server_fqdn: Optional[str] + + + class azure.mgmt.netapp.models.CacheProperties(_Model): + actual_throughput_mibps: Optional[float] + cache_state: Optional[Union[str, CacheLifeCycleState]] + cache_subnet_resource_id: str + cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] + encryption: Optional[Union[str, EncryptionState]] + encryption_key_source: Union[str, EncryptionKeySource] + export_policy: Optional[CachePropertiesExportPolicy] + file_access_logs: Optional[Union[str, CacheFileAccessLogs]] + file_path: str + global_file_locking: Optional[Union[str, GlobalFileLockingState]] + kerberos: Optional[Union[str, KerberosState]] + key_vault_private_endpoint_resource_id: Optional[str] + language: Optional[Union[str, VolumeLanguage]] + ldap: Optional[Union[str, LdapState]] + ldap_server_type: Optional[Union[str, LdapServerType]] + maximum_number_of_files: Optional[int] + mount_targets: Optional[list[CacheMountTargetProperties]] + origin_cluster_information: OriginClusterInformation + peering_subnet_resource_id: str + protocol_types: Optional[list[Union[str, ProtocolTypes]]] + provisioning_state: Optional[Union[str, CacheProvisioningState]] + size: int + smb_settings: Optional[SmbSettings] + throughput_mibps: Optional[float] + write_back: Optional[Union[str, EnableWriteBackState]] @overload - async def begin_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumePatch, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + cache_subnet_resource_id: str, + cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] = ..., + encryption_key_source: Union[str, EncryptionKeySource], + export_policy: Optional[CachePropertiesExportPolicy] = ..., + file_path: str, + global_file_locking: Optional[Union[str, GlobalFileLockingState]] = ..., + kerberos: Optional[Union[str, KerberosState]] = ..., + key_vault_private_endpoint_resource_id: Optional[str] = ..., + ldap: Optional[Union[str, LdapState]] = ..., + ldap_server_type: Optional[Union[str, LdapServerType]] = ..., + origin_cluster_information: OriginClusterInformation, + peering_subnet_resource_id: str, + protocol_types: Optional[list[Union[str, ProtocolTypes]]] = ..., + size: int, + smb_settings: Optional[SmbSettings] = ..., + throughput_mibps: Optional[float] = ..., + write_back: Optional[Union[str, EnableWriteBackState]] = ... + ) -> None: ... @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.CachePropertiesExportPolicy(_Model): + rules: Optional[list[ExportPolicyRule]] @overload - async def begin_update( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Volume]: ... + rules: Optional[list[ExportPolicyRule]] = ... + ) -> None: ... - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> Volume: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> AsyncItemPaged[Volume]: ... + + class azure.mgmt.netapp.models.CacheProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.netapp.models.CacheUpdate(_Model): + properties: Optional[CacheUpdateProperties] + tags: Optional[dict[str, str]] @overload - def list_replications( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[ListReplicationsRequest] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncItemPaged[Replication]: ... + properties: Optional[CacheUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[ListReplicationsRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncItemPaged[Replication]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.netapp.models.CacheUpdateProperties(_Model): + cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] + export_policy: Optional[CachePropertiesExportPolicy] + key_vault_private_endpoint_resource_id: Optional[str] + protocol_types: Optional[list[Union[str, ProtocolTypes]]] + size: Optional[int] + smb_settings: Optional[SmbSettings] + throughput_mibps: Optional[float] + write_back: Optional[Union[str, EnableWriteBackState]] @overload - def list_replications( + def __init__( self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncItemPaged[Replication]: ... - - @distributed_trace_async - async def replication_status( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ReplicationStatus: ... - + cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] = ..., + export_policy: Optional[CachePropertiesExportPolicy] = ..., + key_vault_private_endpoint_resource_id: Optional[str] = ..., + protocol_types: Optional[list[Union[str, ProtocolTypes]]] = ..., + size: Optional[int] = ..., + smb_settings: Optional[SmbSettings] = ..., + throughput_mibps: Optional[float] = ..., + write_back: Optional[Union[str, EnableWriteBackState]] = ... + ) -> None: ... -namespace azure.mgmt.netapp.models + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.AcceptGrowCapacityPoolForShortTermCloneSplit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACCEPTED = "Accepted" - DECLINED = "Declined" + class azure.mgmt.netapp.models.CapacityPool(TrackedResource): + etag: Optional[str] + id: str + location: str + name: str + properties: PoolProperties + system_data: SystemData + tags: dict[str, str] + type: str - class azure.mgmt.netapp.models.AccountEncryption(_Model): - identity: Optional[EncryptionIdentity] - key_source: Optional[Union[str, KeySource]] - key_vault_properties: Optional[KeyVaultProperties] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - identity: Optional[EncryptionIdentity] = ..., - key_source: Optional[Union[str, KeySource]] = ..., - key_vault_properties: Optional[KeyVaultProperties] = ... + location: str, + properties: PoolProperties, + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.AccountProperties(_Model): - active_directories: Optional[list[ActiveDirectory]] - disable_showmount: Optional[bool] - encryption: Optional[AccountEncryption] - entra_id_config: Optional[EntraIdConfig] - ldap_configuration: Optional[LdapConfiguration] - multi_ad_status: Optional[Union[str, MultiAdStatus]] - nfs_v4_id_domain: Optional[str] - provisioning_state: Optional[str] + class azure.mgmt.netapp.models.CapacityPoolPatch(_Model): + id: Optional[str] + location: Optional[str] + name: Optional[str] + properties: Optional[PoolPatchProperties] + tags: Optional[dict[str, str]] + type: Optional[str] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - active_directories: Optional[list[ActiveDirectory]] = ..., - encryption: Optional[AccountEncryption] = ..., - entra_id_config: Optional[EntraIdConfig] = ..., - ldap_configuration: Optional[LdapConfiguration] = ..., - nfs_v4_id_domain: Optional[str] = ... + location: Optional[str] = ..., + properties: Optional[PoolPatchProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.AccountPropertiesPatch(_Model): - active_directories: Optional[list[ActiveDirectory]] - encryption: Optional[AccountEncryption] - entra_id_config: Optional[EntraIdConfigPatch] - ldap_configuration: Optional[LdapConfigurationPatch] - nfs_v4_id_domain: Optional[str] + class azure.mgmt.netapp.models.CertificateAkvDetails(_Model): + certificate_key_vault_uri: Optional[str] + certificate_name: Optional[str] @overload def __init__( self, *, - active_directories: Optional[list[ActiveDirectory]] = ..., - encryption: Optional[AccountEncryption] = ..., - entra_id_config: Optional[EntraIdConfigPatch] = ..., - ldap_configuration: Optional[LdapConfigurationPatch] = ..., - nfs_v4_id_domain: Optional[str] = ... + certificate_key_vault_uri: Optional[str] = ..., + certificate_name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ActiveDirectory(_Model): - active_directory_id: Optional[str] - ad_name: Optional[str] - administrators: Optional[list[str]] - aes_encryption: Optional[bool] - allow_local_nfs_users_with_ldap: Optional[bool] - backup_operators: Optional[list[str]] - dns: Optional[str] - domain: Optional[str] - encrypt_dc_connections: Optional[bool] - kdc_ip: Optional[str] - ldap_over_tls: Optional[bool] - ldap_search_scope: Optional[LdapSearchScopeOpt] - ldap_signing: Optional[bool] - organizational_unit: Optional[str] - password: Optional[str] - preferred_servers_for_ldap_client: Optional[str] - security_operators: Optional[list[str]] - server_root_ca_certificate: Optional[str] - site: Optional[str] - smb_server_name: Optional[str] - status: Optional[Union[str, ActiveDirectoryStatus]] - status_details: Optional[str] - username: Optional[str] + class azure.mgmt.netapp.models.ChangeKeyVault(_Model): + key_name: str + key_vault_private_endpoints: list[KeyVaultPrivateEndpoint] + key_vault_resource_id: Optional[str] + key_vault_uri: str @overload def __init__( self, *, - active_directory_id: Optional[str] = ..., - ad_name: Optional[str] = ..., - administrators: Optional[list[str]] = ..., - aes_encryption: Optional[bool] = ..., - allow_local_nfs_users_with_ldap: Optional[bool] = ..., - backup_operators: Optional[list[str]] = ..., - dns: Optional[str] = ..., - domain: Optional[str] = ..., - encrypt_dc_connections: Optional[bool] = ..., - kdc_ip: Optional[str] = ..., - ldap_over_tls: Optional[bool] = ..., - ldap_search_scope: Optional[LdapSearchScopeOpt] = ..., - ldap_signing: Optional[bool] = ..., - organizational_unit: Optional[str] = ..., - password: Optional[str] = ..., - preferred_servers_for_ldap_client: Optional[str] = ..., - security_operators: Optional[list[str]] = ..., - server_root_ca_certificate: Optional[str] = ..., - site: Optional[str] = ..., - smb_server_name: Optional[str] = ..., - username: Optional[str] = ... + key_name: str, + key_vault_private_endpoints: list[KeyVaultPrivateEndpoint], + key_vault_resource_id: Optional[str] = ..., + key_vault_uri: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ActiveDirectoryConfig(TrackedResource): - etag: Optional[str] - id: str - identity: Optional[ManagedServiceIdentity] - location: str - name: str - properties: Optional[ActiveDirectoryConfigProperties] - system_data: SystemData - tags: dict[str, str] - type: str + class azure.mgmt.netapp.models.CheckAvailabilityResponse(_Model): + is_available: Optional[bool] + message: Optional[str] + reason: Optional[Union[str, InAvailabilityReasonType]] @overload def __init__( self, *, - identity: Optional[ManagedServiceIdentity] = ..., - location: str, - properties: Optional[ActiveDirectoryConfigProperties] = ..., - tags: Optional[dict[str, str]] = ... + is_available: Optional[bool] = ..., + message: Optional[str] = ..., + reason: Optional[Union[str, InAvailabilityReasonType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ActiveDirectoryConfigProperties(_Model): - active_directory_status: Optional[Union[str, ActiveDirectoryStatus]] - administrators: Optional[list[str]] - backup_operators: Optional[list[str]] - dns: Optional[list[str]] - domain: str - organizational_unit: Optional[str] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - secret_password: SecretPassword - security_operators: Optional[list[str]] - site: str - smb_server_name: Optional[str] - user_name: Optional[str] + class azure.mgmt.netapp.models.CheckNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MICROSOFT_NET_APP_NET_APP_ACCOUNTS = "Microsoft.NetApp/netAppAccounts" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_BACKUP_VAULTS_BACKUPS = "Microsoft.NetApp/netAppAccounts/backupVaults/backups" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS = "Microsoft.NetApp/netAppAccounts/capacityPools" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_BACKUPS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" + + + class azure.mgmt.netapp.models.CheckQuotaNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MICROSOFT_NET_APP_NET_APP_ACCOUNTS = "Microsoft.NetApp/netAppAccounts" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_BACKUP_VAULTS_BACKUPS = "Microsoft.NetApp/netAppAccounts/backupVaults/backups" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS = "Microsoft.NetApp/netAppAccounts/capacityPools" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_BACKUPS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups" + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" + + + class azure.mgmt.netapp.models.ChownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RESTRICTED = "Restricted" + UNRESTRICTED = "Unrestricted" + + + class azure.mgmt.netapp.models.CifsChangeNotifyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.CifsUser(_Model): + username: Optional[str] @overload def __init__( self, *, - administrators: Optional[list[str]] = ..., - backup_operators: Optional[list[str]] = ..., - dns: Optional[list[str]] = ..., - domain: str, - organizational_unit: Optional[str] = ..., - secret_password: SecretPassword, - security_operators: Optional[list[str]] = ..., - site: str, - smb_server_name: Optional[str] = ..., - user_name: Optional[str] = ... + username: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ActiveDirectoryConfigUpdate(_Model): - identity: Optional[ManagedServiceIdentity] - properties: Optional[ActiveDirectoryConfigUpdateProperties] - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.ClusterPeerCommandResponse(_Model): + properties: Optional[ClusterPeerCommandResponseProperties] @overload def __init__( self, *, - identity: Optional[ManagedServiceIdentity] = ..., - properties: Optional[ActiveDirectoryConfigUpdateProperties] = ..., - tags: Optional[dict[str, str]] = ... + properties: Optional[ClusterPeerCommandResponseProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ActiveDirectoryConfigUpdateProperties(_Model): - administrators: Optional[list[str]] - backup_operators: Optional[list[str]] - dns: Optional[list[str]] - domain: Optional[str] - organizational_unit: Optional[str] - secret_password: Optional[SecretPassword] - security_operators: Optional[list[str]] - site: Optional[str] - smb_server_name: Optional[str] - user_name: Optional[str] + class azure.mgmt.netapp.models.ClusterPeerCommandResponseProperties(_Model): + cluster_peering_command: Optional[str] + passphrase: Optional[str] @overload def __init__( self, *, - administrators: Optional[list[str]] = ..., - backup_operators: Optional[list[str]] = ..., - dns: Optional[list[str]] = ..., - domain: Optional[str] = ..., - organizational_unit: Optional[str] = ..., - secret_password: Optional[SecretPassword] = ..., - security_operators: Optional[list[str]] = ..., - site: Optional[str] = ..., - smb_server_name: Optional[str] = ..., - user_name: Optional[str] = ... + cluster_peering_command: Optional[str] = ..., + passphrase: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ActiveDirectoryStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATED = "Created" - DELETED = "Deleted" - ERROR = "Error" - IN_USE = "InUse" - UPDATING = "Updating" + class azure.mgmt.netapp.models.CoolAccessRetrievalPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "Default" + NEVER = "Never" + ON_READ = "OnRead" - class azure.mgmt.netapp.models.ActualRansomwareProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - LEARNING = "Learning" - PAUSED = "Paused" + class azure.mgmt.netapp.models.CoolAccessTieringPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "Auto" + SNAPSHOT_ONLY = "SnapshotOnly" - class azure.mgmt.netapp.models.ApplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ORACLE = "ORACLE" - SAP_HANA = "SAP-HANA" + class azure.mgmt.netapp.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" - class azure.mgmt.netapp.models.AuthorizeRequest(_Model): - remote_volume_resource_id: Optional[str] + class azure.mgmt.netapp.models.CredentialsAkvDetails(_Model): + credentials_key_vault_uri: Optional[str] + secret_name: Optional[str] @overload def __init__( self, *, - remote_volume_resource_id: Optional[str] = ... + credentials_key_vault_uri: Optional[str] = ..., + secret_name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.AvsDataStore(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.CredentialsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + CREDENTIALS_EXPIRED = "CredentialsExpired" + NO_CREDENTIALS_SET = "NoCredentialsSet" - class azure.mgmt.netapp.models.AzureKeyVaultDetails(_Model): - certificate_akv_details: Optional[CertificateAkvDetails] - credentials_akv_details: Optional[CredentialsAkvDetails] + class azure.mgmt.netapp.models.DailySchedule(_Model): + hour: Optional[int] + minute: Optional[int] + snapshots_to_keep: Optional[int] + used_bytes: Optional[int] @overload def __init__( self, *, - certificate_akv_details: Optional[CertificateAkvDetails] = ..., - credentials_akv_details: Optional[CredentialsAkvDetails] = ... + hour: Optional[int] = ..., + minute: Optional[int] = ..., + snapshots_to_keep: Optional[int] = ..., + used_bytes: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.Backup(ProxyResource): - id: str - name: str - properties: BackupProperties - system_data: SystemData - type: str + class azure.mgmt.netapp.models.DesiredRansomwareProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" - def __getattr__(self, name: str) -> Any: ... + + class azure.mgmt.netapp.models.DestinationReplication(_Model): + region: Optional[str] + replication_type: Optional[Union[str, ReplicationType]] + resource_id: Optional[str] + zone: Optional[str] @overload def __init__( self, *, - properties: BackupProperties + region: Optional[str] = ..., + replication_type: Optional[Union[str, ReplicationType]] = ..., + resource_id: Optional[str] = ..., + zone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.BackupPatch(_Model): - properties: Optional[BackupPatchProperties] - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.Dimension(_Model): + display_name: Optional[str] + name: Optional[str] @overload def __init__( self, *, - properties: Optional[BackupPatchProperties] = ... + display_name: Optional[str] = ..., + name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + class azure.mgmt.netapp.models.EnableSubvolumes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" - class azure.mgmt.netapp.models.BackupPatchProperties(_Model): - label: Optional[str] + + class azure.mgmt.netapp.models.EnableWriteBackState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.EncryptionIdentity(_Model): + federated_client_id: Optional[str] + principal_id: Optional[str] + user_assigned_identity: Optional[str] @overload def __init__( self, *, - label: Optional[str] = ... + federated_client_id: Optional[str] = ..., + user_assigned_identity: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BackupPolicy(TrackedResource): - etag: Optional[str] - id: str - location: str - name: str - properties: BackupPolicyProperties - system_data: SystemData - tags: dict[str, str] - type: str - - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.EncryptionIdentityPatch(_Model): + federated_client_id: Optional[str] + user_assigned_identity: Optional[str] @overload def __init__( self, *, - location: str, - properties: BackupPolicyProperties, - tags: Optional[dict[str, str]] = ... + federated_client_id: Optional[str] = ..., + user_assigned_identity: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + class azure.mgmt.netapp.models.EncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MICROSOFT_KEY_VAULT = "Microsoft.KeyVault" + MICROSOFT_NET_APP = "Microsoft.NetApp" - class azure.mgmt.netapp.models.BackupPolicyPatch(_Model): - id: Optional[str] - location: Optional[str] - name: Optional[str] - properties: Optional[BackupPolicyProperties] - tags: Optional[dict[str, str]] - type: Optional[str] - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.EncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.EncryptionTransitionRequest(_Model): + private_endpoint_id: str + virtual_network_id: str @overload def __init__( self, *, - location: Optional[str] = ..., - properties: Optional[BackupPolicyProperties] = ..., - tags: Optional[dict[str, str]] = ... + private_endpoint_id: str, + virtual_network_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - class azure.mgmt.netapp.models.BackupPolicyProperties(_Model): - backup_policy_id: Optional[str] - daily_backups_to_keep: Optional[int] - enabled: Optional[bool] - monthly_backups_to_keep: Optional[int] - provisioning_state: Optional[str] - volume_backups: Optional[list[VolumeBackups]] - volumes_assigned: Optional[int] - weekly_backups_to_keep: Optional[int] + class azure.mgmt.netapp.models.EncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DOUBLE = "Double" + SINGLE = "Single" - @overload - def __init__( - self, - *, - daily_backups_to_keep: Optional[int] = ..., - enabled: Optional[bool] = ..., - monthly_backups_to_keep: Optional[int] = ..., - weekly_backups_to_keep: Optional[int] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.netapp.models.EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DST = "dst" + SRC = "src" - class azure.mgmt.netapp.models.BackupProperties(_Model): - backup_id: Optional[str] - backup_policy_resource_id: Optional[str] - backup_type: Optional[Union[str, BackupType]] - completion_date: Optional[datetime] - creation_date: Optional[datetime] - failure_reason: Optional[str] - is_large_volume: Optional[bool] - label: Optional[str] - provisioning_state: Optional[str] - size: Optional[int] - snapshot_creation_date: Optional[datetime] - snapshot_name: Optional[str] - use_existing_snapshot: Optional[bool] - volume_resource_id: str + class azure.mgmt.netapp.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] - @overload - def __init__( - self, - *, - label: Optional[str] = ..., - snapshot_name: Optional[str] = ..., - use_existing_snapshot: Optional[bool] = ..., - volume_resource_id: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.netapp.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] - class azure.mgmt.netapp.models.BackupRestoreFiles(_Model): - destination_volume_id: str - file_list: list[str] - restore_file_path: Optional[str] + class azure.mgmt.netapp.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] @overload def __init__( self, *, - destination_volume_id: str, - file_list: list[str], - restore_file_path: Optional[str] = ... + error: Optional[ErrorDetail] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BackupStatus(_Model): - error_message: Optional[str] - healthy: Optional[bool] - last_transfer_size: Optional[int] - last_transfer_type: Optional[str] - mirror_state: Optional[Union[str, MirrorState]] - relationship_status: Optional[Union[str, VolumeBackupRelationshipStatus]] - total_transfer_bytes: Optional[int] - transfer_progress_bytes: Optional[int] - unhealthy_reason: Optional[str] - - - class azure.mgmt.netapp.models.BackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANUAL = "Manual" - SCHEDULED = "Scheduled" - + class azure.mgmt.netapp.models.Exclude(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELETED = "Deleted" + NONE = "None" - class azure.mgmt.netapp.models.BackupVault(TrackedResource): - id: str - location: str - name: str - properties: Optional[BackupVaultProperties] - system_data: SystemData - tags: dict[str, str] - type: str - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.ExportPolicyRule(_Model): + allowed_clients: Optional[str] + chown_mode: Optional[Union[str, ChownMode]] + cifs: Optional[bool] + has_root_access: Optional[bool] + kerberos5_i_read_only: Optional[bool] + kerberos5_i_read_write: Optional[bool] + kerberos5_p_read_only: Optional[bool] + kerberos5_p_read_write: Optional[bool] + kerberos5_read_only: Optional[bool] + kerberos5_read_write: Optional[bool] + nfsv3: Optional[bool] + nfsv41: Optional[bool] + rule_index: Optional[int] + unix_read_only: Optional[bool] + unix_read_write: Optional[bool] @overload def __init__( self, *, - location: str, - properties: Optional[BackupVaultProperties] = ..., - tags: Optional[dict[str, str]] = ... + allowed_clients: Optional[str] = ..., + chown_mode: Optional[Union[str, ChownMode]] = ..., + cifs: Optional[bool] = ..., + has_root_access: Optional[bool] = ..., + kerberos5_i_read_only: Optional[bool] = ..., + kerberos5_i_read_write: Optional[bool] = ..., + kerberos5_p_read_only: Optional[bool] = ..., + kerberos5_p_read_write: Optional[bool] = ..., + kerberos5_read_only: Optional[bool] = ..., + kerberos5_read_write: Optional[bool] = ..., + nfsv3: Optional[bool] = ..., + nfsv41: Optional[bool] = ..., + rule_index: Optional[int] = ..., + unix_read_only: Optional[bool] = ..., + unix_read_write: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + + class azure.mgmt.netapp.models.ExternalReplicationSetupStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLUSTER_PEER_PENDING = "ClusterPeerPending" + CLUSTER_PEER_REQUIRED = "ClusterPeerRequired" + NO_ACTION_REQUIRED = "NoActionRequired" + REPLICATION_CREATE_REQUIRED = "ReplicationCreateRequired" + V_SERVER_PEER_REQUIRED = "VServerPeerRequired" - class azure.mgmt.netapp.models.BackupVaultPatch(_Model): - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.FileAccessLogs(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.FilePathAvailabilityRequest(_Model): + availability_zone: Optional[str] + name: str + subnet_id: str @overload def __init__( self, *, - tags: Optional[dict[str, str]] = ... + availability_zone: Optional[str] = ..., + name: str, + subnet_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BackupVaultProperties(_Model): - provisioning_state: Optional[str] - - - class azure.mgmt.netapp.models.BackupsMigrationRequest(_Model): - backup_vault_id: str + class azure.mgmt.netapp.models.FileSystemUser(_Model): + cifs_user: Optional[CifsUser] + nfs_user: Optional[NfsUser] @overload def __init__( self, *, - backup_vault_id: str + cifs_user: Optional[CifsUser] = ..., + nfs_user: Optional[NfsUser] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BindAuthenticationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANONYMOUS = "Anonymous" - SIMPLE = "Simple" - - - class azure.mgmt.netapp.models.BindPasswordAkvConfig(_Model): - azure_key_vault_uri: str - secret_name: str - user_assigned_identity: Optional[str] + class azure.mgmt.netapp.models.GetGroupIdListForLDAPUserRequest(_Model): + username: str @overload def __init__( self, *, - azure_key_vault_uri: str, - secret_name: str, - user_assigned_identity: Optional[str] = ... + username: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BindPasswordAkvConfigPatch(_Model): - azure_key_vault_uri: Optional[str] - secret_name: Optional[str] - user_assigned_identity: Optional[str] + class azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse(_Model): + group_ids_for_ldap_user: Optional[list[str]] @overload def __init__( self, *, - azure_key_vault_uri: Optional[str] = ..., - secret_name: Optional[str] = ..., - user_assigned_identity: Optional[str] = ... + group_ids_for_ldap_user: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BreakFileLocksRequest(_Model): - client_ip: Optional[str] - confirm_running_disruptive_operation: Optional[bool] + class azure.mgmt.netapp.models.GetKeyVaultStatusResponse(_Model): + properties: Optional[GetKeyVaultStatusResponseProperties] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - client_ip: Optional[str] = ..., - confirm_running_disruptive_operation: Optional[bool] = ... + properties: Optional[GetKeyVaultStatusResponseProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.BreakReplicationRequest(_Model): - force_break_replication: Optional[bool] + + class azure.mgmt.netapp.models.GetKeyVaultStatusResponseProperties(_Model): + key_name: Optional[str] + key_vault_private_endpoints: Optional[list[KeyVaultPrivateEndpoint]] + key_vault_resource_id: Optional[str] + key_vault_uri: Optional[str] @overload def __init__( self, *, - force_break_replication: Optional[bool] = ... + key_name: Optional[str] = ..., + key_vault_private_endpoints: Optional[list[KeyVaultPrivateEndpoint]] = ..., + key_vault_resource_id: Optional[str] = ..., + key_vault_uri: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BreakthroughMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.mgmt.netapp.models.GlobalFileLockingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" ENABLED = "Enabled" - class azure.mgmt.netapp.models.Bucket(ProxyResource): - id: str - name: str - properties: Optional[BucketProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.HourlySchedule(_Model): + minute: Optional[int] + snapshots_to_keep: Optional[int] + used_bytes: Optional[int] @overload def __init__( self, *, - properties: Optional[BucketProperties] = ... + minute: Optional[int] = ..., + snapshots_to_keep: Optional[int] = ..., + used_bytes: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + class azure.mgmt.netapp.models.InAvailabilityReasonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALREADY_EXISTS = "AlreadyExists" + INVALID = "Invalid" - class azure.mgmt.netapp.models.BucketCredentialsExpiry(_Model): - key_pair_expiry_days: Optional[int] + + class azure.mgmt.netapp.models.KerberosState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.KeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MICROSOFT_KEY_VAULT = "Microsoft.KeyVault" + MICROSOFT_NET_APP = "Microsoft.NetApp" + + + class azure.mgmt.netapp.models.KeyVaultPrivateEndpoint(_Model): + private_endpoint_id: Optional[str] + virtual_network_id: Optional[str] @overload def __init__( self, *, - key_pair_expiry_days: Optional[int] = ... + private_endpoint_id: Optional[str] = ..., + virtual_network_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BucketGenerateCredentials(_Model): - access_key: Optional[str] - key_pair_expiry: Optional[datetime] - secret_key: Optional[str] - - - class azure.mgmt.netapp.models.BucketPatch(ProxyResource): - id: str - name: str - properties: Optional[BucketPatchProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.KeyVaultProperties(_Model): + key_name: str + key_vault_id: Optional[str] + key_vault_resource_id: Optional[str] + key_vault_uri: str + status: Optional[Union[str, KeyVaultStatus]] @overload def __init__( self, *, - properties: Optional[BucketPatchProperties] = ... + key_name: str, + key_vault_resource_id: Optional[str] = ..., + key_vault_uri: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.BucketPatchPermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - - class azure.mgmt.netapp.models.BucketPatchProperties(_Model): - akv_details: Optional[AzureKeyVaultDetails] - file_system_user: Optional[FileSystemUser] - permissions: Optional[Union[str, BucketPatchPermissions]] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - server: Optional[BucketServerPatchProperties] + class azure.mgmt.netapp.models.KeyVaultPropertiesPatch(_Model): + key_name: Optional[str] + key_vault_resource_id: Optional[str] + key_vault_uri: Optional[str] @overload def __init__( self, *, - akv_details: Optional[AzureKeyVaultDetails] = ..., - file_system_user: Optional[FileSystemUser] = ..., - permissions: Optional[Union[str, BucketPatchPermissions]] = ..., - server: Optional[BucketServerPatchProperties] = ... + key_name: Optional[str] = ..., + key_vault_resource_id: Optional[str] = ..., + key_vault_uri: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BucketPermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" + class azure.mgmt.netapp.models.KeyVaultStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATED = "Created" + DELETED = "Deleted" + ERROR = "Error" + IN_USE = "InUse" + UPDATING = "Updating" - class azure.mgmt.netapp.models.BucketProperties(_Model): - akv_details: Optional[AzureKeyVaultDetails] - file_system_user: Optional[FileSystemUser] - path: Optional[str] - permissions: Optional[Union[str, BucketPermissions]] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - server: Optional[BucketServerProperties] - status: Optional[Union[str, CredentialsStatus]] + class azure.mgmt.netapp.models.LdapConfiguration(_Model): + bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] + bind_dn: Optional[str] + bind_password_akv_config: Optional[BindPasswordAkvConfig] + certificate_cn_host: Optional[str] + dns_servers: Optional[list[str]] + domain: Optional[str] + group_dn: Optional[str] + ldap_port: Optional[int] + ldap_servers: Optional[list[str]] + net_group_dn: Optional[str] + secure_ldap_type: Optional[Union[str, SecureLdapType]] + server_ca_certificate: Optional[str] + user_dn: Optional[str] @overload def __init__( self, *, - akv_details: Optional[AzureKeyVaultDetails] = ..., - file_system_user: Optional[FileSystemUser] = ..., - path: Optional[str] = ..., - permissions: Optional[Union[str, BucketPermissions]] = ..., - server: Optional[BucketServerProperties] = ... + bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] = ..., + bind_dn: Optional[str] = ..., + bind_password_akv_config: Optional[BindPasswordAkvConfig] = ..., + certificate_cn_host: Optional[str] = ..., + dns_servers: Optional[list[str]] = ..., + domain: Optional[str] = ..., + group_dn: Optional[str] = ..., + ldap_port: Optional[int] = ..., + ldap_servers: Optional[list[str]] = ..., + net_group_dn: Optional[str] = ..., + secure_ldap_type: Optional[Union[str, SecureLdapType]] = ..., + server_ca_certificate: Optional[str] = ..., + user_dn: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BucketServerPatchProperties(_Model): - certificate_object: Optional[str] - fqdn: Optional[str] - on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] + class azure.mgmt.netapp.models.LdapConfigurationPatch(_Model): + bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] + bind_dn: Optional[str] + bind_password_akv_config: Optional[BindPasswordAkvConfigPatch] + certificate_cn_host: Optional[str] + dns_servers: Optional[list[str]] + domain: Optional[str] + group_dn: Optional[str] + ldap_port: Optional[int] + ldap_servers: Optional[list[str]] + net_group_dn: Optional[str] + secure_ldap_type: Optional[Union[str, SecureLdapType]] + server_ca_certificate: Optional[str] + user_dn: Optional[str] @overload def __init__( self, *, - certificate_object: Optional[str] = ..., - fqdn: Optional[str] = ..., - on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] = ... + bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] = ..., + bind_dn: Optional[str] = ..., + bind_password_akv_config: Optional[BindPasswordAkvConfigPatch] = ..., + certificate_cn_host: Optional[str] = ..., + dns_servers: Optional[list[str]] = ..., + domain: Optional[str] = ..., + group_dn: Optional[str] = ..., + ldap_port: Optional[int] = ..., + ldap_servers: Optional[list[str]] = ..., + net_group_dn: Optional[str] = ..., + secure_ldap_type: Optional[Union[str, SecureLdapType]] = ..., + server_ca_certificate: Optional[str] = ..., + user_dn: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.BucketServerProperties(_Model): - certificate_common_name: Optional[str] - certificate_expiry_date: Optional[datetime] - certificate_object: Optional[str] - fqdn: Optional[str] - ip_address: Optional[str] - on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] + class azure.mgmt.netapp.models.LdapSearchScopeOpt(_Model): + group_dn: Optional[str] + group_membership_filter: Optional[str] + user_dn: Optional[str] @overload def __init__( self, *, - certificate_object: Optional[str] = ..., - fqdn: Optional[str] = ..., - on_certificate_conflict_action: Optional[Union[str, OnCertificateConflictAction]] = ... + group_dn: Optional[str] = ..., + group_membership_filter: Optional[str] = ..., + user_dn: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.Cache(TrackedResource): - etag: Optional[str] - id: str - location: str - name: str - properties: CacheProperties - system_data: SystemData - tags: dict[str, str] - type: str - zones: Optional[list[str]] - - @overload - def __init__( - self, - *, - location: str, - properties: CacheProperties, - tags: Optional[dict[str, str]] = ..., - zones: Optional[list[str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.netapp.models.LdapServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE_DIRECTORY = "ActiveDirectory" + OPEN_LDAP = "OpenLDAP" - class azure.mgmt.netapp.models.CacheFileAccessLogs(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.mgmt.netapp.models.LdapState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" ENABLED = "Enabled" - class azure.mgmt.netapp.models.CacheLifeCycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLUSTER_PEERING_OFFER_SENT = "ClusterPeeringOfferSent" - CREATING = "Creating" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - VSERVER_PEERING_OFFER_SENT = "VserverPeeringOfferSent" - - - class azure.mgmt.netapp.models.CacheMountTargetProperties(_Model): - ip_address: Optional[str] - mount_target_id: Optional[str] - smb_server_fqdn: Optional[str] - - - class azure.mgmt.netapp.models.CacheProperties(_Model): - actual_throughput_mibps: Optional[float] - cache_state: Optional[Union[str, CacheLifeCycleState]] - cache_subnet_resource_id: str - cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] - encryption: Optional[Union[str, EncryptionState]] - encryption_key_source: Union[str, EncryptionKeySource] - export_policy: Optional[CachePropertiesExportPolicy] - file_access_logs: Optional[Union[str, CacheFileAccessLogs]] - file_path: str - global_file_locking: Optional[Union[str, GlobalFileLockingState]] - kerberos: Optional[Union[str, KerberosState]] - key_vault_private_endpoint_resource_id: Optional[str] - language: Optional[Union[str, VolumeLanguage]] - ldap: Optional[Union[str, LdapState]] - ldap_server_type: Optional[Union[str, LdapServerType]] - maximum_number_of_files: Optional[int] - mount_targets: Optional[list[CacheMountTargetProperties]] - origin_cluster_information: OriginClusterInformation - peering_subnet_resource_id: str - protocol_types: Optional[list[Union[str, ProtocolTypes]]] - provisioning_state: Optional[Union[str, CacheProvisioningState]] - size: int - smb_settings: Optional[SmbSettings] - throughput_mibps: Optional[float] - write_back: Optional[Union[str, EnableWriteBackState]] + class azure.mgmt.netapp.models.ListQuotaReportResponse(_Model): + quota_report_records: Optional[list[QuotaReport]] @overload def __init__( self, *, - cache_subnet_resource_id: str, - cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] = ..., - encryption_key_source: Union[str, EncryptionKeySource], - export_policy: Optional[CachePropertiesExportPolicy] = ..., - file_path: str, - global_file_locking: Optional[Union[str, GlobalFileLockingState]] = ..., - kerberos: Optional[Union[str, KerberosState]] = ..., - key_vault_private_endpoint_resource_id: Optional[str] = ..., - ldap: Optional[Union[str, LdapState]] = ..., - ldap_server_type: Optional[Union[str, LdapServerType]] = ..., - origin_cluster_information: OriginClusterInformation, - peering_subnet_resource_id: str, - protocol_types: Optional[list[Union[str, ProtocolTypes]]] = ..., - size: int, - smb_settings: Optional[SmbSettings] = ..., - throughput_mibps: Optional[float] = ..., - write_back: Optional[Union[str, EnableWriteBackState]] = ... + quota_report_records: Optional[list[QuotaReport]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CachePropertiesExportPolicy(_Model): - rules: Optional[list[ExportPolicyRule]] + class azure.mgmt.netapp.models.ListQuotaReportResult(_Model): + properties: Optional[ListQuotaReportResponse] @overload def __init__( self, *, - rules: Optional[list[ExportPolicyRule]] = ... + properties: Optional[ListQuotaReportResponse] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CacheProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.mgmt.netapp.models.CacheUpdate(_Model): - properties: Optional[CacheUpdateProperties] - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.ListReplicationsRequest(_Model): + exclude: Optional[Union[str, Exclude]] @overload def __init__( self, *, - properties: Optional[CacheUpdateProperties] = ..., - tags: Optional[dict[str, str]] = ... + exclude: Optional[Union[str, Exclude]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CacheUpdateProperties(_Model): - cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] - export_policy: Optional[CachePropertiesExportPolicy] - key_vault_private_endpoint_resource_id: Optional[str] - protocol_types: Optional[list[Union[str, ProtocolTypes]]] - size: Optional[int] - smb_settings: Optional[SmbSettings] - throughput_mibps: Optional[float] - write_back: Optional[Union[str, EnableWriteBackState]] + class azure.mgmt.netapp.models.LogSpecification(_Model): + display_name: Optional[str] + name: Optional[str] @overload def __init__( self, *, - cifs_change_notifications: Optional[Union[str, CifsChangeNotifyState]] = ..., - export_policy: Optional[CachePropertiesExportPolicy] = ..., - key_vault_private_endpoint_resource_id: Optional[str] = ..., - protocol_types: Optional[list[Union[str, ProtocolTypes]]] = ..., - size: Optional[int] = ..., - smb_settings: Optional[SmbSettings] = ..., - throughput_mibps: Optional[float] = ..., - write_back: Optional[Union[str, EnableWriteBackState]] = ... + display_name: Optional[str] = ..., + name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CapacityPool(TrackedResource): - etag: Optional[str] - id: str - location: str - name: str - properties: PoolProperties - system_data: SystemData - tags: dict[str, str] - type: str - - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] @overload def __init__( self, *, - location: str, - properties: PoolProperties, - tags: Optional[dict[str, str]] = ... + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + class azure.mgmt.netapp.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" - class azure.mgmt.netapp.models.CapacityPoolPatch(_Model): - id: Optional[str] - location: Optional[str] - name: Optional[str] - properties: Optional[PoolPatchProperties] - tags: Optional[dict[str, str]] - type: Optional[str] - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.models.MetricAggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVERAGE = "Average" + + + class azure.mgmt.netapp.models.MetricSpecification(_Model): + aggregation_type: Optional[str] + category: Optional[str] + dimensions: Optional[list[Dimension]] + display_description: Optional[str] + display_name: Optional[str] + enable_regional_mdm_account: Optional[bool] + fill_gap_with_zero: Optional[bool] + internal_metric_name: Optional[str] + is_internal: Optional[bool] + name: Optional[str] + resource_id_dimension_name_override: Optional[str] + source_mdm_account: Optional[str] + source_mdm_namespace: Optional[str] + supported_aggregation_types: Optional[list[Union[str, MetricAggregationType]]] + supported_time_grain_types: Optional[list[str]] + unit: Optional[str] @overload def __init__( self, *, - location: Optional[str] = ..., - properties: Optional[PoolPatchProperties] = ..., - tags: Optional[dict[str, str]] = ... + aggregation_type: Optional[str] = ..., + category: Optional[str] = ..., + dimensions: Optional[list[Dimension]] = ..., + display_description: Optional[str] = ..., + display_name: Optional[str] = ..., + enable_regional_mdm_account: Optional[bool] = ..., + fill_gap_with_zero: Optional[bool] = ..., + internal_metric_name: Optional[str] = ..., + is_internal: Optional[bool] = ..., + name: Optional[str] = ..., + resource_id_dimension_name_override: Optional[str] = ..., + source_mdm_account: Optional[str] = ..., + source_mdm_namespace: Optional[str] = ..., + supported_aggregation_types: Optional[list[Union[str, MetricAggregationType]]] = ..., + supported_time_grain_types: Optional[list[str]] = ..., + unit: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + class azure.mgmt.netapp.models.MirrorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROKEN = "Broken" + MIRRORED = "Mirrored" + UNINITIALIZED = "Uninitialized" - class azure.mgmt.netapp.models.CertificateAkvDetails(_Model): - certificate_key_vault_uri: Optional[str] - certificate_name: Optional[str] - user_assigned_identity: Optional[str] + + class azure.mgmt.netapp.models.MonthlySchedule(_Model): + days_of_month: Optional[str] + hour: Optional[int] + minute: Optional[int] + snapshots_to_keep: Optional[int] + used_bytes: Optional[int] @overload def __init__( self, *, - certificate_key_vault_uri: Optional[str] = ..., - certificate_name: Optional[str] = ..., - user_assigned_identity: Optional[str] = ... + days_of_month: Optional[str] = ..., + hour: Optional[int] = ..., + minute: Optional[int] = ..., + snapshots_to_keep: Optional[int] = ..., + used_bytes: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ChangeKeyVault(_Model): - key_name: str - key_vault_private_endpoints: list[KeyVaultPrivateEndpoint] - key_vault_resource_id: Optional[str] - key_vault_uri: str + class azure.mgmt.netapp.models.MountTargetProperties(_Model): + file_system_id: str + ip_address: Optional[str] + mount_target_id: Optional[str] + smb_server_fqdn: Optional[str] @overload def __init__( self, *, - key_name: str, - key_vault_private_endpoints: list[KeyVaultPrivateEndpoint], - key_vault_resource_id: Optional[str] = ..., - key_vault_uri: str + file_system_id: str, + smb_server_fqdn: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ChangeZoneRequest(_Model): - new_zone: str + class azure.mgmt.netapp.models.MultiAdStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.netapp.models.NetAppAccount(TrackedResource): + etag: Optional[str] + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[AccountProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - new_zone: str + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[AccountProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.CheckAvailabilityResponse(_Model): - is_available: Optional[bool] - message: Optional[str] - reason: Optional[Union[str, InAvailabilityReasonType]] + class azure.mgmt.netapp.models.NetAppAccountPatch(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[AccountPropertiesPatch] + tags: Optional[dict[str, str]] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - is_available: Optional[bool] = ..., - message: Optional[str] = ..., - reason: Optional[Union[str, InAvailabilityReasonType]] = ... + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[AccountPropertiesPatch] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.CheckElasticResourceAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALREADY_EXISTS = "AlreadyExists" - INVALID = "Invalid" + + class azure.mgmt.netapp.models.NetAppProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + MOVING = "Moving" + PATCHING = "Patching" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" - class azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse(_Model): - is_available: Optional[Union[str, CheckElasticResourceAvailabilityStatus]] - message: Optional[str] - reason: Optional[Union[str, CheckElasticResourceAvailabilityReason]] + class azure.mgmt.netapp.models.NetworkFeatures(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASIC = "Basic" + BASIC_STANDARD = "Basic_Standard" + STANDARD = "Standard" + STANDARD_BASIC = "Standard_Basic" + + + class azure.mgmt.netapp.models.NetworkSiblingSet(_Model): + network_features: Optional[Union[str, NetworkFeatures]] + network_sibling_set_id: Optional[str] + network_sibling_set_state_id: Optional[str] + nic_info_list: Optional[list[NicInfo]] + provisioning_state: Optional[Union[str, NetworkSiblingSetProvisioningState]] + subnet_id: Optional[str] @overload def __init__( self, *, - is_available: Optional[Union[str, CheckElasticResourceAvailabilityStatus]] = ..., - message: Optional[str] = ..., - reason: Optional[Union[str, CheckElasticResourceAvailabilityReason]] = ... + network_features: Optional[Union[str, NetworkFeatures]] = ..., + network_sibling_set_id: Optional[str] = ..., + network_sibling_set_state_id: Optional[str] = ..., + nic_info_list: Optional[list[NicInfo]] = ..., + subnet_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CheckElasticResourceAvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FALSE = "False" - TRUE = "True" + class azure.mgmt.netapp.models.NetworkSiblingSetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" - class azure.mgmt.netapp.models.CheckElasticVolumeFilePathAvailabilityRequest(_Model): - file_path: str + class azure.mgmt.netapp.models.NfsUser(_Model): + group_id: Optional[int] + user_id: Optional[int] @overload def __init__( self, *, - file_path: str + group_id: Optional[int] = ..., + user_id: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CheckNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MICROSOFT_NET_APP_NET_APP_ACCOUNTS = "Microsoft.NetApp/netAppAccounts" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_BACKUP_VAULTS_BACKUPS = "Microsoft.NetApp/netAppAccounts/backupVaults/backups" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS = "Microsoft.NetApp/netAppAccounts/capacityPools" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_BACKUPS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" - + class azure.mgmt.netapp.models.NicInfo(_Model): + ip_address: Optional[str] + volume_resource_ids: Optional[list[str]] - class azure.mgmt.netapp.models.CheckQuotaNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MICROSOFT_NET_APP_NET_APP_ACCOUNTS = "Microsoft.NetApp/netAppAccounts" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_BACKUP_VAULTS_BACKUPS = "Microsoft.NetApp/netAppAccounts/backupVaults/backups" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS = "Microsoft.NetApp/netAppAccounts/capacityPools" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_BACKUPS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups" - MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" + @overload + def __init__( + self, + *, + volume_resource_ids: Optional[list[str]] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ChownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - RESTRICTED = "Restricted" - UNRESTRICTED = "Unrestricted" + class azure.mgmt.netapp.models.OnCertificateConflictAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAIL = "Fail" + UPDATE = "Update" - class azure.mgmt.netapp.models.CifsChangeNotifyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.Operation(_Model): + display: Optional[OperationDisplay] + name: Optional[str] + origin: Optional[str] + properties: Optional[OperationProperties] - class azure.mgmt.netapp.models.CifsUser(_Model): - username: Optional[str] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - username: Optional[str] = ... + display: Optional[OperationDisplay] = ..., + name: Optional[str] = ..., + origin: Optional[str] = ..., + properties: Optional[OperationProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.ClusterPeerCommandResponse(_Model): - properties: Optional[ClusterPeerCommandResponseProperties] + class azure.mgmt.netapp.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] @overload def __init__( self, *, - properties: Optional[ClusterPeerCommandResponseProperties] = ... + description: Optional[str] = ..., + operation: Optional[str] = ..., + provider: Optional[str] = ..., + resource: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ClusterPeerCommandResponseProperties(_Model): - cluster_peering_command: Optional[str] - passphrase: Optional[str] + class azure.mgmt.netapp.models.OperationProperties(_Model): + service_specification: Optional[ServiceSpecification] @overload def __init__( self, *, - cluster_peering_command: Optional[str] = ..., - passphrase: Optional[str] = ... + service_specification: Optional[ServiceSpecification] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CoolAccessRetrievalPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "Default" - NEVER = "Never" - ON_READ = "OnRead" - - - class azure.mgmt.netapp.models.CoolAccessTieringPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "Auto" - SNAPSHOT_ONLY = "SnapshotOnly" - - - class azure.mgmt.netapp.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - APPLICATION = "Application" - KEY = "Key" - MANAGED_IDENTITY = "ManagedIdentity" - USER = "User" - - - class azure.mgmt.netapp.models.CredentialsAkvDetails(_Model): - credentials_key_vault_uri: Optional[str] - secret_name: Optional[str] - user_assigned_identity: Optional[str] + class azure.mgmt.netapp.models.OriginClusterInformation(_Model): + peer_addresses: list[str] + peer_cluster_name: str + peer_volume_name: str + peer_vserver_name: str @overload def __init__( self, *, - credentials_key_vault_uri: Optional[str] = ..., - secret_name: Optional[str] = ..., - user_assigned_identity: Optional[str] = ... + peer_addresses: list[str], + peer_cluster_name: str, + peer_volume_name: str, + peer_vserver_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.CredentialsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "Active" - CREDENTIALS_EXPIRED = "CredentialsExpired" - NO_CREDENTIALS_SET = "NoCredentialsSet" - - - class azure.mgmt.netapp.models.DailySchedule(_Model): - hour: Optional[int] - minute: Optional[int] - snapshots_to_keep: Optional[int] - used_bytes: Optional[int] + class azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest(_Model): + peer_ip_addresses: list[str] @overload def __init__( self, *, - hour: Optional[int] = ..., - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ..., - used_bytes: Optional[int] = ... + peer_ip_addresses: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FRIDAY = "Friday" - MONDAY = "Monday" - SATURDAY = "Saturday" - SUNDAY = "Sunday" - THURSDAY = "Thursday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" - - - class azure.mgmt.netapp.models.DesiredRansomwareProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.DestinationReplication(_Model): - region: Optional[str] - replication_type: Optional[Union[str, ReplicationType]] - resource_id: Optional[str] - zone: Optional[str] + class azure.mgmt.netapp.models.PeeringPassphrases(_Model): + cluster_peering_command: str + cluster_peering_passphrase: str + critical_warning: Optional[str] + vserver_peering_command: str @overload def __init__( self, *, - region: Optional[str] = ..., - replication_type: Optional[Union[str, ReplicationType]] = ..., - resource_id: Optional[str] = ..., - zone: Optional[str] = ... + cluster_peering_command: str, + cluster_peering_passphrase: str, + vserver_peering_command: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.Dimension(_Model): - display_name: Optional[str] - name: Optional[str] + class azure.mgmt.netapp.models.PlacementKeyValuePairs(_Model): + key: str + value: str @overload def __init__( self, *, - display_name: Optional[str] = ..., - name: Optional[str] = ... + key: str, + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticAccount(TrackedResource): - e_tag: Optional[str] - id: str - identity: Optional[ManagedServiceIdentity] - location: str - name: str - properties: Optional[ElasticAccountProperties] - system_data: SystemData - tags: dict[str, str] - type: str + class azure.mgmt.netapp.models.PoolChangeRequest(_Model): + new_pool_resource_id: str @overload def __init__( self, *, - identity: Optional[ManagedServiceIdentity] = ..., - location: str, - properties: Optional[ElasticAccountProperties] = ..., - tags: Optional[dict[str, str]] = ... + new_pool_resource_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticAccountProperties(_Model): - encryption: Optional[ElasticEncryption] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] + class azure.mgmt.netapp.models.PoolPatchProperties(_Model): + cool_access: Optional[bool] + custom_throughput_mibps: Optional[int] + qos_type: Optional[Union[str, QosType]] + size: Optional[int] @overload def __init__( self, *, - encryption: Optional[ElasticEncryption] = ... + cool_access: Optional[bool] = ..., + custom_throughput_mibps: Optional[int] = ..., + qos_type: Optional[Union[str, QosType]] = ..., + size: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticAccountUpdate(_Model): - identity: Optional[ManagedServiceIdentity] - properties: Optional[ElasticAccountUpdateProperties] - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.PoolProperties(_Model): + cool_access: Optional[bool] + custom_throughput_mibps: Optional[int] + encryption_type: Optional[Union[str, EncryptionType]] + pool_id: Optional[str] + provisioning_state: Optional[str] + qos_type: Optional[Union[str, QosType]] + service_level: Union[str, ServiceLevel] + size: int + total_throughput_mibps: Optional[float] + utilized_throughput_mibps: Optional[float] @overload def __init__( self, *, - identity: Optional[ManagedServiceIdentity] = ..., - properties: Optional[ElasticAccountUpdateProperties] = ..., - tags: Optional[dict[str, str]] = ... + cool_access: Optional[bool] = ..., + custom_throughput_mibps: Optional[int] = ..., + encryption_type: Optional[Union[str, EncryptionType]] = ..., + qos_type: Optional[Union[str, QosType]] = ..., + service_level: Union[str, ServiceLevel], + size: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticAccountUpdateProperties(_Model): - encryption: Optional[ElasticEncryption] + class azure.mgmt.netapp.models.ProtocolTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NF_SV3 = "NFSv3" + NF_SV4 = "NFSv4" + SMB = "SMB" + + + class azure.mgmt.netapp.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.netapp.models.QosType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "Auto" + MANUAL = "Manual" + + + class azure.mgmt.netapp.models.QueryNetworkSiblingSetRequest(_Model): + network_sibling_set_id: str + subnet_id: str @overload def __init__( self, *, - encryption: Optional[ElasticEncryption] = ... + network_sibling_set_id: str, + subnet_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackup(ProxyResource): - id: str + class azure.mgmt.netapp.models.QuotaAvailabilityRequest(_Model): name: str - properties: Optional[ElasticBackupProperties] - system_data: SystemData - type: str + resource_group: str + type: Union[str, CheckQuotaNameResourceTypes] @overload def __init__( self, *, - properties: Optional[ElasticBackupProperties] = ... + name: str, + resource_group: str, + type: Union[str, CheckQuotaNameResourceTypes] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupPolicy(TrackedResource): - e_tag: Optional[str] + class azure.mgmt.netapp.models.QuotaItem(ProxyResource): id: str - location: str name: str - properties: Optional[ElasticBackupPolicyProperties] + properties: Optional[QuotaItemProperties] system_data: SystemData - tags: dict[str, str] type: str + def __getattr__(self, name: str) -> Any: ... + @overload def __init__( self, *, - location: str, - properties: Optional[ElasticBackupPolicyProperties] = ..., - tags: Optional[dict[str, str]] = ... + properties: Optional[QuotaItemProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupPolicyProperties(_Model): - assigned_volumes_count: Optional[int] - daily_backups_to_keep: Optional[int] - monthly_backups_to_keep: Optional[int] - policy_state: Optional[Union[str, ElasticBackupPolicyState]] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - weekly_backups_to_keep: Optional[int] + + class azure.mgmt.netapp.models.QuotaItemProperties(_Model): + current: Optional[int] + default: Optional[int] + usage: Optional[int] + + + class azure.mgmt.netapp.models.QuotaReport(_Model): + is_derived_quota: Optional[bool] + percentage_used: Optional[float] + quota_limit_total_in_ki_bs: Optional[int] + quota_limit_used_in_ki_bs: Optional[int] + quota_target: Optional[str] + quota_type: Optional[Union[str, QuotaType]] @overload def __init__( self, *, - daily_backups_to_keep: Optional[int] = ..., - monthly_backups_to_keep: Optional[int] = ..., - policy_state: Optional[Union[str, ElasticBackupPolicyState]] = ..., - weekly_backups_to_keep: Optional[int] = ... + is_derived_quota: Optional[bool] = ..., + percentage_used: Optional[float] = ..., + quota_limit_total_in_ki_bs: Optional[int] = ..., + quota_limit_used_in_ki_bs: Optional[int] = ..., + quota_target: Optional[str] = ..., + quota_type: Optional[Union[str, QuotaType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.ElasticBackupPolicyUpdate(_Model): - properties: Optional[ElasticBackupPolicyUpdateProperties] - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.QuotaReportFilterRequest(_Model): + quota_target: Optional[str] + quota_type: Optional[Union[str, QuotaType]] + usage_threshold_percentage: Optional[int] @overload def __init__( self, *, - properties: Optional[ElasticBackupPolicyUpdateProperties] = ..., - tags: Optional[dict[str, str]] = ... + quota_target: Optional[str] = ..., + quota_type: Optional[Union[str, QuotaType]] = ..., + usage_threshold_percentage: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupPolicyUpdateProperties(_Model): - daily_backups_to_keep: Optional[int] - monthly_backups_to_keep: Optional[int] - policy_state: Optional[Union[str, ElasticBackupPolicyState]] - weekly_backups_to_keep: Optional[int] + class azure.mgmt.netapp.models.QuotaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT_GROUP_QUOTA = "DefaultGroupQuota" + DEFAULT_USER_QUOTA = "DefaultUserQuota" + INDIVIDUAL_GROUP_QUOTA = "IndividualGroupQuota" + INDIVIDUAL_USER_QUOTA = "IndividualUserQuota" + + + class azure.mgmt.netapp.models.RansomwareProtectionPatchSettings(_Model): + desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] @overload def __init__( self, *, - daily_backups_to_keep: Optional[int] = ..., - monthly_backups_to_keep: Optional[int] = ..., - policy_state: Optional[Union[str, ElasticBackupPolicyState]] = ..., - weekly_backups_to_keep: Optional[int] = ... + desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupProperties(_Model): - backup_type: Optional[Union[str, ElasticBackupType]] - completion_date: Optional[datetime] - creation_date: Optional[datetime] - elastic_backup_policy_resource_id: Optional[str] - elastic_snapshot_resource_id: Optional[str] - elastic_volume_resource_id: str - failure_reason: Optional[str] - label: Optional[str] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - size: Optional[int] - snapshot_creation_date: Optional[datetime] - snapshot_usage: Optional[Union[str, SnapshotUsage]] - volume_size: Optional[Union[str, VolumeSize]] + class azure.mgmt.netapp.models.RansomwareProtectionSettings(_Model): + actual_ransomware_protection_state: Optional[Union[str, ActualRansomwareProtectionState]] + desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] @overload def __init__( self, *, - elastic_snapshot_resource_id: Optional[str] = ..., - elastic_volume_resource_id: str, - label: Optional[str] = ..., - snapshot_usage: Optional[Union[str, SnapshotUsage]] = ... + desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANUAL = "Manual" - SCHEDULED = "Scheduled" - - - class azure.mgmt.netapp.models.ElasticBackupVault(TrackedResource): - e_tag: Optional[str] + class azure.mgmt.netapp.models.RansomwareReport(ProxyResource): id: str - location: str name: str - properties: Optional[ElasticBackupVaultProperties] + properties: Optional[RansomwareReportProperties] system_data: SystemData - tags: dict[str, str] type: str @overload def __init__( self, *, - location: str, - properties: Optional[ElasticBackupVaultProperties] = ..., - tags: Optional[dict[str, str]] = ... + properties: Optional[RansomwareReportProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticBackupVaultProperties(_Model): - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - - - class azure.mgmt.netapp.models.ElasticBackupVaultUpdate(_Model): - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.RansomwareReportProperties(_Model): + cleared_count: Optional[int] + event_time: Optional[datetime] + provisioning_state: Optional[str] + reported_count: Optional[int] + severity: Optional[Union[str, RansomwareReportSeverity]] + state: Optional[Union[str, RansomwareReportState]] + suspects: Optional[list[RansomwareSuspects]] + + + class azure.mgmt.netapp.models.RansomwareReportSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "High" + LOW = "Low" + MODERATE = "Moderate" + NONE = "None" + + + class azure.mgmt.netapp.models.RansomwareReportState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + RESOLVED = "Resolved" + + + class azure.mgmt.netapp.models.RansomwareSuspectResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FALSE_POSITIVE = "FalsePositive" + POTENTIAL_THREAT = "PotentialThreat" + + + class azure.mgmt.netapp.models.RansomwareSuspects(_Model): + extension: Optional[str] + file_count: Optional[int] + resolution: Optional[Union[str, RansomwareSuspectResolution]] + suspect_files: Optional[list[SuspectFile]] + + + class azure.mgmt.netapp.models.RansomwareSuspectsClearRequest(_Model): + extensions: list[str] + resolution: Union[str, RansomwareSuspectResolution] @overload def __init__( self, *, - tags: Optional[dict[str, str]] = ... + extensions: list[str], + resolution: Union[str, RansomwareSuspectResolution] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticCapacityPool(TrackedResource): - e_tag: Optional[str] - id: str - location: str - name: str - properties: Optional[ElasticCapacityPoolProperties] - system_data: SystemData - tags: dict[str, str] - type: str - zones: Optional[list[str]] + class azure.mgmt.netapp.models.ReestablishReplicationRequest(_Model): + source_volume_id: Optional[str] @overload def __init__( self, *, - location: str, - properties: Optional[ElasticCapacityPoolProperties] = ..., - tags: Optional[dict[str, str]] = ..., - zones: Optional[list[str]] = ... + source_volume_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticCapacityPoolProperties(_Model): - active_directory_config_resource_id: Optional[str] - availability_status: Optional[Union[str, ElasticResourceAvailabilityStatus]] - current_zone: Optional[str] - encryption: Optional[ElasticEncryptionConfiguration] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - service_level: Union[str, ElasticServiceLevel] - size: int - subnet_resource_id: str - total_throughput_mibps: Optional[float] + class azure.mgmt.netapp.models.RegionInfo(_Model): + availability_zone_mappings: Optional[list[RegionInfoAvailabilityZoneMappingsItem]] + storage_to_network_proximity: Optional[Union[str, RegionStorageToNetworkProximity]] @overload def __init__( self, *, - active_directory_config_resource_id: Optional[str] = ..., - encryption: Optional[ElasticEncryptionConfiguration] = ..., - service_level: Union[str, ElasticServiceLevel], - size: int, - subnet_resource_id: str + availability_zone_mappings: Optional[list[RegionInfoAvailabilityZoneMappingsItem]] = ..., + storage_to_network_proximity: Optional[Union[str, RegionStorageToNetworkProximity]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticCapacityPoolUpdate(_Model): - properties: Optional[ElasticCapacityPoolUpdateProperties] - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.RegionInfoAvailabilityZoneMappingsItem(_Model): + availability_zone: Optional[str] + is_available: Optional[bool] @overload def __init__( self, *, - properties: Optional[ElasticCapacityPoolUpdateProperties] = ..., - tags: Optional[dict[str, str]] = ... + availability_zone: Optional[str] = ..., + is_available: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticCapacityPoolUpdateProperties(_Model): - active_directory_config_resource_id: Optional[str] - encryption: Optional[ElasticEncryptionConfiguration] - size: Optional[int] + class azure.mgmt.netapp.models.RegionInfoResource(ProxyResource): + id: str + name: str + properties: Optional[RegionInfo] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - active_directory_config_resource_id: Optional[str] = ..., - encryption: Optional[ElasticEncryptionConfiguration] = ..., - size: Optional[int] = ... + properties: Optional[RegionInfo] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.ElasticEncryption(_Model): - identity: Optional[ElasticEncryptionIdentity] - key_source: Optional[Union[str, KeySource]] - key_vault_properties: Optional[ElasticKeyVaultProperties] + class azure.mgmt.netapp.models.RegionStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACROSS_T2 = "AcrossT2" + DEFAULT = "Default" + T1 = "T1" + T1_AND_ACROSS_T2 = "T1AndAcrossT2" + T1_AND_T2 = "T1AndT2" + T1_AND_T2_AND_ACROSS_T2 = "T1AndT2AndAcrossT2" + T2 = "T2" + T2_AND_ACROSS_T2 = "T2AndAcrossT2" + + + class azure.mgmt.netapp.models.RelocateVolumeRequest(_Model): + creation_token: Optional[str] @overload def __init__( self, *, - identity: Optional[ElasticEncryptionIdentity] = ..., - key_source: Optional[Union[str, KeySource]] = ..., - key_vault_properties: Optional[ElasticKeyVaultProperties] = ... + creation_token: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticEncryptionConfiguration(_Model): - elastic_pool_encryption_key_source: Union[str, ElasticPoolEncryptionKeySource] - key_vault_private_endpoint_resource_id: str + class azure.mgmt.netapp.models.RemotePath(_Model): + external_host_name: str + server_name: str + volume_name: str @overload def __init__( self, *, - elastic_pool_encryption_key_source: Union[str, ElasticPoolEncryptionKeySource], - key_vault_private_endpoint_resource_id: str + external_host_name: str, + server_name: str, + volume_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticEncryptionIdentity(_Model): - federated_client_id: Optional[str] - principal_id: Optional[str] - user_assigned_identity: Optional[str] + class azure.mgmt.netapp.models.Replication(_Model): + endpoint_type: Optional[Union[str, EndpointType]] + mirror_state: Optional[Union[str, ReplicationMirrorState]] + remote_volume_region: Optional[str] + remote_volume_resource_id: Optional[str] + replication_creation_time: Optional[datetime] + replication_deletion_time: Optional[datetime] + replication_id: Optional[str] + replication_schedule: Optional[Union[str, ReplicationSchedule]] @overload def __init__( self, *, - federated_client_id: Optional[str] = ..., - user_assigned_identity: Optional[str] = ... + endpoint_type: Optional[Union[str, EndpointType]] = ..., + remote_volume_region: Optional[str] = ..., + remote_volume_resource_id: Optional[str] = ..., + replication_schedule: Optional[Union[str, ReplicationSchedule]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticExportPolicy(_Model): - rules: Optional[list[ElasticExportPolicyRule]] + class azure.mgmt.netapp.models.ReplicationMirrorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROKEN = "Broken" + MIRRORED = "Mirrored" + UNINITIALIZED = "Uninitialized" + + + class azure.mgmt.netapp.models.ReplicationObject(_Model): + destination_replications: Optional[list[DestinationReplication]] + endpoint_type: Optional[Union[str, EndpointType]] + external_replication_setup_info: Optional[str] + external_replication_setup_status: Optional[Union[str, ExternalReplicationSetupStatus]] + mirror_state: Optional[Union[str, MirrorState]] + relationship_status: Optional[Union[str, VolumeReplicationRelationshipStatus]] + remote_path: Optional[RemotePath] + remote_volume_region: Optional[str] + remote_volume_resource_id: Optional[str] + replication_id: Optional[str] + replication_schedule: Optional[Union[str, ReplicationSchedule]] @overload def __init__( self, *, - rules: Optional[list[ElasticExportPolicyRule]] = ... + remote_path: Optional[RemotePath] = ..., + remote_volume_region: Optional[str] = ..., + remote_volume_resource_id: Optional[str] = ..., + replication_schedule: Optional[Union[str, ReplicationSchedule]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticExportPolicyRule(_Model): - allowed_clients: Optional[list[str]] - nfsv3: Optional[Union[str, ElasticNfsv3Access]] - nfsv4: Optional[Union[str, ElasticNfsv4Access]] - root_access: Optional[Union[str, ElasticRootAccess]] - rule_index: Optional[int] - unix_access_rule: Optional[Union[str, ElasticUnixAccessRule]] + class azure.mgmt.netapp.models.ReplicationSchedule(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "daily" + ENUM_10_MINUTELY = "_10minutely" + HOURLY = "hourly" + + + class azure.mgmt.netapp.models.ReplicationStatus(_Model): + error_message: Optional[str] + healthy: Optional[bool] + mirror_state: Optional[Union[str, MirrorState]] + relationship_status: Optional[Union[str, VolumeReplicationRelationshipStatus]] + total_progress: Optional[str] @overload def __init__( self, *, - allowed_clients: Optional[list[str]] = ..., - nfsv3: Optional[Union[str, ElasticNfsv3Access]] = ..., - nfsv4: Optional[Union[str, ElasticNfsv4Access]] = ..., - root_access: Optional[Union[str, ElasticRootAccess]] = ..., - rule_index: Optional[int] = ..., - unix_access_rule: Optional[Union[str, ElasticUnixAccessRule]] = ... + error_message: Optional[str] = ..., + healthy: Optional[bool] = ..., + mirror_state: Optional[Union[str, MirrorState]] = ..., + relationship_status: Optional[Union[str, VolumeReplicationRelationshipStatus]] = ..., + total_progress: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticKeyVaultProperties(_Model): - key_name: Optional[str] - key_vault_resource_id: Optional[str] - key_vault_uri: Optional[str] - status: Optional[Union[str, ElasticKeyVaultStatus]] + class azure.mgmt.netapp.models.ReplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CROSS_REGION_REPLICATION = "CrossRegionReplication" + CROSS_ZONE_REPLICATION = "CrossZoneReplication" + + + class azure.mgmt.netapp.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.netapp.models.ResourceNameAvailabilityRequest(_Model): + name: str + resource_group: str + type: Union[str, CheckNameResourceTypes] @overload def __init__( self, *, - key_name: Optional[str] = ..., - key_vault_resource_id: Optional[str] = ..., - key_vault_uri: Optional[str] = ... + name: str, + resource_group: str, + type: Union[str, CheckNameResourceTypes] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticKeyVaultStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATED = "Created" - DELETED = "Deleted" - ERROR = "Error" - IN_USE = "InUse" - UPDATING = "Updating" - - - class azure.mgmt.netapp.models.ElasticMountTargetProperties(_Model): - ip_address: Optional[str] - smb_server_fqdn: Optional[str] + class azure.mgmt.netapp.models.RestoreStatus(_Model): + error_message: Optional[str] + healthy: Optional[bool] + mirror_state: Optional[Union[str, MirrorState]] + relationship_status: Optional[Union[str, VolumeRestoreRelationshipStatus]] + total_transfer_bytes: Optional[int] + unhealthy_reason: Optional[str] - class azure.mgmt.netapp.models.ElasticNfsv3Access(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.SecureLdapType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LDAP_OVER_TLS = "LdapOverTLS" + NONE = "None" - class azure.mgmt.netapp.models.ElasticNfsv4Access(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.SecurityStyle(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NTFS = "ntfs" + UNIX = "unix" - class azure.mgmt.netapp.models.ElasticPoolEncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - KEY_VAULT = "KeyVault" - NET_APP = "NetApp" + class azure.mgmt.netapp.models.ServiceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FLEXIBLE = "Flexible" + PREMIUM = "Premium" + STANDARD = "Standard" + STANDARD_ZRS = "StandardZRS" + ULTRA = "Ultra" - class azure.mgmt.netapp.models.ElasticProtocolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NF_SV3 = "NFSv3" - NF_SV4 = "NFSv4" - SMB = "SMB" + class azure.mgmt.netapp.models.ServiceSpecification(_Model): + log_specifications: Optional[list[LogSpecification]] + metric_specifications: Optional[list[MetricSpecification]] + @overload + def __init__( + self, + *, + log_specifications: Optional[list[LogSpecification]] = ..., + metric_specifications: Optional[list[MetricSpecification]] = ... + ) -> None: ... - class azure.mgmt.netapp.models.ElasticResourceAvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OFFLINE = "Offline" - ONLINE = "Online" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticRootAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.mgmt.netapp.models.SmbAccessBasedEnumeration(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" ENABLED = "Enabled" - class azure.mgmt.netapp.models.ElasticServiceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ZONE_REDUNDANT = "ZoneRedundant" + class azure.mgmt.netapp.models.SmbEncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" - class azure.mgmt.netapp.models.ElasticSmbEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.mgmt.netapp.models.SmbNonBrowsable(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" ENABLED = "Enabled" - class azure.mgmt.netapp.models.ElasticSmbPatchProperties(_Model): - smb_encryption: Optional[Union[str, ElasticSmbEncryption]] + class azure.mgmt.netapp.models.SmbSettings(_Model): + smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] + smb_encryption: Optional[Union[str, SmbEncryptionState]] + smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] @overload def __init__( self, *, - smb_encryption: Optional[Union[str, ElasticSmbEncryption]] = ... + smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] = ..., + smb_encryption: Optional[Union[str, SmbEncryptionState]] = ..., + smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticSmbProperties(_Model): - smb_encryption: Optional[Union[str, ElasticSmbEncryption]] - - @overload - def __init__( - self, - *, - smb_encryption: Optional[Union[str, ElasticSmbEncryption]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.ElasticSnapshot(ProxyResource): + class azure.mgmt.netapp.models.Snapshot(ProxyResource): id: str + location: str name: str - properties: Optional[ElasticSnapshotProperties] + properties: Optional[SnapshotProperties] system_data: SystemData type: str + def __getattr__(self, name: str) -> Any: ... + @overload def __init__( self, *, - properties: Optional[ElasticSnapshotProperties] = ... + location: str, + properties: Optional[SnapshotProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.SnapshotPatch(_Model): + - class azure.mgmt.netapp.models.ElasticSnapshotPolicy(TrackedResource): - e_tag: Optional[str] + class azure.mgmt.netapp.models.SnapshotPolicy(TrackedResource): + etag: Optional[str] id: str location: str name: str - properties: Optional[ElasticSnapshotPolicyProperties] + properties: SnapshotPolicyProperties system_data: SystemData tags: dict[str, str] type: str + def __getattr__(self, name: str) -> Any: ... + @overload def __init__( self, *, location: str, - properties: Optional[ElasticSnapshotPolicyProperties] = ..., + properties: SnapshotPolicyProperties, tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.netapp.models.ElasticSnapshotPolicyDailySchedule(_Model): - hour: Optional[int] - minute: Optional[int] - snapshots_to_keep: Optional[int] - - @overload - def __init__( + def __setattr__( self, - *, - hour: Optional[int] = ..., - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ... + key: str, + value: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.netapp.models.SnapshotPolicyPatch(_Model): + id: Optional[str] + location: Optional[str] + name: Optional[str] + properties: Optional[SnapshotPolicyProperties] + tags: Optional[dict[str, str]] + type: Optional[str] - class azure.mgmt.netapp.models.ElasticSnapshotPolicyHourlySchedule(_Model): - minute: Optional[int] - snapshots_to_keep: Optional[int] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ... + location: Optional[str] = ..., + properties: Optional[SnapshotPolicyProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.ElasticSnapshotPolicyMonthlySchedule(_Model): - days_of_month: Optional[list[int]] - hour: Optional[int] - minute: Optional[int] - snapshots_to_keep: Optional[int] + class azure.mgmt.netapp.models.SnapshotPolicyProperties(_Model): + daily_schedule: Optional[DailySchedule] + enabled: Optional[bool] + hourly_schedule: Optional[HourlySchedule] + monthly_schedule: Optional[MonthlySchedule] + provisioning_state: Optional[str] + weekly_schedule: Optional[WeeklySchedule] @overload def __init__( self, *, - days_of_month: Optional[list[int]] = ..., - hour: Optional[int] = ..., - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ... + daily_schedule: Optional[DailySchedule] = ..., + enabled: Optional[bool] = ..., + hourly_schedule: Optional[HourlySchedule] = ..., + monthly_schedule: Optional[MonthlySchedule] = ..., + weekly_schedule: Optional[WeeklySchedule] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticSnapshotPolicyProperties(_Model): - daily_schedule: Optional[ElasticSnapshotPolicyDailySchedule] - hourly_schedule: Optional[ElasticSnapshotPolicyHourlySchedule] - monthly_schedule: Optional[ElasticSnapshotPolicyMonthlySchedule] - policy_status: Optional[Union[str, PolicyStatus]] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - weekly_schedule: Optional[ElasticSnapshotPolicyWeeklySchedule] + class azure.mgmt.netapp.models.SnapshotPolicyVolumeList(_Model): + next_link: Optional[str] + value: list[Volume] @overload def __init__( self, *, - daily_schedule: Optional[ElasticSnapshotPolicyDailySchedule] = ..., - hourly_schedule: Optional[ElasticSnapshotPolicyHourlySchedule] = ..., - monthly_schedule: Optional[ElasticSnapshotPolicyMonthlySchedule] = ..., - policy_status: Optional[Union[str, PolicyStatus]] = ..., - weekly_schedule: Optional[ElasticSnapshotPolicyWeeklySchedule] = ... + next_link: Optional[str] = ..., + value: list[Volume] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdate(_Model): - properties: Optional[ElasticSnapshotPolicyUpdateProperties] - tags: Optional[dict[str, str]] + class azure.mgmt.netapp.models.SnapshotProperties(_Model): + created: Optional[datetime] + provisioning_state: Optional[str] + snapshot_id: Optional[str] + + + class azure.mgmt.netapp.models.SnapshotRestoreFiles(_Model): + destination_path: Optional[str] + file_paths: list[str] @overload def __init__( self, *, - properties: Optional[ElasticSnapshotPolicyUpdateProperties] = ..., - tags: Optional[dict[str, str]] = ... + destination_path: Optional[str] = ..., + file_paths: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdateProperties(_Model): - daily_schedule: Optional[ElasticSnapshotPolicyDailySchedule] - hourly_schedule: Optional[ElasticSnapshotPolicyHourlySchedule] - monthly_schedule: Optional[ElasticSnapshotPolicyMonthlySchedule] - policy_status: Optional[Union[str, PolicyStatus]] - weekly_schedule: Optional[ElasticSnapshotPolicyWeeklySchedule] + class azure.mgmt.netapp.models.SubvolumeInfo(ProxyResource): + id: str + name: str + properties: Optional[SubvolumeProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - daily_schedule: Optional[ElasticSnapshotPolicyDailySchedule] = ..., - hourly_schedule: Optional[ElasticSnapshotPolicyHourlySchedule] = ..., - monthly_schedule: Optional[ElasticSnapshotPolicyMonthlySchedule] = ..., - policy_status: Optional[Union[str, PolicyStatus]] = ..., - weekly_schedule: Optional[ElasticSnapshotPolicyWeeklySchedule] = ... + properties: Optional[SubvolumeProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.ElasticSnapshotPolicyWeeklySchedule(_Model): - days: Optional[list[Union[str, DayOfWeek]]] - hour: Optional[int] - minute: Optional[int] - snapshots_to_keep: Optional[int] + class azure.mgmt.netapp.models.SubvolumeModel(_Model): + id: Optional[str] + name: Optional[str] + properties: Optional[SubvolumeModelProperties] + type: Optional[str] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - days: Optional[list[Union[str, DayOfWeek]]] = ..., - hour: Optional[int] = ..., - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ... + properties: Optional[SubvolumeModelProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.netapp.models.ElasticSnapshotProperties(_Model): - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - - - class azure.mgmt.netapp.models.ElasticUnixAccessRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NO_ACCESS = "NoAccess" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.ElasticVolume(TrackedResource): - e_tag: Optional[str] - id: str - location: str - name: str - properties: Optional[ElasticVolumeProperties] - system_data: SystemData - tags: dict[str, str] - type: str - zones: Optional[list[str]] + class azure.mgmt.netapp.models.SubvolumeModelProperties(_Model): + accessed_time_stamp: Optional[datetime] + bytes_used: Optional[int] + changed_time_stamp: Optional[datetime] + creation_time_stamp: Optional[datetime] + modified_time_stamp: Optional[datetime] + parent_path: Optional[str] + path: Optional[str] + permissions: Optional[str] + provisioning_state: Optional[str] + size: Optional[int] @overload def __init__( self, *, - location: str, - properties: Optional[ElasticVolumeProperties] = ..., - tags: Optional[dict[str, str]] = ..., - zones: Optional[list[str]] = ... + accessed_time_stamp: Optional[datetime] = ..., + bytes_used: Optional[int] = ..., + changed_time_stamp: Optional[datetime] = ..., + creation_time_stamp: Optional[datetime] = ..., + modified_time_stamp: Optional[datetime] = ..., + parent_path: Optional[str] = ..., + path: Optional[str] = ..., + permissions: Optional[str] = ..., + provisioning_state: Optional[str] = ..., + size: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumeBackupProperties(_Model): - elastic_backup_policy_resource_id: Optional[str] - elastic_backup_vault_resource_id: Optional[str] - policy_enforcement: Optional[Union[str, ElasticVolumePolicyEnforcement]] + class azure.mgmt.netapp.models.SubvolumePatchParams(_Model): + path: Optional[str] + size: Optional[int] @overload def __init__( self, *, - elastic_backup_policy_resource_id: Optional[str] = ..., - elastic_backup_vault_resource_id: Optional[str] = ..., - policy_enforcement: Optional[Union[str, ElasticVolumePolicyEnforcement]] = ... + path: Optional[str] = ..., + size: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumeDataProtectionPatchProperties(_Model): - backup: Optional[ElasticVolumeBackupProperties] - snapshot: Optional[ElasticVolumeSnapshotProperties] + class azure.mgmt.netapp.models.SubvolumePatchRequest(_Model): + properties: Optional[SubvolumePatchParams] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - backup: Optional[ElasticVolumeBackupProperties] = ..., - snapshot: Optional[ElasticVolumeSnapshotProperties] = ... + properties: Optional[SubvolumePatchParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.ElasticVolumeDataProtectionProperties(_Model): - backup: Optional[ElasticVolumeBackupProperties] - snapshot: Optional[ElasticVolumeSnapshotProperties] + class azure.mgmt.netapp.models.SubvolumeProperties(_Model): + parent_path: Optional[str] + path: Optional[str] + provisioning_state: Optional[str] + size: Optional[int] @overload def __init__( self, *, - backup: Optional[ElasticVolumeBackupProperties] = ..., - snapshot: Optional[ElasticVolumeSnapshotProperties] = ... + parent_path: Optional[str] = ..., + path: Optional[str] = ..., + size: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumePolicyEnforcement(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ENFORCED = "Enforced" - NOT_ENFORCED = "NotEnforced" + class azure.mgmt.netapp.models.SuspectFile(_Model): + file_timestamp: Optional[datetime] + suspect_file_name: Optional[str] - class azure.mgmt.netapp.models.ElasticVolumeProperties(_Model): - availability_status: Optional[Union[str, ElasticResourceAvailabilityStatus]] - backup_resource_id: Optional[str] - data_protection: Optional[ElasticVolumeDataProtectionProperties] - export_policy: Optional[ElasticExportPolicy] - file_path: str - mount_targets: Optional[list[ElasticMountTargetProperties]] - protocol_types: list[Union[str, ElasticProtocolType]] - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - restoration_state: Optional[Union[str, ElasticVolumeRestorationState]] - size: int - smb_properties: Optional[ElasticSmbProperties] - snapshot_directory_visibility: Optional[Union[str, SnapshotDirectoryVisibility]] - snapshot_resource_id: Optional[str] + class azure.mgmt.netapp.models.SvmPeerCommandResponse(_Model): + properties: Optional[SvmPeerCommandResponseProperties] @overload def __init__( self, *, - backup_resource_id: Optional[str] = ..., - data_protection: Optional[ElasticVolumeDataProtectionProperties] = ..., - export_policy: Optional[ElasticExportPolicy] = ..., - file_path: str, - protocol_types: list[Union[str, ElasticProtocolType]], - size: int, - smb_properties: Optional[ElasticSmbProperties] = ..., - snapshot_directory_visibility: Optional[Union[str, SnapshotDirectoryVisibility]] = ..., - snapshot_resource_id: Optional[str] = ... + properties: Optional[SvmPeerCommandResponseProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumeRestorationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "Failed" - RESTORED = "Restored" - RESTORING = "Restoring" - - - class azure.mgmt.netapp.models.ElasticVolumeRevert(_Model): - snapshot_resource_id: Optional[str] + class azure.mgmt.netapp.models.SvmPeerCommandResponseProperties(_Model): + svm_peering_command: Optional[str] @overload def __init__( self, *, - snapshot_resource_id: Optional[str] = ... + svm_peering_command: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumeSnapshotProperties(_Model): - snapshot_policy_resource_id: Optional[str] + class azure.mgmt.netapp.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] @overload def __init__( self, *, - snapshot_policy_resource_id: Optional[str] = ... + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumeUpdate(_Model): - properties: Optional[ElasticVolumeUpdateProperties] + class azure.mgmt.netapp.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData tags: Optional[dict[str, str]] + type: str @overload def __init__( self, *, - properties: Optional[ElasticVolumeUpdateProperties] = ..., + location: str, tags: Optional[dict[str, str]] = ... ) -> None: ... @@ -6244,318 +6043,372 @@ namespace azure.mgmt.netapp.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ElasticVolumeUpdateProperties(_Model): - data_protection: Optional[ElasticVolumeDataProtectionPatchProperties] - export_policy: Optional[ElasticExportPolicy] - size: Optional[int] - smb_properties: Optional[ElasticSmbPatchProperties] - snapshot_directory_visibility: Optional[Union[str, SnapshotDirectoryVisibility]] + class azure.mgmt.netapp.models.UpdateNetworkSiblingSetRequest(_Model): + network_features: Union[str, NetworkFeatures] + network_sibling_set_id: str + network_sibling_set_state_id: str + subnet_id: str @overload def __init__( self, *, - data_protection: Optional[ElasticVolumeDataProtectionPatchProperties] = ..., - export_policy: Optional[ElasticExportPolicy] = ..., - size: Optional[int] = ..., - smb_properties: Optional[ElasticSmbPatchProperties] = ..., - snapshot_directory_visibility: Optional[Union[str, SnapshotDirectoryVisibility]] = ... + network_features: Union[str, NetworkFeatures], + network_sibling_set_id: str, + network_sibling_set_state_id: str, + subnet_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.EnableSubvolumes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.UsageName(_Model): + localized_value: Optional[str] + value: Optional[str] - - class azure.mgmt.netapp.models.EnableWriteBackState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.EncryptionIdentity(_Model): - federated_client_id: Optional[str] - principal_id: Optional[str] - user_assigned_identity: Optional[str] - - @overload - def __init__( - self, - *, - federated_client_id: Optional[str] = ..., - user_assigned_identity: Optional[str] = ... - ) -> None: ... + @overload + def __init__( + self, + *, + localized_value: Optional[str] = ..., + value: Optional[str] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.EncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MICROSOFT_KEY_VAULT = "Microsoft.KeyVault" - MICROSOFT_NET_APP = "Microsoft.NetApp" - + class azure.mgmt.netapp.models.UsageProperties(_Model): + current_value: Optional[int] + limit: Optional[int] + unit: Optional[str] - class azure.mgmt.netapp.models.EncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.UsageResult(_Model): + id: Optional[str] + name: Optional[UsageName] + properties: Optional[UsageProperties] - class azure.mgmt.netapp.models.EncryptionTransitionRequest(_Model): - private_endpoint_id: str - virtual_network_id: str + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - private_endpoint_id: str, - virtual_network_id: str + properties: Optional[UsageProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.EncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DOUBLE = "Double" - SINGLE = "Single" + class azure.mgmt.netapp.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] - class azure.mgmt.netapp.models.EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DST = "dst" - SRC = "src" + class azure.mgmt.netapp.models.Volume(TrackedResource): + etag: Optional[str] + id: str + location: str + name: str + properties: VolumeProperties + system_data: SystemData + tags: dict[str, str] + type: str + zones: Optional[list[str]] - class azure.mgmt.netapp.models.EntraIdAkvConfig(_Model): - azure_key_vault_uri: str - certificate_name: str - user_assigned_identity: Optional[str] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - azure_key_vault_uri: str, - certificate_name: str, - user_assigned_identity: Optional[str] = ... + location: str, + properties: VolumeProperties, + tags: Optional[dict[str, str]] = ..., + zones: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.netapp.models.EntraIdAkvConfigPatch(_Model): - azure_key_vault_uri: Optional[str] - certificate_name: Optional[str] - user_assigned_identity: Optional[str] - - @overload - def __init__( + def __setattr__( self, - *, - azure_key_vault_uri: Optional[str] = ..., - certificate_name: Optional[str] = ..., - user_assigned_identity: Optional[str] = ... + key: str, + value: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.netapp.models.EntraIdConfig(_Model): - application_id: str - domain: str - entra_id_akv_config: Optional[EntraIdAkvConfig] - server_name_prefix: str + class azure.mgmt.netapp.models.VolumeBackupProperties(_Model): + backup_policy_id: Optional[str] + backup_vault_id: Optional[str] + policy_enforced: Optional[bool] @overload def __init__( self, *, - application_id: str, - domain: str, - entra_id_akv_config: Optional[EntraIdAkvConfig] = ..., - server_name_prefix: str + backup_policy_id: Optional[str] = ..., + backup_vault_id: Optional[str] = ..., + policy_enforced: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.EntraIdConfigPatch(_Model): - application_id: Optional[str] - domain: Optional[str] - entra_id_akv_config: Optional[EntraIdAkvConfigPatch] - server_name_prefix: Optional[str] + class azure.mgmt.netapp.models.VolumeBackupRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IDLE = "Idle" + TRANSFERRING = "Transferring" + UNKNOWN = "Unknown" + + + class azure.mgmt.netapp.models.VolumeBackups(_Model): + backups_count: Optional[int] + policy_enabled: Optional[bool] + volume_name: Optional[str] + volume_resource_id: Optional[str] @overload def __init__( self, *, - application_id: Optional[str] = ..., - domain: Optional[str] = ..., - entra_id_akv_config: Optional[EntraIdAkvConfigPatch] = ..., - server_name_prefix: Optional[str] = ... + backups_count: Optional[int] = ..., + policy_enabled: Optional[bool] = ..., + volume_name: Optional[str] = ..., + volume_resource_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ErrorAdditionalInfo(_Model): - info: Optional[Any] + class azure.mgmt.netapp.models.VolumeGroup(_Model): + id: Optional[str] + location: Optional[str] + name: Optional[str] + properties: Optional[VolumeGroupListProperties] type: Optional[str] - - class azure.mgmt.netapp.models.ErrorDetail(_Model): - additional_info: Optional[list[ErrorAdditionalInfo]] - code: Optional[str] - details: Optional[list[ErrorDetail]] - message: Optional[str] - target: Optional[str] - - - class azure.mgmt.netapp.models.ErrorResponse(_Model): - error: Optional[ErrorDetail] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - error: Optional[ErrorDetail] = ... + location: Optional[str] = ..., + properties: Optional[VolumeGroupListProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.Exclude(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DELETED = "Deleted" - NONE = "None" + class azure.mgmt.netapp.models.VolumeGroupDetails(ProxyResource): + id: str + location: Optional[str] + name: str + properties: Optional[VolumeGroupProperties] + system_data: SystemData + type: str - class azure.mgmt.netapp.models.ExportPolicyRule(_Model): - allowed_clients: Optional[str] - chown_mode: Optional[Union[str, ChownMode]] - cifs: Optional[bool] - has_root_access: Optional[bool] - kerberos5_i_read_only: Optional[bool] - kerberos5_i_read_write: Optional[bool] - kerberos5_p_read_only: Optional[bool] - kerberos5_p_read_write: Optional[bool] - kerberos5_read_only: Optional[bool] - kerberos5_read_write: Optional[bool] - nfsv3: Optional[bool] - nfsv41: Optional[bool] - rule_index: Optional[int] - unix_read_only: Optional[bool] - unix_read_write: Optional[bool] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - allowed_clients: Optional[str] = ..., - chown_mode: Optional[Union[str, ChownMode]] = ..., - cifs: Optional[bool] = ..., - has_root_access: Optional[bool] = ..., - kerberos5_i_read_only: Optional[bool] = ..., - kerberos5_i_read_write: Optional[bool] = ..., - kerberos5_p_read_only: Optional[bool] = ..., - kerberos5_p_read_write: Optional[bool] = ..., - kerberos5_read_only: Optional[bool] = ..., - kerberos5_read_write: Optional[bool] = ..., - nfsv3: Optional[bool] = ..., - nfsv41: Optional[bool] = ..., - rule_index: Optional[int] = ..., - unix_read_only: Optional[bool] = ..., - unix_read_write: Optional[bool] = ... + location: Optional[str] = ..., + properties: Optional[VolumeGroupProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.netapp.models.ExternalReplicationSetupStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLUSTER_PEER_PENDING = "ClusterPeerPending" - CLUSTER_PEER_REQUIRED = "ClusterPeerRequired" - NO_ACTION_REQUIRED = "NoActionRequired" - REPLICATION_CREATE_REQUIRED = "ReplicationCreateRequired" - V_SERVER_PEER_REQUIRED = "VServerPeerRequired" - - - class azure.mgmt.netapp.models.FileAccessLogs(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.FilePathAvailabilityRequest(_Model): - availability_zone: Optional[str] - name: str - subnet_id: str + class azure.mgmt.netapp.models.VolumeGroupListProperties(_Model): + group_meta_data: Optional[VolumeGroupMetaData] + provisioning_state: Optional[str] @overload def __init__( self, *, - availability_zone: Optional[str] = ..., - name: str, - subnet_id: str + group_meta_data: Optional[VolumeGroupMetaData] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.FileSystemUser(_Model): - cifs_user: Optional[CifsUser] - nfs_user: Optional[NfsUser] + class azure.mgmt.netapp.models.VolumeGroupMetaData(_Model): + application_identifier: Optional[str] + application_type: Optional[Union[str, ApplicationType]] + global_placement_rules: Optional[list[PlacementKeyValuePairs]] + group_description: Optional[str] + volumes_count: Optional[int] @overload def __init__( self, *, - cifs_user: Optional[CifsUser] = ..., - nfs_user: Optional[NfsUser] = ... + application_identifier: Optional[str] = ..., + application_type: Optional[Union[str, ApplicationType]] = ..., + global_placement_rules: Optional[list[PlacementKeyValuePairs]] = ..., + group_description: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.GetGroupIdListForLDAPUserRequest(_Model): - username: str + class azure.mgmt.netapp.models.VolumeGroupProperties(_Model): + group_meta_data: Optional[VolumeGroupMetaData] + provisioning_state: Optional[str] + volumes: Optional[list[VolumeGroupVolumeProperties]] @overload def __init__( self, *, - username: str + group_meta_data: Optional[VolumeGroupMetaData] = ..., + volumes: Optional[list[VolumeGroupVolumeProperties]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse(_Model): - group_ids_for_ldap_user: Optional[list[str]] + class azure.mgmt.netapp.models.VolumeGroupVolumeProperties(_Model): + id: Optional[str] + name: Optional[str] + properties: VolumeProperties + tags: Optional[dict[str, str]] + type: Optional[str] + zones: Optional[list[str]] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - group_ids_for_ldap_user: Optional[list[str]] = ... + name: Optional[str] = ..., + properties: VolumeProperties, + tags: Optional[dict[str, str]] = ..., + zones: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.netapp.models.GetKeyVaultStatusResponse(_Model): - properties: Optional[GetKeyVaultStatusResponseProperties] + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.netapp.models.VolumeLanguage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AR = "ar" + AR_UTF8 = "ar.utf-8" + C = "c" + CS = "cs" + CS_UTF8 = "cs.utf-8" + C_UTF8 = "c.utf-8" + DA = "da" + DA_UTF8 = "da.utf-8" + DE = "de" + DE_UTF8 = "de.utf-8" + EN = "en" + EN_US = "en-us" + EN_US_UTF8 = "en-us.utf-8" + EN_UTF8 = "en.utf-8" + ES = "es" + ES_UTF8 = "es.utf-8" + FI = "fi" + FI_UTF8 = "fi.utf-8" + FR = "fr" + FR_UTF8 = "fr.utf-8" + HE = "he" + HE_UTF8 = "he.utf-8" + HR = "hr" + HR_UTF8 = "hr.utf-8" + HU = "hu" + HU_UTF8 = "hu.utf-8" + IT = "it" + IT_UTF8 = "it.utf-8" + JA = "ja" + JA_JP932 = "ja-jp.932" + JA_JP932_UTF8 = "ja-jp.932.utf-8" + JA_JP_PCK = "ja-jp.pck" + JA_JP_PCK_UTF8 = "ja-jp.pck.utf-8" + JA_JP_PCK_V2 = "ja-jp.pck-v2" + JA_JP_PCK_V2_UTF8 = "ja-jp.pck-v2.utf-8" + JA_UTF8 = "ja.utf-8" + JA_V1 = "ja-v1" + JA_V1_UTF8 = "ja-v1.utf-8" + KO = "ko" + KO_UTF8 = "ko.utf-8" + NL = "nl" + NL_UTF8 = "nl.utf-8" + NO = "no" + NO_UTF8 = "no.utf-8" + PL = "pl" + PL_UTF8 = "pl.utf-8" + PT = "pt" + PT_UTF8 = "pt.utf-8" + RO = "ro" + RO_UTF8 = "ro.utf-8" + RU = "ru" + RU_UTF8 = "ru.utf-8" + SK = "sk" + SK_UTF8 = "sk.utf-8" + SL = "sl" + SL_UTF8 = "sl.utf-8" + SV = "sv" + SV_UTF8 = "sv.utf-8" + TR = "tr" + TR_UTF8 = "tr.utf-8" + UTF8_MB4 = "utf8mb4" + ZH = "zh" + ZH_GBK = "zh.gbk" + ZH_GBK_UTF8 = "zh.gbk.utf-8" + ZH_TW = "zh-tw" + ZH_TW_BIG5 = "zh-tw.big5" + ZH_TW_BIG5_UTF8 = "zh-tw.big5.utf-8" + ZH_TW_UTF8 = "zh-tw.utf-8" + ZH_UTF8 = "zh.utf-8" + + + class azure.mgmt.netapp.models.VolumePatch(_Model): + id: Optional[str] + location: Optional[str] + name: Optional[str] + properties: Optional[VolumePatchProperties] + tags: Optional[dict[str, str]] + type: Optional[str] def __getattr__(self, name: str) -> Any: ... @@ -6563,7 +6416,9 @@ namespace azure.mgmt.netapp.models def __init__( self, *, - properties: Optional[GetKeyVaultStatusResponseProperties] = ... + location: Optional[str] = ..., + properties: Optional[VolumePatchProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload @@ -6576,366 +6431,378 @@ namespace azure.mgmt.netapp.models ) -> None: ... - class azure.mgmt.netapp.models.GetKeyVaultStatusResponseProperties(_Model): - key_name: Optional[str] - key_vault_private_endpoints: Optional[list[KeyVaultPrivateEndpoint]] - key_vault_resource_id: Optional[str] - key_vault_uri: Optional[str] + class azure.mgmt.netapp.models.VolumePatchProperties(_Model): + cool_access: Optional[bool] + cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] + cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] + coolness_period: Optional[int] + data_protection: Optional[VolumePatchPropertiesDataProtection] + default_group_quota_in_ki_bs: Optional[int] + default_user_quota_in_ki_bs: Optional[int] + export_policy: Optional[VolumePatchPropertiesExportPolicy] + is_default_quota_enabled: Optional[bool] + protocol_types: Optional[list[str]] + service_level: Optional[Union[str, ServiceLevel]] + smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] + smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] + snapshot_directory_visible: Optional[bool] + throughput_mibps: Optional[float] + unix_permissions: Optional[str] + usage_threshold: Optional[int] @overload def __init__( self, *, - key_name: Optional[str] = ..., - key_vault_private_endpoints: Optional[list[KeyVaultPrivateEndpoint]] = ..., - key_vault_resource_id: Optional[str] = ..., - key_vault_uri: Optional[str] = ... + cool_access: Optional[bool] = ..., + cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] = ..., + cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] = ..., + coolness_period: Optional[int] = ..., + data_protection: Optional[VolumePatchPropertiesDataProtection] = ..., + default_group_quota_in_ki_bs: Optional[int] = ..., + default_user_quota_in_ki_bs: Optional[int] = ..., + export_policy: Optional[VolumePatchPropertiesExportPolicy] = ..., + is_default_quota_enabled: Optional[bool] = ..., + protocol_types: Optional[list[str]] = ..., + service_level: Optional[Union[str, ServiceLevel]] = ..., + smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] = ..., + smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] = ..., + snapshot_directory_visible: Optional[bool] = ..., + throughput_mibps: Optional[float] = ..., + unix_permissions: Optional[str] = ..., + usage_threshold: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.GlobalFileLockingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.HourlySchedule(_Model): - minute: Optional[int] - snapshots_to_keep: Optional[int] - used_bytes: Optional[int] + class azure.mgmt.netapp.models.VolumePatchPropertiesDataProtection(_Model): + backup: Optional[VolumeBackupProperties] + ransomware_protection: Optional[RansomwareProtectionPatchSettings] + snapshot: Optional[VolumeSnapshotProperties] @overload def __init__( self, *, - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ..., - used_bytes: Optional[int] = ... + backup: Optional[VolumeBackupProperties] = ..., + ransomware_protection: Optional[RansomwareProtectionPatchSettings] = ..., + snapshot: Optional[VolumeSnapshotProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.InAvailabilityReasonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALREADY_EXISTS = "AlreadyExists" - INVALID = "Invalid" - - - class azure.mgmt.netapp.models.KerberosState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.KeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MICROSOFT_KEY_VAULT = "Microsoft.KeyVault" - MICROSOFT_NET_APP = "Microsoft.NetApp" - - - class azure.mgmt.netapp.models.KeyVaultPrivateEndpoint(_Model): - private_endpoint_id: Optional[str] - virtual_network_id: Optional[str] + class azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy(_Model): + rules: Optional[list[ExportPolicyRule]] @overload def __init__( self, *, - private_endpoint_id: Optional[str] = ..., - virtual_network_id: Optional[str] = ... + rules: Optional[list[ExportPolicyRule]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.KeyVaultProperties(_Model): - key_name: str - key_vault_id: Optional[str] - key_vault_resource_id: Optional[str] - key_vault_uri: str - status: Optional[Union[str, KeyVaultStatus]] + class azure.mgmt.netapp.models.VolumeProperties(_Model): + accept_grow_capacity_pool_for_short_term_clone_split: Optional[Union[str, AcceptGrowCapacityPoolForShortTermCloneSplit]] + actual_throughput_mibps: Optional[float] + avs_data_store: Optional[Union[str, AvsDataStore]] + backup_id: Optional[str] + baremetal_tenant_id: Optional[str] + breakthrough_mode: Optional[Union[str, BreakthroughMode]] + capacity_pool_resource_id: Optional[str] + clone_progress: Optional[int] + cool_access: Optional[bool] + cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] + cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] + coolness_period: Optional[int] + creation_token: str + data_protection: Optional[VolumePropertiesDataProtection] + data_store_resource_id: Optional[list[str]] + default_group_quota_in_ki_bs: Optional[int] + default_user_quota_in_ki_bs: Optional[int] + delete_base_snapshot: Optional[bool] + effective_network_features: Optional[Union[str, NetworkFeatures]] + enable_subvolumes: Optional[Union[str, EnableSubvolumes]] + encrypted: Optional[bool] + encryption_key_source: Optional[Union[str, EncryptionKeySource]] + export_policy: Optional[VolumePropertiesExportPolicy] + file_access_logs: Optional[Union[str, FileAccessLogs]] + file_system_id: Optional[str] + inherited_size_in_bytes: Optional[int] + is_default_quota_enabled: Optional[bool] + is_large_volume: Optional[bool] + is_restoring: Optional[bool] + kerberos_enabled: Optional[bool] + key_vault_private_endpoint_resource_id: Optional[str] + ldap_enabled: Optional[bool] + maximum_number_of_files: Optional[int] + mount_targets: Optional[list[MountTargetProperties]] + network_features: Optional[Union[str, NetworkFeatures]] + network_sibling_set_id: Optional[str] + originating_resource_id: Optional[str] + placement_rules: Optional[list[PlacementKeyValuePairs]] + protocol_types: Optional[list[str]] + provisioned_availability_zone: Optional[str] + provisioning_state: Optional[str] + proximity_placement_group: Optional[str] + security_style: Optional[Union[str, SecurityStyle]] + service_level: Optional[Union[str, ServiceLevel]] + smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] + smb_continuously_available: Optional[bool] + smb_encryption: Optional[bool] + smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] + snapshot_directory_visible: Optional[bool] + snapshot_id: Optional[str] + storage_to_network_proximity: Optional[Union[str, VolumeStorageToNetworkProximity]] + subnet_id: str + t2_network: Optional[str] + throughput_mibps: Optional[float] + unix_permissions: Optional[str] + usage_threshold: int + volume_group_name: Optional[str] + volume_spec_name: Optional[str] + volume_type: Optional[str] @overload def __init__( self, *, - key_name: str, - key_vault_resource_id: Optional[str] = ..., - key_vault_uri: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.KeyVaultStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATED = "Created" - DELETED = "Deleted" - ERROR = "Error" - IN_USE = "InUse" - UPDATING = "Updating" - + accept_grow_capacity_pool_for_short_term_clone_split: Optional[Union[str, AcceptGrowCapacityPoolForShortTermCloneSplit]] = ..., + avs_data_store: Optional[Union[str, AvsDataStore]] = ..., + backup_id: Optional[str] = ..., + breakthrough_mode: Optional[Union[str, BreakthroughMode]] = ..., + capacity_pool_resource_id: Optional[str] = ..., + cool_access: Optional[bool] = ..., + cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] = ..., + cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] = ..., + coolness_period: Optional[int] = ..., + creation_token: str, + data_protection: Optional[VolumePropertiesDataProtection] = ..., + default_group_quota_in_ki_bs: Optional[int] = ..., + default_user_quota_in_ki_bs: Optional[int] = ..., + delete_base_snapshot: Optional[bool] = ..., + enable_subvolumes: Optional[Union[str, EnableSubvolumes]] = ..., + encryption_key_source: Optional[Union[str, EncryptionKeySource]] = ..., + export_policy: Optional[VolumePropertiesExportPolicy] = ..., + is_default_quota_enabled: Optional[bool] = ..., + is_large_volume: Optional[bool] = ..., + kerberos_enabled: Optional[bool] = ..., + key_vault_private_endpoint_resource_id: Optional[str] = ..., + ldap_enabled: Optional[bool] = ..., + network_features: Optional[Union[str, NetworkFeatures]] = ..., + placement_rules: Optional[list[PlacementKeyValuePairs]] = ..., + protocol_types: Optional[list[str]] = ..., + proximity_placement_group: Optional[str] = ..., + security_style: Optional[Union[str, SecurityStyle]] = ..., + service_level: Optional[Union[str, ServiceLevel]] = ..., + smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] = ..., + smb_continuously_available: Optional[bool] = ..., + smb_encryption: Optional[bool] = ..., + smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] = ..., + snapshot_directory_visible: Optional[bool] = ..., + snapshot_id: Optional[str] = ..., + subnet_id: str, + throughput_mibps: Optional[float] = ..., + unix_permissions: Optional[str] = ..., + usage_threshold: int, + volume_spec_name: Optional[str] = ..., + volume_type: Optional[str] = ... + ) -> None: ... - class azure.mgmt.netapp.models.LargeVolumeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EXTRA_LARGE_VOLUME7_DOT2_PI_B = "PremExtraLargeVolume7Dot2PiB" - LARGE_VOLUME = "LargeVolume" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.LdapConfiguration(_Model): - bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] - bind_dn: Optional[str] - bind_password_akv_config: Optional[BindPasswordAkvConfig] - certificate_cn_host: Optional[str] - dns_servers: Optional[list[str]] - domain: Optional[str] - group_dn: Optional[str] - ldap_port: Optional[int] - ldap_servers: Optional[list[str]] - net_group_dn: Optional[str] - secure_ldap_type: Optional[Union[str, SecureLdapType]] - server_ca_certificate: Optional[str] - user_dn: Optional[str] + class azure.mgmt.netapp.models.VolumePropertiesDataProtection(_Model): + backup: Optional[VolumeBackupProperties] + ransomware_protection: Optional[RansomwareProtectionSettings] + replication: Optional[ReplicationObject] + snapshot: Optional[VolumeSnapshotProperties] + volume_relocation: Optional[VolumeRelocationProperties] @overload def __init__( self, *, - bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] = ..., - bind_dn: Optional[str] = ..., - bind_password_akv_config: Optional[BindPasswordAkvConfig] = ..., - certificate_cn_host: Optional[str] = ..., - dns_servers: Optional[list[str]] = ..., - domain: Optional[str] = ..., - group_dn: Optional[str] = ..., - ldap_port: Optional[int] = ..., - ldap_servers: Optional[list[str]] = ..., - net_group_dn: Optional[str] = ..., - secure_ldap_type: Optional[Union[str, SecureLdapType]] = ..., - server_ca_certificate: Optional[str] = ..., - user_dn: Optional[str] = ... + backup: Optional[VolumeBackupProperties] = ..., + ransomware_protection: Optional[RansomwareProtectionSettings] = ..., + replication: Optional[ReplicationObject] = ..., + snapshot: Optional[VolumeSnapshotProperties] = ..., + volume_relocation: Optional[VolumeRelocationProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.LdapConfigurationPatch(_Model): - bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] - bind_dn: Optional[str] - bind_password_akv_config: Optional[BindPasswordAkvConfigPatch] - certificate_cn_host: Optional[str] - dns_servers: Optional[list[str]] - domain: Optional[str] - group_dn: Optional[str] - ldap_port: Optional[int] - ldap_servers: Optional[list[str]] - net_group_dn: Optional[str] - secure_ldap_type: Optional[Union[str, SecureLdapType]] - server_ca_certificate: Optional[str] - user_dn: Optional[str] + class azure.mgmt.netapp.models.VolumePropertiesExportPolicy(_Model): + rules: Optional[list[ExportPolicyRule]] @overload def __init__( self, *, - bind_authentication_level: Optional[Union[str, BindAuthenticationLevel]] = ..., - bind_dn: Optional[str] = ..., - bind_password_akv_config: Optional[BindPasswordAkvConfigPatch] = ..., - certificate_cn_host: Optional[str] = ..., - dns_servers: Optional[list[str]] = ..., - domain: Optional[str] = ..., - group_dn: Optional[str] = ..., - ldap_port: Optional[int] = ..., - ldap_servers: Optional[list[str]] = ..., - net_group_dn: Optional[str] = ..., - secure_ldap_type: Optional[Union[str, SecureLdapType]] = ..., - server_ca_certificate: Optional[str] = ..., - user_dn: Optional[str] = ... + rules: Optional[list[ExportPolicyRule]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.LdapSearchScopeOpt(_Model): - group_dn: Optional[str] - group_membership_filter: Optional[str] - user_dn: Optional[str] + class azure.mgmt.netapp.models.VolumeQuotaRule(TrackedResource): + id: str + location: str + name: str + properties: Optional[VolumeQuotaRulesProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - group_dn: Optional[str] = ..., - group_membership_filter: Optional[str] = ..., - user_dn: Optional[str] = ... + location: str, + properties: Optional[VolumeQuotaRulesProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.netapp.models.LdapServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE_DIRECTORY = "ActiveDirectory" - OPEN_LDAP = "OpenLDAP" - - - class azure.mgmt.netapp.models.LdapState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + class azure.mgmt.netapp.models.VolumeQuotaRulePatch(_Model): + properties: Optional[VolumeQuotaRulesProperties] + tags: Optional[dict[str, str]] - class azure.mgmt.netapp.models.ListQuotaReportResponse(_Model): - quota_report_records: Optional[list[QuotaReport]] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - quota_report_records: Optional[list[QuotaReport]] = ... + properties: Optional[VolumeQuotaRulesProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + - class azure.mgmt.netapp.models.ListQuotaReportResult(_Model): - properties: Optional[ListQuotaReportResponse] + class azure.mgmt.netapp.models.VolumeQuotaRulesProperties(_Model): + provisioning_state: Optional[Union[str, NetAppProvisioningState]] + quota_size_in_ki_bs: Optional[int] + quota_target: Optional[str] + quota_type: Optional[Union[str, QuotaType]] @overload def __init__( self, *, - properties: Optional[ListQuotaReportResponse] = ... + quota_size_in_ki_bs: Optional[int] = ..., + quota_target: Optional[str] = ..., + quota_type: Optional[Union[str, QuotaType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ListReplicationsRequest(_Model): - exclude: Optional[Union[str, Exclude]] + class azure.mgmt.netapp.models.VolumeRelocationProperties(_Model): + ready_to_be_finalized: Optional[bool] + relocation_requested: Optional[bool] @overload def __init__( self, *, - exclude: Optional[Union[str, Exclude]] = ... + relocation_requested: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.LogSpecification(_Model): - display_name: Optional[str] - name: Optional[str] + class azure.mgmt.netapp.models.VolumeReplicationRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IDLE = "Idle" + TRANSFERRING = "Transferring" + + + class azure.mgmt.netapp.models.VolumeRestoreRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IDLE = "Idle" + TRANSFERRING = "Transferring" + UNKNOWN = "Unknown" + + + class azure.mgmt.netapp.models.VolumeRevert(_Model): + snapshot_id: Optional[str] @overload def __init__( self, *, - display_name: Optional[str] = ..., - name: Optional[str] = ... + snapshot_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ManagedServiceIdentity(_Model): - principal_id: Optional[str] - tenant_id: Optional[str] - type: Union[str, ManagedServiceIdentityType] - user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + class azure.mgmt.netapp.models.VolumeSnapshotProperties(_Model): + snapshot_policy_id: Optional[str] @overload def __init__( self, *, - type: Union[str, ManagedServiceIdentityType], - user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + snapshot_policy_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - USER_ASSIGNED = "UserAssigned" - - - class azure.mgmt.netapp.models.MetricAggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AVERAGE = "Average" + class azure.mgmt.netapp.models.VolumeStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACROSS_T2 = "AcrossT2" + DEFAULT = "Default" + T1 = "T1" + T2 = "T2" - class azure.mgmt.netapp.models.MetricSpecification(_Model): - aggregation_type: Optional[str] - category: Optional[str] - dimensions: Optional[list[Dimension]] - display_description: Optional[str] - display_name: Optional[str] - enable_regional_mdm_account: Optional[bool] - fill_gap_with_zero: Optional[bool] - internal_metric_name: Optional[str] - is_internal: Optional[bool] - name: Optional[str] - resource_id_dimension_name_override: Optional[str] - source_mdm_account: Optional[str] - source_mdm_namespace: Optional[str] - supported_aggregation_types: Optional[list[Union[str, MetricAggregationType]]] - supported_time_grain_types: Optional[list[str]] - unit: Optional[str] + class azure.mgmt.netapp.models.WeeklySchedule(_Model): + day: Optional[str] + hour: Optional[int] + minute: Optional[int] + snapshots_to_keep: Optional[int] + used_bytes: Optional[int] @overload def __init__( self, *, - aggregation_type: Optional[str] = ..., - category: Optional[str] = ..., - dimensions: Optional[list[Dimension]] = ..., - display_description: Optional[str] = ..., - display_name: Optional[str] = ..., - enable_regional_mdm_account: Optional[bool] = ..., - fill_gap_with_zero: Optional[bool] = ..., - internal_metric_name: Optional[str] = ..., - is_internal: Optional[bool] = ..., - name: Optional[str] = ..., - resource_id_dimension_name_override: Optional[str] = ..., - source_mdm_account: Optional[str] = ..., - source_mdm_namespace: Optional[str] = ..., - supported_aggregation_types: Optional[list[Union[str, MetricAggregationType]]] = ..., - supported_time_grain_types: Optional[list[str]] = ..., - unit: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.MirrorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BROKEN = "Broken" - MIRRORED = "Mirrored" - UNINITIALIZED = "Uninitialized" - - - class azure.mgmt.netapp.models.MonthlySchedule(_Model): - days_of_month: Optional[str] - hour: Optional[int] - minute: Optional[int] - snapshots_to_keep: Optional[int] - used_bytes: Optional[int] - - @overload - def __init__( - self, - *, - days_of_month: Optional[str] = ..., + day: Optional[str] = ..., hour: Optional[int] = ..., minute: Optional[int] = ..., snapshots_to_keep: Optional[int] = ..., @@ -6946,2116 +6813,1836 @@ namespace azure.mgmt.netapp.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.netapp.models.MountTargetProperties(_Model): - file_system_id: str - ip_address: Optional[str] - mount_target_id: Optional[str] - smb_server_fqdn: Optional[str] +namespace azure.mgmt.netapp.operations + + class azure.mgmt.netapp.operations.AccountsOperations: - @overload def __init__( self, - *, - file_system_id: str, - smb_server_fqdn: Optional[str] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.MultiAdStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.NetAppAccount(TrackedResource): - etag: Optional[str] - id: str - identity: Optional[ManagedServiceIdentity] - location: str - name: str - properties: Optional[AccountProperties] - system_data: SystemData - tags: dict[str, str] - type: str - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( + def begin_change_key_vault( self, + resource_group_name: str, + account_name: str, + body: Optional[ChangeKeyVault] = None, *, - identity: Optional[ManagedServiceIdentity] = ..., - location: str, - properties: Optional[AccountProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_change_key_vault( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.NetAppAccountPatch(_Model): - identity: Optional[ManagedServiceIdentity] - properties: Optional[AccountPropertiesPatch] - tags: Optional[dict[str, str]] - - def __getattr__(self, name: str) -> Any: ... + resource_group_name: str, + account_name: str, + body: Optional[ChangeKeyVault] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_change_key_vault( self, + resource_group_name: str, + account_name: str, + body: Optional[IO[bytes]] = None, *, - identity: Optional[ManagedServiceIdentity] = ..., - properties: Optional[AccountPropertiesPatch] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_create_or_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.NetAppProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACCEPTED = "Accepted" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - MOVING = "Moving" - PATCHING = "Patching" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.mgmt.netapp.models.NetworkFeatures(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BASIC = "Basic" - BASIC_STANDARD = "Basic_Standard" - STANDARD = "Standard" - STANDARD_BASIC = "Standard_Basic" - - - class azure.mgmt.netapp.models.NetworkSiblingSet(_Model): - network_features: Optional[Union[str, NetworkFeatures]] - network_sibling_set_id: Optional[str] - network_sibling_set_state_id: Optional[str] - nic_info_list: Optional[list[NicInfo]] - provisioning_state: Optional[Union[str, NetworkSiblingSetProvisioningState]] - subnet_id: Optional[str] + resource_group_name: str, + account_name: str, + body: NetAppAccount, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetAppAccount]: ... @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + body: NetAppAccount, *, - network_features: Optional[Union[str, NetworkFeatures]] = ..., - network_sibling_set_id: Optional[str] = ..., - network_sibling_set_state_id: Optional[str] = ..., - nic_info_list: Optional[list[NicInfo]] = ..., - subnet_id: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetAppAccount]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetAppAccount]: ... + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... - class azure.mgmt.netapp.models.NetworkSiblingSetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" + @distributed_trace + def begin_get_change_key_vault_information( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> LROPoller[GetKeyVaultStatusResponse]: ... + @distributed_trace + @api_version_validation(method_added_on='2026-04-15-preview', params_added_on={'2026-04-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name']}, api_versions_list=['2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def begin_refresh_ldap_bind_password( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... - class azure.mgmt.netapp.models.NfsUser(_Model): - group_id: Optional[int] - user_id: Optional[int] + @distributed_trace + def begin_renew_credentials( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_transition_to_cmk( self, + resource_group_name: str, + account_name: str, + body: Optional[EncryptionTransitionRequest] = None, *, - group_id: Optional[int] = ..., - user_id: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.NicInfo(_Model): - ip_address: Optional[str] - volume_resource_ids: Optional[list[str]] + def begin_transition_to_cmk( + self, + resource_group_name: str, + account_name: str, + body: Optional[EncryptionTransitionRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_transition_to_cmk( self, + resource_group_name: str, + account_name: str, + body: Optional[IO[bytes]] = None, *, - volume_resource_ids: Optional[list[str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.OnCertificateConflictAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAIL = "Fail" - UPDATE = "Update" - - - class azure.mgmt.netapp.models.Operation(_Model): - display: Optional[OperationDisplay] - name: Optional[str] - origin: Optional[str] - properties: Optional[OperationProperties] - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + body: NetAppAccountPatch, *, - display: Optional[OperationDisplay] = ..., - name: Optional[str] = ..., - origin: Optional[str] = ..., - properties: Optional[OperationProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetAppAccount]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.OperationDisplay(_Model): - description: Optional[str] - operation: Optional[str] - provider: Optional[str] - resource: Optional[str] + resource_group_name: str, + account_name: str, + body: NetAppAccountPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetAppAccount]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + body: IO[bytes], *, - description: Optional[str] = ..., - operation: Optional[str] = ..., - provider: Optional[str] = ..., - resource: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetAppAccount]: ... - class azure.mgmt.netapp.models.OperationProperties(_Model): - service_specification: Optional[ServiceSpecification] + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> NetAppAccount: ... - @overload - def __init__( + @distributed_trace + def list( self, - *, - service_specification: Optional[ServiceSpecification] = ... - ) -> None: ... + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[NetAppAccount]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[NetAppAccount]: ... - class azure.mgmt.netapp.models.OriginClusterInformation(_Model): - peer_addresses: list[str] - peer_cluster_name: str - peer_volume_name: str - peer_vserver_name: str + class azure.mgmt.netapp.operations.BackupPoliciesOperations: - @overload def __init__( self, - *, - peer_addresses: list[str], - peer_cluster_name: str, - peer_volume_name: str, - peer_vserver_name: str + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest(_Model): - peer_ip_addresses: list[str] + def begin_create( + self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + body: BackupPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupPolicy]: ... @overload - def __init__( + def begin_create( self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + body: BackupPolicy, *, - peer_ip_addresses: list[str] - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupPolicy]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + def begin_create( + self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupPolicy]: ... - class azure.mgmt.netapp.models.PeeringPassphrases(_Model): - cluster_peering_command: str - cluster_peering_passphrase: str - critical_warning: Optional[str] - vserver_peering_command: str + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + body: BackupPolicyPatch, *, - cluster_peering_command: str, - cluster_peering_passphrase: str, - vserver_peering_command: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.PlacementKeyValuePairs(_Model): - key: str - value: str + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupPolicy]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + body: BackupPolicyPatch, *, - key: str, - value: str - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupPolicy]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def begin_update( + self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupPolicy]: ... + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + backup_policy_name: str, + **kwargs: Any + ) -> BackupPolicy: ... - class azure.mgmt.netapp.models.PolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" + @distributed_trace + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> ItemPaged[BackupPolicy]: ... - class azure.mgmt.netapp.models.PoolChangeRequest(_Model): - new_pool_resource_id: str + class azure.mgmt.netapp.operations.BackupVaultsOperations: - @overload def __init__( self, - *, - new_pool_resource_id: str + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.PoolPatchProperties(_Model): - cool_access: Optional[bool] - custom_throughput_mibps: Optional[int] - qos_type: Optional[Union[str, QosType]] - size: Optional[int] + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + body: BackupVault, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupVault]: ... @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + body: BackupVault, *, - cool_access: Optional[bool] = ..., - custom_throughput_mibps: Optional[int] = ..., - qos_type: Optional[Union[str, QosType]] = ..., - size: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupVault]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.PoolProperties(_Model): - cool_access: Optional[bool] - custom_throughput_mibps: Optional[int] - encryption_type: Optional[Union[str, EncryptionType]] - pool_id: Optional[str] - provisioning_state: Optional[str] - qos_type: Optional[Union[str, QosType]] - service_level: Union[str, ServiceLevel] - size: int - total_throughput_mibps: Optional[float] - utilized_throughput_mibps: Optional[float] - - @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + body: IO[bytes], *, - cool_access: Optional[bool] = ..., - custom_throughput_mibps: Optional[int] = ..., - encryption_type: Optional[Union[str, EncryptionType]] = ..., - qos_type: Optional[Union[str, QosType]] = ..., - service_level: Union[str, ServiceLevel], - size: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.ProtocolTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NF_SV3 = "NFSv3" - NF_SV4 = "NFSv4" - SMB = "SMB" - - - class azure.mgmt.netapp.models.ProxyResource(Resource): - id: str - name: str - system_data: SystemData - type: str - - - class azure.mgmt.netapp.models.QosType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "Auto" - MANUAL = "Manual" - + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupVault]: ... - class azure.mgmt.netapp.models.QueryNetworkSiblingSetRequest(_Model): - network_sibling_set_id: str - subnet_id: str + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + body: BackupVaultPatch, *, - network_sibling_set_id: str, - subnet_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.QuotaAvailabilityRequest(_Model): - name: str - resource_group: str - type: Union[str, CheckQuotaNameResourceTypes] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupVault]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + body: BackupVaultPatch, *, - name: str, - resource_group: str, - type: Union[str, CheckQuotaNameResourceTypes] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.QuotaItem(ProxyResource): - id: str - name: str - properties: Optional[QuotaItemProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupVault]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + body: IO[bytes], *, - properties: Optional[QuotaItemProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[BackupVault]: ... - def __setattr__( + @distributed_trace + def get( self, - key: str, - value: Any - ) -> None: ... - + resource_group_name: str, + account_name: str, + backup_vault_name: str, + **kwargs: Any + ) -> BackupVault: ... - class azure.mgmt.netapp.models.QuotaItemProperties(_Model): - current: Optional[int] - default: Optional[int] - usage: Optional[int] + @distributed_trace + def list_by_net_app_account( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> ItemPaged[BackupVault]: ... - class azure.mgmt.netapp.models.QuotaReport(_Model): - is_derived_quota: Optional[bool] - percentage_used: Optional[float] - quota_limit_total_in_ki_bs: Optional[int] - quota_limit_used_in_ki_bs: Optional[int] - quota_target: Optional[str] - quota_type: Optional[Union[str, QuotaType]] + class azure.mgmt.netapp.operations.BackupsOperations: - @overload def __init__( self, - *, - is_derived_quota: Optional[bool] = ..., - percentage_used: Optional[float] = ..., - quota_limit_total_in_ki_bs: Optional[int] = ..., - quota_limit_used_in_ki_bs: Optional[int] = ..., - quota_target: Optional[str] = ..., - quota_type: Optional[Union[str, QuotaType]] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.QuotaReportFilterRequest(_Model): - quota_target: Optional[str] - quota_type: Optional[Union[str, QuotaType]] - usage_threshold_percentage: Optional[int] - - @overload - def __init__( + def begin_create( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: Backup, *, - quota_target: Optional[str] = ..., - quota_type: Optional[Union[str, QuotaType]] = ..., - usage_threshold_percentage: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.QuotaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT_GROUP_QUOTA = "DefaultGroupQuota" - DEFAULT_USER_QUOTA = "DefaultUserQuota" - INDIVIDUAL_GROUP_QUOTA = "IndividualGroupQuota" - INDIVIDUAL_USER_QUOTA = "IndividualUserQuota" - - - class azure.mgmt.netapp.models.RansomwareProtectionPatchSettings(_Model): - desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Backup]: ... @overload - def __init__( + def begin_create( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: Backup, *, - desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Backup]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + def begin_create( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Backup]: ... - class azure.mgmt.netapp.models.RansomwareProtectionSettings(_Model): - actual_ransomware_protection_state: Optional[Union[str, ActualRansomwareProtectionState]] - desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: Optional[BackupPatch] = None, *, - desired_ransomware_protection_state: Optional[Union[str, DesiredRansomwareProtectionState]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Backup]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.RansomwareReport(ProxyResource): - id: str - name: str - properties: Optional[RansomwareReportProperties] - system_data: SystemData - type: str - - @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: Optional[BackupPatch] = None, *, - properties: Optional[RansomwareReportProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Backup]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.RansomwareReportProperties(_Model): - cleared_count: Optional[int] - event_time: Optional[datetime] - provisioning_state: Optional[str] - reported_count: Optional[int] - severity: Optional[Union[str, RansomwareReportSeverity]] - state: Optional[Union[str, RansomwareReportState]] - suspects: Optional[list[RansomwareSuspects]] - - - class azure.mgmt.netapp.models.RansomwareReportSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "High" - LOW = "Low" - MODERATE = "Moderate" - NONE = "None" - - - class azure.mgmt.netapp.models.RansomwareReportState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "Active" - RESOLVED = "Resolved" - - - class azure.mgmt.netapp.models.RansomwareSuspectResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FALSE_POSITIVE = "FalsePositive" - POTENTIAL_THREAT = "PotentialThreat" - + def begin_update( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Backup]: ... - class azure.mgmt.netapp.models.RansomwareSuspects(_Model): - extension: Optional[str] - file_count: Optional[int] - resolution: Optional[Union[str, RansomwareSuspectResolution]] - suspect_files: Optional[list[SuspectFile]] + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + **kwargs: Any + ) -> Backup: ... + @distributed_trace + def get_latest_status( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> BackupStatus: ... - class azure.mgmt.netapp.models.RansomwareSuspectsClearRequest(_Model): - extensions: list[str] - resolution: Union[str, RansomwareSuspectResolution] + @distributed_trace + def get_volume_latest_restore_status( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> RestoreStatus: ... - @overload - def __init__( + @distributed_trace + def list_by_vault( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, *, - extensions: list[str], - resolution: Union[str, RansomwareSuspectResolution] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + filter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Backup]: ... - class azure.mgmt.netapp.models.ReestablishReplicationRequest(_Model): - source_volume_id: Optional[str] + class azure.mgmt.netapp.operations.BackupsUnderAccountOperations: - @overload def __init__( self, - *, - source_volume_id: Optional[str] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.RegionInfo(_Model): - availability_zone_mappings: Optional[list[RegionInfoAvailabilityZoneMappingsItem]] - storage_to_network_proximity: Optional[Union[str, RegionStorageToNetworkProximity]] + def begin_migrate_backups( + self, + resource_group_name: str, + account_name: str, + body: BackupsMigrationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_migrate_backups( self, + resource_group_name: str, + account_name: str, + body: BackupsMigrationRequest, *, - availability_zone_mappings: Optional[list[RegionInfoAvailabilityZoneMappingsItem]] = ..., - storage_to_network_proximity: Optional[Union[str, RegionStorageToNetworkProximity]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def begin_migrate_backups( + self, + resource_group_name: str, + account_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... - class azure.mgmt.netapp.models.RegionInfoAvailabilityZoneMappingsItem(_Model): - availability_zone: Optional[str] - is_available: Optional[bool] + class azure.mgmt.netapp.operations.BackupsUnderBackupVaultOperations: - @overload def __init__( self, - *, - availability_zone: Optional[str] = ..., - is_available: Optional[bool] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.RegionInfoResource(ProxyResource): - id: str - name: str - properties: Optional[RegionInfo] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: BackupRestoreFiles, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_restore_files( self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: BackupRestoreFiles, *, - properties: Optional[RegionInfo] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_restore_files( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.RegionStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACROSS_T2 = "AcrossT2" - DEFAULT = "Default" - T1 = "T1" - T1_AND_ACROSS_T2 = "T1AndAcrossT2" - T1_AND_T2 = "T1AndT2" - T1_AND_T2_AND_ACROSS_T2 = "T1AndT2AndAcrossT2" - T2 = "T2" - T2_AND_ACROSS_T2 = "T2AndAcrossT2" + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... - class azure.mgmt.netapp.models.RelocateVolumeRequest(_Model): - creation_token: Optional[str] + class azure.mgmt.netapp.operations.BackupsUnderVolumeOperations: - @overload def __init__( self, - *, - creation_token: Optional[str] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.RemotePath(_Model): - external_host_name: str - server_name: str - volume_name: str - - @overload - def __init__( + def begin_migrate_backups( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: BackupsMigrationRequest, *, - external_host_name: str, - server_name: str, - volume_name: str - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.Replication(_Model): - endpoint_type: Optional[Union[str, EndpointType]] - mirror_state: Optional[Union[str, ReplicationMirrorState]] - remote_volume_region: Optional[str] - remote_volume_resource_id: Optional[str] - replication_creation_time: Optional[datetime] - replication_deletion_time: Optional[datetime] - replication_id: Optional[str] - replication_schedule: Optional[Union[str, ReplicationSchedule]] - - @overload - def __init__( + def begin_migrate_backups( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: BackupsMigrationRequest, *, - endpoint_type: Optional[Union[str, EndpointType]] = ..., - remote_volume_region: Optional[str] = ..., - remote_volume_resource_id: Optional[str] = ..., - replication_schedule: Optional[Union[str, ReplicationSchedule]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.ReplicationMirrorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BROKEN = "Broken" - MIRRORED = "Mirrored" - UNINITIALIZED = "Uninitialized" + def begin_migrate_backups( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... - class azure.mgmt.netapp.models.ReplicationObject(_Model): - destination_replications: Optional[list[DestinationReplication]] - endpoint_type: Optional[Union[str, EndpointType]] - external_replication_setup_info: Optional[str] - external_replication_setup_status: Optional[Union[str, ExternalReplicationSetupStatus]] - mirror_state: Optional[Union[str, MirrorState]] - relationship_status: Optional[Union[str, VolumeReplicationRelationshipStatus]] - remote_path: Optional[RemotePath] - remote_volume_region: Optional[str] - remote_volume_resource_id: Optional[str] - replication_id: Optional[str] - replication_schedule: Optional[Union[str, ReplicationSchedule]] + class azure.mgmt.netapp.operations.BucketsOperations: - @overload def __init__( self, - *, - remote_path: Optional[RemotePath] = ..., - remote_volume_region: Optional[str] = ..., - remote_volume_resource_id: Optional[str] = ..., - replication_schedule: Optional[Union[str, ReplicationSchedule]] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.ReplicationSchedule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAILY = "daily" - ENUM_10_MINUTELY = "_10minutely" - HOURLY = "hourly" - - - class azure.mgmt.netapp.models.ReplicationStatus(_Model): - error_message: Optional[str] - healthy: Optional[bool] - mirror_state: Optional[Union[str, MirrorState]] - relationship_status: Optional[Union[str, VolumeReplicationRelationshipStatus]] - total_progress: Optional[str] + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: Bucket, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Bucket]: ... @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: Bucket, *, - error_message: Optional[str] = ..., - healthy: Optional[bool] = ..., - mirror_state: Optional[Union[str, MirrorState]] = ..., - relationship_status: Optional[Union[str, VolumeReplicationRelationshipStatus]] = ..., - total_progress: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Bucket]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.ReplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CROSS_REGION_REPLICATION = "CrossRegionReplication" - CROSS_ZONE_REPLICATION = "CrossZoneReplication" - - - class azure.mgmt.netapp.models.Resource(_Model): - id: Optional[str] - name: Optional[str] - system_data: Optional[SystemData] - type: Optional[str] - + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Bucket]: ... - class azure.mgmt.netapp.models.ResourceNameAvailabilityRequest(_Model): - name: str - resource_group: str - type: Union[str, CheckNameResourceTypes] + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_generate_akv_credentials( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: BucketCredentialsExpiry, *, - name: str, - resource_group: str, - type: Union[str, CheckNameResourceTypes] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.RestoreStatus(_Model): - error_message: Optional[str] - healthy: Optional[bool] - mirror_state: Optional[Union[str, MirrorState]] - relationship_status: Optional[Union[str, VolumeRestoreRelationshipStatus]] - total_transfer_bytes: Optional[int] - unhealthy_reason: Optional[str] - - - class azure.mgmt.netapp.models.SecretPassword(_Model): - identity: Optional[SecretPasswordIdentity] - key_vault_properties: Optional[SecretPasswordKeyVaultProperties] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_generate_akv_credentials( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: BucketCredentialsExpiry, *, - identity: Optional[SecretPasswordIdentity] = ..., - key_vault_properties: Optional[SecretPasswordKeyVaultProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + def begin_generate_akv_credentials( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... - class azure.mgmt.netapp.models.SecretPasswordIdentity(_Model): - principal_id: Optional[str] - user_assigned_identity: Optional[str] + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def begin_refresh_certificate( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: BucketPatch, *, - user_assigned_identity: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SecretPasswordKeyVaultProperties(_Model): - key_vault_uri: str - secret_name: str + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Bucket]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: BucketPatch, *, - key_vault_uri: str, - secret_name: str - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Bucket]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SecureLdapType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LDAP_OVER_TLS = "LdapOverTLS" - NONE = "None" - - - class azure.mgmt.netapp.models.SecurityStyle(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NTFS = "ntfs" - UNIX = "unix" - - - class azure.mgmt.netapp.models.ServiceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FLEXIBLE = "Flexible" - PREMIUM = "Premium" - STANDARD = "Standard" - STANDARD_ZRS = "StandardZRS" - ULTRA = "Ultra" - - - class azure.mgmt.netapp.models.ServiceSpecification(_Model): - log_specifications: Optional[list[LogSpecification]] - metric_specifications: Optional[list[MetricSpecification]] + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Bucket]: ... @overload - def __init__( + def generate_credentials( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: BucketCredentialsExpiry, *, - log_specifications: Optional[list[LogSpecification]] = ..., - metric_specifications: Optional[list[MetricSpecification]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> BucketGenerateCredentials: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SmbAccessBasedEnumeration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.SmbEncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.SmbNonBrowsable(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.netapp.models.SmbSettings(_Model): - smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] - smb_encryption: Optional[Union[str, SmbEncryptionState]] - smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] + def generate_credentials( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: BucketCredentialsExpiry, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> BucketGenerateCredentials: ... @overload - def __init__( + def generate_credentials( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + body: IO[bytes], *, - smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] = ..., - smb_encryption: Optional[Union[str, SmbEncryptionState]] = ..., - smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> BucketGenerateCredentials: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any + ) -> Bucket: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> ItemPaged[Bucket]: ... - class azure.mgmt.netapp.models.Snapshot(ProxyResource): - id: str - location: str - name: str - properties: Optional[SnapshotProperties] - system_data: SystemData - type: str - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.operations.CachesOperations: - @overload def __init__( self, - *, - location: str, - properties: Optional[SnapshotProperties] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_create_or_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.SnapshotDirectoryVisibility(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIDDEN = "Hidden" - VISIBLE = "Visible" - - - class azure.mgmt.netapp.models.SnapshotPatch(_Model): - - - class azure.mgmt.netapp.models.SnapshotPolicy(TrackedResource): - etag: Optional[str] - id: str - location: str - name: str - properties: SnapshotPolicyProperties - system_data: SystemData - tags: dict[str, str] - type: str - - def __getattr__(self, name: str) -> Any: ... + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: Cache, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: Cache, *, - location: str, - properties: SnapshotPolicyProperties, - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_create_or_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.SnapshotPolicyPatch(_Model): - id: Optional[str] - location: Optional[str] - name: Optional[str] - properties: Optional[SnapshotPolicyProperties] - tags: Optional[dict[str, str]] - type: Optional[str] + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... - def __getattr__(self, name: str) -> Any: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_pool_change( self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: PoolChangeRequest, *, - location: Optional[str] = ..., - properties: Optional[SnapshotPolicyProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_pool_change( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.SnapshotPolicyProperties(_Model): - daily_schedule: Optional[DailySchedule] - enabled: Optional[bool] - hourly_schedule: Optional[HourlySchedule] - monthly_schedule: Optional[MonthlySchedule] - provisioning_state: Optional[str] - weekly_schedule: Optional[WeeklySchedule] + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: PoolChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__( + def begin_pool_change( self, - *, - daily_schedule: Optional[DailySchedule] = ..., - enabled: Optional[bool] = ..., - hourly_schedule: Optional[HourlySchedule] = ..., - monthly_schedule: Optional[MonthlySchedule] = ..., - weekly_schedule: Optional[WeeklySchedule] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... - class azure.mgmt.netapp.models.SnapshotPolicyVolumeList(_Model): - next_link: Optional[str] - value: list[Volume] + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def begin_reset_smb_password( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: CacheUpdate, *, - next_link: Optional[str] = ..., - value: list[Volume] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SnapshotProperties(_Model): - created: Optional[datetime] - provisioning_state: Optional[str] - snapshot_id: Optional[str] - - - class azure.mgmt.netapp.models.SnapshotRestoreFiles(_Model): - destination_path: Optional[str] - file_paths: list[str] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: CacheUpdate, *, - destination_path: Optional[str] = ..., - file_paths: list[str] - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Cache]: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + **kwargs: Any + ) -> Cache: ... - class azure.mgmt.netapp.models.SnapshotUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE_NEW_SNAPSHOT = "CreateNewSnapshot" - USE_EXISTING_SNAPSHOT = "UseExistingSnapshot" + @distributed_trace + @api_version_validation(method_added_on='2026-01-01', params_added_on={'2026-01-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + **kwargs: Any + ) -> ItemPaged[Cache]: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list_peering_passphrases( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + cache_name: str, + **kwargs: Any + ) -> PeeringPassphrases: ... - class azure.mgmt.netapp.models.SubvolumeInfo(ProxyResource): - id: str - name: str - properties: Optional[SubvolumeProperties] - system_data: SystemData - type: str - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.operations.NetAppResourceOperations: - @overload def __init__( self, - *, - properties: Optional[SubvolumeProperties] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_update_network_sibling_set( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.SubvolumeModel(_Model): - id: Optional[str] - name: Optional[str] - properties: Optional[SubvolumeModelProperties] - type: Optional[str] - - def __getattr__(self, name: str) -> Any: ... + location: str, + body: UpdateNetworkSiblingSetRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetworkSiblingSet]: ... @overload - def __init__( + def begin_update_network_sibling_set( self, + location: str, + body: UpdateNetworkSiblingSetRequest, *, - properties: Optional[SubvolumeModelProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetworkSiblingSet]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_update_network_sibling_set( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.SubvolumeModelProperties(_Model): - accessed_time_stamp: Optional[datetime] - bytes_used: Optional[int] - changed_time_stamp: Optional[datetime] - creation_time_stamp: Optional[datetime] - modified_time_stamp: Optional[datetime] - parent_path: Optional[str] - path: Optional[str] - permissions: Optional[str] - provisioning_state: Optional[str] - size: Optional[int] + location: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NetworkSiblingSet]: ... @overload - def __init__( + def check_file_path_availability( self, + location: str, + body: FilePathAvailabilityRequest, *, - accessed_time_stamp: Optional[datetime] = ..., - bytes_used: Optional[int] = ..., - changed_time_stamp: Optional[datetime] = ..., - creation_time_stamp: Optional[datetime] = ..., - modified_time_stamp: Optional[datetime] = ..., - parent_path: Optional[str] = ..., - path: Optional[str] = ..., - permissions: Optional[str] = ..., - provisioning_state: Optional[str] = ..., - size: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SubvolumePatchParams(_Model): - path: Optional[str] - size: Optional[int] + def check_file_path_availability( + self, + location: str, + body: FilePathAvailabilityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__( + def check_file_path_availability( self, + location: str, + body: IO[bytes], *, - path: Optional[str] = ..., - size: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SubvolumePatchRequest(_Model): - properties: Optional[SubvolumePatchParams] - - def __getattr__(self, name: str) -> Any: ... + def check_name_availability( + self, + location: str, + body: ResourceNameAvailabilityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__( + def check_name_availability( self, + location: str, + body: ResourceNameAvailabilityRequest, *, - properties: Optional[SubvolumePatchParams] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def check_name_availability( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.SubvolumeProperties(_Model): - parent_path: Optional[str] - path: Optional[str] - provisioning_state: Optional[str] - size: Optional[int] + location: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__( + def check_quota_availability( self, + location: str, + body: QuotaAvailabilityRequest, *, - parent_path: Optional[str] = ..., - path: Optional[str] = ..., - size: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SuspectFile(_Model): - file_timestamp: Optional[datetime] - suspect_file_name: Optional[str] - - - class azure.mgmt.netapp.models.SvmPeerCommandResponse(_Model): - properties: Optional[SvmPeerCommandResponseProperties] + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__( + def check_quota_availability( self, + location: str, + body: QuotaAvailabilityRequest, *, - properties: Optional[SvmPeerCommandResponseProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SvmPeerCommandResponseProperties(_Model): - svm_peering_command: Optional[str] + def check_quota_availability( + self, + location: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CheckAvailabilityResponse: ... @overload - def __init__( + def query_network_sibling_set( self, + location: str, + body: QueryNetworkSiblingSetRequest, *, - svm_peering_command: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> NetworkSiblingSet: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.SystemData(_Model): - created_at: Optional[datetime] - created_by: Optional[str] - created_by_type: Optional[Union[str, CreatedByType]] - last_modified_at: Optional[datetime] - last_modified_by: Optional[str] - last_modified_by_type: Optional[Union[str, CreatedByType]] + def query_network_sibling_set( + self, + location: str, + body: QueryNetworkSiblingSetRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> NetworkSiblingSet: ... @overload - def __init__( + def query_network_sibling_set( self, + location: str, + body: IO[bytes], *, - created_at: Optional[datetime] = ..., - created_by: Optional[str] = ..., - created_by_type: Optional[Union[str, CreatedByType]] = ..., - last_modified_at: Optional[datetime] = ..., - last_modified_by: Optional[str] = ..., - last_modified_by_type: Optional[Union[str, CreatedByType]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> NetworkSiblingSet: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def query_region_info( + self, + location: str, + **kwargs: Any + ) -> RegionInfo: ... - class azure.mgmt.netapp.models.TrackedResource(Resource): - id: str - location: str - name: str - system_data: SystemData - tags: Optional[dict[str, str]] - type: str + class azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsAccountOperations: - @overload def __init__( self, - *, - location: str, - tags: Optional[dict[str, str]] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'quota_limit_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def get( + self, + resource_group_name: str, + account_name: str, + quota_limit_name: str, + **kwargs: Any + ) -> QuotaItem: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> ItemPaged[QuotaItem]: ... - class azure.mgmt.netapp.models.UpdateNetworkSiblingSetRequest(_Model): - network_features: Union[str, NetworkFeatures] - network_sibling_set_id: str - network_sibling_set_state_id: str - subnet_id: str + class azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations: - @overload def __init__( self, - *, - network_features: Union[str, NetworkFeatures], - network_sibling_set_id: str, - network_sibling_set_state_id: str, - subnet_id: str + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def get( + self, + location: str, + quota_limit_name: str, + **kwargs: Any + ) -> QuotaItem: ... + + @distributed_trace + def list( + self, + location: str, + **kwargs: Any + ) -> ItemPaged[QuotaItem]: ... - class azure.mgmt.netapp.models.UsageName(_Model): - localized_value: Optional[str] - value: Optional[str] + class azure.mgmt.netapp.operations.NetAppResourceRegionInfosOperations: - @overload def __init__( self, - *, - localized_value: Optional[str] = ..., - value: Optional[str] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.UsageProperties(_Model): - current_value: Optional[int] - limit: Optional[int] - unit: Optional[str] + @distributed_trace + def get( + self, + location: str, + **kwargs: Any + ) -> RegionInfoResource: ... + @distributed_trace + def list( + self, + location: str, + **kwargs: Any + ) -> ItemPaged[RegionInfoResource]: ... - class azure.mgmt.netapp.models.UsageResult(_Model): - id: Optional[str] - name: Optional[UsageName] - properties: Optional[UsageProperties] - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.operations.NetAppResourceUsagesOperations: - @overload def __init__( self, - *, - properties: Optional[UsageProperties] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def get( + self, + location: str, + usage_type: str, + **kwargs: Any + ) -> UsageResult: ... - def __setattr__( + @distributed_trace + def list( self, - key: str, - value: Any - ) -> None: ... + location: str, + **kwargs: Any + ) -> ItemPaged[UsageResult]: ... - class azure.mgmt.netapp.models.UserAssignedIdentity(_Model): - client_id: Optional[str] - principal_id: Optional[str] + class azure.mgmt.netapp.operations.Operations: + def __init__( + self, + *args, + **kwargs + ) -> None: ... - class azure.mgmt.netapp.models.Volume(TrackedResource): - etag: Optional[str] - id: str - location: str - name: str - properties: VolumeProperties - system_data: SystemData - tags: dict[str, str] - type: str - zones: Optional[list[str]] + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... - def __getattr__(self, name: str) -> Any: ... - @overload + class azure.mgmt.netapp.operations.PoolsOperations: + def __init__( self, - *, - location: str, - properties: VolumeProperties, - tags: Optional[dict[str, str]] = ..., - zones: Optional[list[str]] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_create_or_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.VolumeBackupProperties(_Model): - backup_policy_id: Optional[str] - backup_vault_id: Optional[str] - policy_enforced: Optional[bool] + resource_group_name: str, + account_name: str, + pool_name: str, + body: CapacityPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CapacityPool]: ... @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + body: CapacityPool, *, - backup_policy_id: Optional[str] = ..., - backup_vault_id: Optional[str] = ..., - policy_enforced: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeBackupRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "Failed" - IDLE = "Idle" - TRANSFERRING = "Transferring" - UNKNOWN = "Unknown" - - - class azure.mgmt.netapp.models.VolumeBackups(_Model): - backups_count: Optional[int] - policy_enabled: Optional[bool] - volume_name: Optional[str] - volume_resource_id: Optional[str] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CapacityPool]: ... @overload - def __init__( + def begin_create_or_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + body: IO[bytes], *, - backups_count: Optional[int] = ..., - policy_enabled: Optional[bool] = ..., - volume_name: Optional[str] = ..., - volume_resource_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeGroup(_Model): - id: Optional[str] - location: Optional[str] - name: Optional[str] - properties: Optional[VolumeGroupListProperties] - type: Optional[str] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CapacityPool]: ... - def __getattr__(self, name: str) -> Any: ... + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + body: CapacityPoolPatch, *, - location: Optional[str] = ..., - properties: Optional[VolumeGroupListProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CapacityPool]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.VolumeGroupDetails(ProxyResource): - id: str - location: Optional[str] - name: str - properties: Optional[VolumeGroupProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + resource_group_name: str, + account_name: str, + pool_name: str, + body: CapacityPoolPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CapacityPool]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + body: IO[bytes], *, - location: Optional[str] = ..., - properties: Optional[VolumeGroupProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CapacityPool]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + **kwargs: Any + ) -> CapacityPool: ... - def __setattr__( + @distributed_trace + def list( self, - key: str, - value: Any - ) -> None: ... + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> ItemPaged[CapacityPool]: ... - class azure.mgmt.netapp.models.VolumeGroupListProperties(_Model): - group_meta_data: Optional[VolumeGroupMetaData] - provisioning_state: Optional[str] + class azure.mgmt.netapp.operations.RansomwareReportsOperations: - @overload def __init__( self, - *, - group_meta_data: Optional[VolumeGroupMetaData] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeGroupMetaData(_Model): - application_identifier: Optional[str] - application_type: Optional[Union[str, ApplicationType]] - global_placement_rules: Optional[list[PlacementKeyValuePairs]] - group_description: Optional[str] - volumes_count: Optional[int] - - @overload - def __init__( + def begin_clear_suspects( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + body: RansomwareSuspectsClearRequest, *, - application_identifier: Optional[str] = ..., - application_type: Optional[Union[str, ApplicationType]] = ..., - global_placement_rules: Optional[list[PlacementKeyValuePairs]] = ..., - group_description: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeGroupProperties(_Model): - group_meta_data: Optional[VolumeGroupMetaData] - provisioning_state: Optional[str] - volumes: Optional[list[VolumeGroupVolumeProperties]] + def begin_clear_suspects( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + body: RansomwareSuspectsClearRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_clear_suspects( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + body: IO[bytes], *, - group_meta_data: Optional[VolumeGroupMetaData] = ..., - volumes: Optional[list[VolumeGroupVolumeProperties]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'ransomware_report_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + **kwargs: Any + ) -> RansomwareReport: ... + @distributed_trace + @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview', '2026-07-01', '2026-07-15-preview', '2026-08-01']) + def list( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> ItemPaged[RansomwareReport]: ... - class azure.mgmt.netapp.models.VolumeGroupVolumeProperties(_Model): - id: Optional[str] - name: Optional[str] - properties: VolumeProperties - tags: Optional[dict[str, str]] - type: Optional[str] - zones: Optional[list[str]] - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.netapp.operations.SnapshotPoliciesOperations: - @overload def __init__( self, - *, - name: Optional[str] = ..., - properties: VolumeProperties, - tags: Optional[dict[str, str]] = ..., - zones: Optional[list[str]] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + @distributed_trace + def begin_delete( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.VolumeLanguage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AR = "ar" - AR_UTF8 = "ar.utf-8" - C = "c" - CS = "cs" - CS_UTF8 = "cs.utf-8" - C_UTF8 = "c.utf-8" - DA = "da" - DA_UTF8 = "da.utf-8" - DE = "de" - DE_UTF8 = "de.utf-8" - EN = "en" - EN_US = "en-us" - EN_US_UTF8 = "en-us.utf-8" - EN_UTF8 = "en.utf-8" - ES = "es" - ES_UTF8 = "es.utf-8" - FI = "fi" - FI_UTF8 = "fi.utf-8" - FR = "fr" - FR_UTF8 = "fr.utf-8" - HE = "he" - HE_UTF8 = "he.utf-8" - HR = "hr" - HR_UTF8 = "hr.utf-8" - HU = "hu" - HU_UTF8 = "hu.utf-8" - IT = "it" - IT_UTF8 = "it.utf-8" - JA = "ja" - JA_JP932 = "ja-jp.932" - JA_JP932_UTF8 = "ja-jp.932.utf-8" - JA_JP_PCK = "ja-jp.pck" - JA_JP_PCK_UTF8 = "ja-jp.pck.utf-8" - JA_JP_PCK_V2 = "ja-jp.pck-v2" - JA_JP_PCK_V2_UTF8 = "ja-jp.pck-v2.utf-8" - JA_UTF8 = "ja.utf-8" - JA_V1 = "ja-v1" - JA_V1_UTF8 = "ja-v1.utf-8" - KO = "ko" - KO_UTF8 = "ko.utf-8" - NL = "nl" - NL_UTF8 = "nl.utf-8" - NO = "no" - NO_UTF8 = "no.utf-8" - PL = "pl" - PL_UTF8 = "pl.utf-8" - PT = "pt" - PT_UTF8 = "pt.utf-8" - RO = "ro" - RO_UTF8 = "ro.utf-8" - RU = "ru" - RU_UTF8 = "ru.utf-8" - SK = "sk" - SK_UTF8 = "sk.utf-8" - SL = "sl" - SL_UTF8 = "sl.utf-8" - SV = "sv" - SV_UTF8 = "sv.utf-8" - TR = "tr" - TR_UTF8 = "tr.utf-8" - UTF8_MB4 = "utf8mb4" - ZH = "zh" - ZH_GBK = "zh.gbk" - ZH_GBK_UTF8 = "zh.gbk.utf-8" - ZH_TW = "zh-tw" - ZH_TW_BIG5 = "zh-tw.big5" - ZH_TW_BIG5_UTF8 = "zh-tw.big5.utf-8" - ZH_TW_UTF8 = "zh-tw.utf-8" - ZH_UTF8 = "zh.utf-8" - - - class azure.mgmt.netapp.models.VolumePatch(_Model): - id: Optional[str] - location: Optional[str] - name: Optional[str] - properties: Optional[VolumePatchProperties] - tags: Optional[dict[str, str]] - type: Optional[str] - - def __getattr__(self, name: str) -> Any: ... + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + body: SnapshotPolicyPatch, *, - location: Optional[str] = ..., - properties: Optional[VolumePatchProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SnapshotPolicy]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_update( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.VolumePatchProperties(_Model): - cool_access: Optional[bool] - cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] - cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] - coolness_period: Optional[int] - data_protection: Optional[VolumePatchPropertiesDataProtection] - default_group_quota_in_ki_bs: Optional[int] - default_user_quota_in_ki_bs: Optional[int] - export_policy: Optional[VolumePatchPropertiesExportPolicy] - is_default_quota_enabled: Optional[bool] - protocol_types: Optional[list[str]] - service_level: Optional[Union[str, ServiceLevel]] - smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] - smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] - snapshot_directory_visible: Optional[bool] - throughput_mibps: Optional[float] - unix_permissions: Optional[str] - usage_threshold: Optional[int] + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + body: SnapshotPolicyPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SnapshotPolicy]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + body: IO[bytes], *, - cool_access: Optional[bool] = ..., - cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] = ..., - cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] = ..., - coolness_period: Optional[int] = ..., - data_protection: Optional[VolumePatchPropertiesDataProtection] = ..., - default_group_quota_in_ki_bs: Optional[int] = ..., - default_user_quota_in_ki_bs: Optional[int] = ..., - export_policy: Optional[VolumePatchPropertiesExportPolicy] = ..., - is_default_quota_enabled: Optional[bool] = ..., - protocol_types: Optional[list[str]] = ..., - service_level: Optional[Union[str, ServiceLevel]] = ..., - smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] = ..., - smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] = ..., - snapshot_directory_visible: Optional[bool] = ..., - throughput_mibps: Optional[float] = ..., - unix_permissions: Optional[str] = ..., - usage_threshold: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SnapshotPolicy]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumePatchPropertiesDataProtection(_Model): - backup: Optional[VolumeBackupProperties] - ransomware_protection: Optional[RansomwareProtectionPatchSettings] - snapshot: Optional[VolumeSnapshotProperties] + def create( + self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + body: SnapshotPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SnapshotPolicy: ... @overload - def __init__( + def create( self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + body: SnapshotPolicy, *, - backup: Optional[VolumeBackupProperties] = ..., - ransomware_protection: Optional[RansomwareProtectionPatchSettings] = ..., - snapshot: Optional[VolumeSnapshotProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> SnapshotPolicy: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def create( + self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SnapshotPolicy: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + **kwargs: Any + ) -> SnapshotPolicy: ... + @distributed_trace + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> ItemPaged[SnapshotPolicy]: ... - class azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy(_Model): - rules: Optional[list[ExportPolicyRule]] + @distributed_trace + def list_volumes( + self, + resource_group_name: str, + account_name: str, + snapshot_policy_name: str, + **kwargs: Any + ) -> SnapshotPolicyVolumeList: ... + + + class azure.mgmt.netapp.operations.SnapshotsOperations: - @overload def __init__( self, - *, - rules: Optional[list[ExportPolicyRule]] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeProperties(_Model): - accept_grow_capacity_pool_for_short_term_clone_split: Optional[Union[str, AcceptGrowCapacityPoolForShortTermCloneSplit]] - actual_throughput_mibps: Optional[float] - avs_data_store: Optional[Union[str, AvsDataStore]] - backup_id: Optional[str] - baremetal_tenant_id: Optional[str] - breakthrough_mode: Optional[Union[str, BreakthroughMode]] - capacity_pool_resource_id: Optional[str] - clone_progress: Optional[int] - cool_access: Optional[bool] - cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] - cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] - coolness_period: Optional[int] - creation_token: str - data_protection: Optional[VolumePropertiesDataProtection] - data_store_resource_id: Optional[list[str]] - default_group_quota_in_ki_bs: Optional[int] - default_user_quota_in_ki_bs: Optional[int] - delete_base_snapshot: Optional[bool] - effective_network_features: Optional[Union[str, NetworkFeatures]] - enable_subvolumes: Optional[Union[str, EnableSubvolumes]] - encrypted: Optional[bool] - encryption_key_source: Optional[Union[str, EncryptionKeySource]] - export_policy: Optional[VolumePropertiesExportPolicy] - file_access_logs: Optional[Union[str, FileAccessLogs]] - file_system_id: Optional[str] - inherited_size_in_bytes: Optional[int] - is_default_quota_enabled: Optional[bool] - is_large_volume: Optional[bool] - is_restoring: Optional[bool] - kerberos_enabled: Optional[bool] - key_vault_private_endpoint_resource_id: Optional[str] - language: Optional[Union[str, VolumeLanguage]] - large_volume_type: Optional[Union[str, LargeVolumeType]] - ldap_enabled: Optional[bool] - ldap_server_type: Optional[Union[str, LdapServerType]] - maximum_number_of_files: Optional[int] - mount_targets: Optional[list[MountTargetProperties]] - network_features: Optional[Union[str, NetworkFeatures]] - network_sibling_set_id: Optional[str] - originating_resource_id: Optional[str] - placement_rules: Optional[list[PlacementKeyValuePairs]] - protocol_types: Optional[list[str]] - provisioned_availability_zone: Optional[str] - provisioning_state: Optional[str] - proximity_placement_group: Optional[str] - security_style: Optional[Union[str, SecurityStyle]] - service_level: Optional[Union[str, ServiceLevel]] - smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] - smb_continuously_available: Optional[bool] - smb_encryption: Optional[bool] - smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] - snapshot_directory_visible: Optional[bool] - snapshot_id: Optional[str] - storage_to_network_proximity: Optional[Union[str, VolumeStorageToNetworkProximity]] - subnet_id: str - t2_network: Optional[str] - throughput_mibps: Optional[float] - unix_permissions: Optional[str] - usage_threshold: int - volume_group_name: Optional[str] - volume_spec_name: Optional[str] - volume_type: Optional[str] - - @overload - def __init__( + def begin_create( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Snapshot, *, - accept_grow_capacity_pool_for_short_term_clone_split: Optional[Union[str, AcceptGrowCapacityPoolForShortTermCloneSplit]] = ..., - avs_data_store: Optional[Union[str, AvsDataStore]] = ..., - backup_id: Optional[str] = ..., - breakthrough_mode: Optional[Union[str, BreakthroughMode]] = ..., - capacity_pool_resource_id: Optional[str] = ..., - cool_access: Optional[bool] = ..., - cool_access_retrieval_policy: Optional[Union[str, CoolAccessRetrievalPolicy]] = ..., - cool_access_tiering_policy: Optional[Union[str, CoolAccessTieringPolicy]] = ..., - coolness_period: Optional[int] = ..., - creation_token: str, - data_protection: Optional[VolumePropertiesDataProtection] = ..., - default_group_quota_in_ki_bs: Optional[int] = ..., - default_user_quota_in_ki_bs: Optional[int] = ..., - delete_base_snapshot: Optional[bool] = ..., - enable_subvolumes: Optional[Union[str, EnableSubvolumes]] = ..., - encryption_key_source: Optional[Union[str, EncryptionKeySource]] = ..., - export_policy: Optional[VolumePropertiesExportPolicy] = ..., - is_default_quota_enabled: Optional[bool] = ..., - is_large_volume: Optional[bool] = ..., - kerberos_enabled: Optional[bool] = ..., - key_vault_private_endpoint_resource_id: Optional[str] = ..., - language: Optional[Union[str, VolumeLanguage]] = ..., - large_volume_type: Optional[Union[str, LargeVolumeType]] = ..., - ldap_enabled: Optional[bool] = ..., - ldap_server_type: Optional[Union[str, LdapServerType]] = ..., - network_features: Optional[Union[str, NetworkFeatures]] = ..., - placement_rules: Optional[list[PlacementKeyValuePairs]] = ..., - protocol_types: Optional[list[str]] = ..., - proximity_placement_group: Optional[str] = ..., - security_style: Optional[Union[str, SecurityStyle]] = ..., - service_level: Optional[Union[str, ServiceLevel]] = ..., - smb_access_based_enumeration: Optional[Union[str, SmbAccessBasedEnumeration]] = ..., - smb_continuously_available: Optional[bool] = ..., - smb_encryption: Optional[bool] = ..., - smb_non_browsable: Optional[Union[str, SmbNonBrowsable]] = ..., - snapshot_directory_visible: Optional[bool] = ..., - snapshot_id: Optional[str] = ..., - subnet_id: str, - throughput_mibps: Optional[float] = ..., - unix_permissions: Optional[str] = ..., - usage_threshold: int, - volume_spec_name: Optional[str] = ..., - volume_type: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumePropertiesDataProtection(_Model): - backup: Optional[VolumeBackupProperties] - ransomware_protection: Optional[RansomwareProtectionSettings] - replication: Optional[ReplicationObject] - snapshot: Optional[VolumeSnapshotProperties] - volume_relocation: Optional[VolumeRelocationProperties] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Snapshot]: ... @overload - def __init__( + def begin_create( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Snapshot, *, - backup: Optional[VolumeBackupProperties] = ..., - ransomware_protection: Optional[RansomwareProtectionSettings] = ..., - replication: Optional[ReplicationObject] = ..., - snapshot: Optional[VolumeSnapshotProperties] = ..., - volume_relocation: Optional[VolumeRelocationProperties] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Snapshot]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + def begin_create( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Snapshot]: ... - class azure.mgmt.netapp.models.VolumePropertiesExportPolicy(_Model): - rules: Optional[list[ExportPolicyRule]] + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_restore_files( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotRestoreFiles, *, - rules: Optional[list[ExportPolicyRule]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeQuotaRule(TrackedResource): - id: str - location: str - name: str - properties: Optional[VolumeQuotaRulesProperties] - system_data: SystemData - tags: dict[str, str] - type: str - - def __getattr__(self, name: str) -> Any: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_restore_files( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotRestoreFiles, *, - location: str, - properties: Optional[VolumeQuotaRulesProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( + def begin_restore_files( self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.VolumeQuotaRulePatch(_Model): - properties: Optional[VolumeQuotaRulesProperties] - tags: Optional[dict[str, str]] - - def __getattr__(self, name: str) -> Any: ... + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotPatch, *, - properties: Optional[VolumeQuotaRulesProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Snapshot]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.netapp.models.VolumeQuotaRulesProperties(_Model): - provisioning_state: Optional[Union[str, NetAppProvisioningState]] - quota_size_in_ki_bs: Optional[int] - quota_target: Optional[str] - quota_type: Optional[Union[str, QuotaType]] - - @overload - def __init__( - self, - *, - quota_size_in_ki_bs: Optional[int] = ..., - quota_target: Optional[str] = ..., - quota_type: Optional[Union[str, QuotaType]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeRelocationProperties(_Model): - ready_to_be_finalized: Optional[bool] - relocation_requested: Optional[bool] - - @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: SnapshotPatch, *, - relocation_requested: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeReplicationRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IDLE = "Idle" - TRANSFERRING = "Transferring" - - - class azure.mgmt.netapp.models.VolumeRestoreRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "Failed" - IDLE = "Idle" - TRANSFERRING = "Transferring" - UNKNOWN = "Unknown" - - - class azure.mgmt.netapp.models.VolumeRevert(_Model): - snapshot_id: Optional[str] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Snapshot]: ... @overload - def __init__( + def begin_update( self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: IO[bytes], *, - snapshot_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LARGE = "Large" - REGULAR = "Regular" - - - class azure.mgmt.netapp.models.VolumeSnapshotProperties(_Model): - snapshot_policy_id: Optional[str] + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Snapshot]: ... - @overload - def __init__( + @distributed_trace + def get( self, - *, - snapshot_policy_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.netapp.models.VolumeStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACROSS_T2 = "AcrossT2" - DEFAULT = "Default" - T1 = "T1" - T2 = "T2" - - - class azure.mgmt.netapp.models.WeeklySchedule(_Model): - day: Optional[str] - hour: Optional[int] - minute: Optional[int] - snapshots_to_keep: Optional[int] - used_bytes: Optional[int] + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + **kwargs: Any + ) -> Snapshot: ... - @overload - def __init__( + @distributed_trace + def list( self, - *, - day: Optional[str] = ..., - hour: Optional[int] = ..., - minute: Optional[int] = ..., - snapshots_to_keep: Optional[int] = ..., - used_bytes: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> ItemPaged[Snapshot]: ... -namespace azure.mgmt.netapp.operations - class azure.mgmt.netapp.operations.AccountsOperations: + class azure.mgmt.netapp.operations.SubvolumesOperations: def __init__( self, @@ -9064,190 +8651,205 @@ namespace azure.mgmt.netapp.operations ) -> None: ... @overload - def begin_change_key_vault( + def begin_create( self, resource_group_name: str, account_name: str, - body: Optional[ChangeKeyVault] = None, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: SubvolumeInfo, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[SubvolumeInfo]: ... @overload - def begin_change_key_vault( + def begin_create( self, resource_group_name: str, account_name: str, - body: Optional[ChangeKeyVault] = None, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: SubvolumeInfo, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[SubvolumeInfo]: ... @overload - def begin_change_key_vault( + def begin_create( self, resource_group_name: str, account_name: str, - body: Optional[IO[bytes]] = None, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[SubvolumeInfo]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any ) -> LROPoller[None]: ... - @overload - def begin_create_or_update( + @distributed_trace + def begin_get_metadata( self, resource_group_name: str, account_name: str, - body: NetAppAccount, - *, - content_type: str = "application/json", + pool_name: str, + volume_name: str, + subvolume_name: str, **kwargs: Any - ) -> LROPoller[NetAppAccount]: ... + ) -> LROPoller[SubvolumeModel]: ... @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - body: NetAppAccount, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: SubvolumePatchRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[NetAppAccount]: ... + ) -> LROPoller[SubvolumeInfo]: ... @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - body: IO[bytes], + pool_name: str, + volume_name: str, + subvolume_name: str, + body: SubvolumePatchRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[NetAppAccount]: ... + ) -> LROPoller[SubvolumeInfo]: ... - @distributed_trace - def begin_delete( + @overload + def begin_update( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[SubvolumeInfo]: ... @distributed_trace - def begin_get_change_key_vault_information( + def get( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, **kwargs: Any - ) -> LROPoller[GetKeyVaultStatusResponse]: ... + ) -> SubvolumeInfo: ... @distributed_trace - @api_version_validation(method_added_on='2026-04-15-preview', params_added_on={'2026-04-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name']}, api_versions_list=['2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_refresh_ldap_bind_password( + def list_by_volume( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> LROPoller[None]: ... + ) -> ItemPaged[SubvolumeInfo]: ... - @distributed_trace - def begin_renew_credentials( + + class azure.mgmt.netapp.operations.VolumeGroupsOperations: + + def __init__( self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... + *args, + **kwargs + ) -> None: ... @overload - def begin_transition_to_cmk( + def begin_create( self, resource_group_name: str, account_name: str, - body: Optional[EncryptionTransitionRequest] = None, + volume_group_name: str, + body: VolumeGroupDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[VolumeGroupDetails]: ... @overload - def begin_transition_to_cmk( + def begin_create( self, resource_group_name: str, account_name: str, - body: Optional[EncryptionTransitionRequest] = None, + volume_group_name: str, + body: VolumeGroupDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[VolumeGroupDetails]: ... @overload - def begin_transition_to_cmk( + def begin_create( self, resource_group_name: str, account_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - body: NetAppAccountPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[NetAppAccount]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - body: NetAppAccountPatch, + volume_group_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[NetAppAccount]: ... + ) -> LROPoller[VolumeGroupDetails]: ... - @overload - def begin_update( + @distributed_trace + def begin_delete( self, resource_group_name: str, account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", + volume_group_name: str, **kwargs: Any - ) -> LROPoller[NetAppAccount]: ... + ) -> LROPoller[None]: ... @distributed_trace def get( self, resource_group_name: str, account_name: str, + volume_group_name: str, **kwargs: Any - ) -> NetAppAccount: ... + ) -> VolumeGroupDetails: ... @distributed_trace - def list( + def list_by_net_app_account( self, resource_group_name: str, + account_name: str, **kwargs: Any - ) -> ItemPaged[NetAppAccount]: ... - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged[NetAppAccount]: ... + ) -> ItemPaged[VolumeGroup]: ... - class azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations: + class azure.mgmt.netapp.operations.VolumeQuotaRulesOperations: def __init__( self, @@ -9256,44 +8858,55 @@ namespace azure.mgmt.netapp.operations ) -> None: ... @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfig, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: VolumeQuotaRule, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ActiveDirectoryConfig]: ... + ) -> LROPoller[VolumeQuotaRule]: ... @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfig, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: VolumeQuotaRule, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ActiveDirectoryConfig]: ... + ) -> LROPoller[VolumeQuotaRule]: ... @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - active_directory_config_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ActiveDirectoryConfig]: ... + ) -> LROPoller[VolumeQuotaRule]: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'active_directory_config_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) def begin_delete( self, resource_group_name: str, - active_directory_config_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, **kwargs: Any ) -> LROPoller[None]: ... @@ -9301,58 +8914,67 @@ namespace azure.mgmt.netapp.operations def begin_update( self, resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfigUpdate, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: VolumeQuotaRulePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ActiveDirectoryConfig]: ... + ) -> LROPoller[VolumeQuotaRule]: ... @overload def begin_update( self, resource_group_name: str, - active_directory_config_name: str, - body: ActiveDirectoryConfigUpdate, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: VolumeQuotaRulePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ActiveDirectoryConfig]: ... + ) -> LROPoller[VolumeQuotaRule]: ... @overload def begin_update( self, resource_group_name: str, - active_directory_config_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ActiveDirectoryConfig]: ... + ) -> LROPoller[VolumeQuotaRule]: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'active_directory_config_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) def get( self, resource_group_name: str, - active_directory_config_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, **kwargs: Any - ) -> ActiveDirectoryConfig: ... + ) -> VolumeQuotaRule: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_resource_group( + def list_by_volume( self, resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> ItemPaged[ActiveDirectoryConfig]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged[ActiveDirectoryConfig]: ... + ) -> ItemPaged[VolumeQuotaRule]: ... - class azure.mgmt.netapp.operations.BackupPoliciesOperations: + class azure.mgmt.netapp.operations.VolumesOperations: def __init__( self, @@ -9360,586 +8982,531 @@ namespace azure.mgmt.netapp.operations **kwargs ) -> None: ... + @distributed_trace + def begin_authorize_external_replication( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> LROPoller[SvmPeerCommandResponse]: ... + @overload - def begin_create( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: BackupPolicy, + pool_name: str, + volume_name: str, + body: AuthorizeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupPolicy]: ... + ) -> LROPoller[None]: ... @overload - def begin_create( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: BackupPolicy, + pool_name: str, + volume_name: str, + body: AuthorizeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupPolicy]: ... + ) -> LROPoller[None]: ... @overload - def begin_create( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupPolicy]: ... + ) -> LROPoller[None]: ... - @distributed_trace - def begin_delete( + @overload + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + pool_name: str, + volume_name: str, + body: Optional[BreakFileLocksRequest] = None, + *, + content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_update( + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: BackupPolicyPatch, + pool_name: str, + volume_name: str, + body: Optional[BreakFileLocksRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupPolicy]: ... + ) -> LROPoller[None]: ... @overload - def begin_update( + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: BackupPolicyPatch, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupPolicy]: ... + ) -> LROPoller[None]: ... @overload - def begin_update( + def begin_break_replication( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: IO[bytes], + pool_name: str, + volume_name: str, + body: Optional[BreakReplicationRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupPolicy]: ... + ) -> LROPoller[None]: ... - @distributed_trace - def get( + @overload + def begin_break_replication( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + pool_name: str, + volume_name: str, + body: Optional[BreakReplicationRequest] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> BackupPolicy: ... + ) -> LROPoller[None]: ... - @distributed_trace - def list( + @overload + def begin_break_replication( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[BackupPolicy]: ... - - - class azure.mgmt.netapp.operations.BackupVaultsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> LROPoller[None]: ... @overload def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: BackupVault, + pool_name: str, + volume_name: str, + body: Volume, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupVault]: ... + ) -> LROPoller[Volume]: ... @overload def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: BackupVault, + pool_name: str, + volume_name: str, + body: Volume, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupVault]: ... + ) -> LROPoller[Volume]: ... @overload def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, + pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[BackupVault]: ... + ) -> LROPoller[Volume]: ... @distributed_trace def begin_delete( self, resource_group_name: str, account_name: str, - backup_vault_name: str, + pool_name: str, + volume_name: str, + *, + force_delete: Optional[bool] = ..., **kwargs: Any ) -> LROPoller[None]: ... - @overload - def begin_update( + @distributed_trace + def begin_delete_replication( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: BackupVaultPatch, - *, - content_type: str = "application/json", + pool_name: str, + volume_name: str, **kwargs: Any - ) -> LROPoller[BackupVault]: ... + ) -> LROPoller[None]: ... - @overload - def begin_update( + @distributed_trace + def begin_finalize_external_replication( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: BackupVaultPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[BackupVault]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[BackupVault]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> BackupVault: ... + ) -> LROPoller[None]: ... @distributed_trace - def list_by_net_app_account( + def begin_finalize_relocation( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, **kwargs: Any - ) -> ItemPaged[BackupVault]: ... - - - class azure.mgmt.netapp.operations.BackupsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> LROPoller[None]: ... @overload - def begin_create( + def begin_list_get_group_id_list_for_ldap_user( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Backup, + pool_name: str, + volume_name: str, + body: GetGroupIdListForLDAPUserRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Backup]: ... + ) -> LROPoller[GetGroupIdListForLDAPUserResponse]: ... @overload - def begin_create( + def begin_list_get_group_id_list_for_ldap_user( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Backup, + pool_name: str, + volume_name: str, + body: GetGroupIdListForLDAPUserRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Backup]: ... + ) -> LROPoller[GetGroupIdListForLDAPUserResponse]: ... @overload - def begin_create( + def begin_list_get_group_id_list_for_ldap_user( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Backup]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[GetGroupIdListForLDAPUserResponse]: ... @overload - def begin_update( + def begin_list_quota_report( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[BackupPatch] = None, + pool_name: str, + volume_name: str, + body: Optional[QuotaReportFilterRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Backup]: ... + ) -> LROPoller[ListQuotaReportResult]: ... @overload - def begin_update( + def begin_list_quota_report( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[BackupPatch] = None, + pool_name: str, + volume_name: str, + body: Optional[QuotaReportFilterRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Backup]: ... + ) -> LROPoller[ListQuotaReportResult]: ... @overload - def begin_update( + def begin_list_quota_report( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, + volume_name: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Backup]: ... + ) -> LROPoller[ListQuotaReportResult]: ... - @distributed_trace - def get( + @overload + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, + volume_name: str, + body: PeerClusterForVolumeMigrationRequest, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Backup: ... + ) -> LROPoller[ClusterPeerCommandResponse]: ... - @distributed_trace - def get_latest_status( + @overload + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, + body: PeerClusterForVolumeMigrationRequest, + *, + content_type: str = "application/json", **kwargs: Any - ) -> BackupStatus: ... + ) -> LROPoller[ClusterPeerCommandResponse]: ... - @distributed_trace - def get_volume_latest_restore_status( + @overload + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> RestoreStatus: ... + ) -> LROPoller[ClusterPeerCommandResponse]: ... @distributed_trace - def list_by_vault( + def begin_perform_replication_transfer( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - *, - filter: Optional[str] = ..., + pool_name: str, + volume_name: str, **kwargs: Any - ) -> ItemPaged[Backup]: ... - - - class azure.mgmt.netapp.operations.BackupsUnderAccountOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> LROPoller[None]: ... @overload - def begin_migrate_backups( + def begin_pool_change( self, resource_group_name: str, account_name: str, - body: BackupsMigrationRequest, + pool_name: str, + volume_name: str, + body: PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_migrate_backups( + def begin_pool_change( self, resource_group_name: str, account_name: str, - body: BackupsMigrationRequest, + pool_name: str, + volume_name: str, + body: PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_migrate_backups( + def begin_pool_change( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... - - class azure.mgmt.netapp.operations.BackupsUnderBackupVaultOperations: - - def __init__( + @distributed_trace + def begin_populate_availability_zone( self, - *args, - **kwargs - ) -> None: ... + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> LROPoller[Volume]: ... - @overload - def begin_restore_files( + @distributed_trace + def begin_re_initialize_replication( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: BackupRestoreFiles, - *, - content_type: str = "application/json", + pool_name: str, + volume_name: str, **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_restore_files( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: BackupRestoreFiles, + pool_name: str, + volume_name: str, + body: ReestablishReplicationRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_restore_files( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: IO[bytes], + pool_name: str, + volume_name: str, + body: ReestablishReplicationRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... - - class azure.mgmt.netapp.operations.BackupsUnderVolumeOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - @overload - def begin_migrate_backups( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: BackupsMigrationRequest, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_migrate_backups( + def begin_relocate( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: BackupsMigrationRequest, + body: Optional[RelocateVolumeRequest] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_migrate_backups( + def begin_relocate( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: IO[bytes], + body: Optional[RelocateVolumeRequest] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... - - class azure.mgmt.netapp.operations.BucketsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - @overload - def begin_create_or_update( + def begin_relocate( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Bucket, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Bucket]: ... + ) -> LROPoller[None]: ... - @overload - def begin_create_or_update( + @distributed_trace + def begin_reset_cifs_password( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Bucket, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Bucket]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Bucket]: ... + ) -> LROPoller[None]: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def begin_delete( + def begin_resync_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_generate_akv_credentials( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: BucketCredentialsExpiry, + body: VolumeRevert, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_generate_akv_credentials( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: BucketCredentialsExpiry, + body: VolumeRevert, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload - def begin_generate_akv_credentials( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", @@ -9947,30 +9514,24 @@ namespace azure.mgmt.netapp.operations ) -> LROPoller[None]: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def begin_refresh_certificate( + def begin_revert_relocation( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, **kwargs: Any ) -> LROPoller[None]: ... - @overload - def begin_update( + @distributed_trace + def begin_split_clone_from_parent( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: BucketPatch, - *, - content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Bucket]: ... + ) -> LROPoller[Volume]: ... @overload def begin_update( @@ -9979,12 +9540,11 @@ namespace azure.mgmt.netapp.operations account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: BucketPatch, + body: VolumePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Bucket]: ... + ) -> LROPoller[Volume]: ... @overload def begin_update( @@ -9993,4109 +9553,687 @@ namespace azure.mgmt.netapp.operations account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Bucket]: ... - - @overload - def generate_credentials( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - body: BucketCredentialsExpiry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> BucketGenerateCredentials: ... - - @overload - def generate_credentials( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - body: BucketCredentialsExpiry, + body: VolumePatch, *, content_type: str = "application/json", **kwargs: Any - ) -> BucketGenerateCredentials: ... + ) -> LROPoller[Volume]: ... @overload - def generate_credentials( + def begin_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> BucketGenerateCredentials: ... + ) -> LROPoller[Volume]: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'bucket_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) def get( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, **kwargs: Any - ) -> Bucket: ... + ) -> Volume: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) def list( self, resource_group_name: str, account_name: str, pool_name: str, - volume_name: str, **kwargs: Any - ) -> ItemPaged[Bucket]: ... - - - class azure.mgmt.netapp.operations.CachesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> ItemPaged[Volume]: ... @overload - def begin_create_or_update( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: Cache, + volume_name: str, + body: Optional[ListReplicationsRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Cache]: ... + ) -> ItemPaged[Replication]: ... @overload - def begin_create_or_update( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: Cache, + volume_name: str, + body: Optional[ListReplicationsRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Cache]: ... + ) -> ItemPaged[Replication]: ... @overload - def begin_create_or_update( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: IO[bytes], + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Cache]: ... + ) -> ItemPaged[Replication]: ... @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def begin_delete( + def replication_status( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, + volume_name: str, **kwargs: Any - ) -> LROPoller[None]: ... + ) -> ReplicationStatus: ... - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Cache]: ... - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Cache]: ... +namespace azure.mgmt.netapp.types - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Cache]: ... + class azure.mgmt.netapp.types.AccountEncryption(TypedDict, total=False): + key "identity": ForwardRef('EncryptionIdentity', module='types') + key "keySource": Union[str, KeySource] + key "keyVaultProperties": ForwardRef('KeyVaultProperties', module='types') + identity: EncryptionIdentity + keySource: Union[str, KeySource] + keyVaultProperties: KeyVaultProperties - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def begin_reset_smb_password( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - **kwargs: Any - ) -> LROPoller[Cache]: ... - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: CacheUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Cache]: ... + class azure.mgmt.netapp.types.AccountEncryptionPatch(TypedDict, total=False): + key "identity": ForwardRef('EncryptionIdentityPatch', module='types') + key "keySource": Union[str, KeySource] + key "keyVaultProperties": ForwardRef('KeyVaultPropertiesPatch', module='types') + identity: EncryptionIdentityPatch + keySource: Union[str, KeySource] + keyVaultProperties: KeyVaultPropertiesPatch - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: CacheUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Cache]: ... - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Cache]: ... + class azure.mgmt.netapp.types.AccountProperties(TypedDict, total=False): + key "disableShowmount": Optional[bool] + key "encryption": ForwardRef('AccountEncryption', module='types') + key "ldapConfiguration": ForwardRef('LdapConfiguration', module='types') + key "multiAdStatus": Union[str, MultiAdStatus] + key "nfsV4IDDomain": Optional[str] + key "provisioningState": str + activeDirectories: list[ActiveDirectory] + disableShowmount: bool + encryption: AccountEncryption + ldapConfiguration: LdapConfiguration + multiAdStatus: Union[str, MultiAdStatus] + nfsV4IDDomain: str + provisioningState: str - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - **kwargs: Any - ) -> Cache: ... - @distributed_trace - @api_version_validation(method_added_on='2026-01-01', params_added_on={'2026-01-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> ItemPaged[Cache]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'cache_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def list_peering_passphrases( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - **kwargs: Any - ) -> PeeringPassphrases: ... - - - class azure.mgmt.netapp.operations.ElasticAccountsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: ElasticAccount, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticAccount]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: ElasticAccount, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticAccount]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticAccount]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - body: ElasticAccountUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticAccount]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - body: ElasticAccountUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticAccount]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticAccount]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ElasticAccount: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticAccount]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged[ElasticAccount]: ... - - - class azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupPolicy]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupPolicy]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupPolicy]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_policy_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupPolicy]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: ElasticBackupPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupPolicy]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupPolicy]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_policy_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - **kwargs: Any - ) -> ElasticBackupPolicy: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticBackupPolicy]: ... - - - class azure.mgmt.netapp.operations.ElasticBackupVaultsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVault, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupVault]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVault, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupVault]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupVault]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVaultUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupVault]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: ElasticBackupVaultUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupVault]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackupVault]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - **kwargs: Any - ) -> ElasticBackupVault: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticBackupVault]: ... - - - class azure.mgmt.netapp.operations.ElasticBackupsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackup]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackup]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackup]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'backup_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackup]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackup]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticBackup]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'backup_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - **kwargs: Any - ) -> ElasticBackup: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'backup_vault_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_vault( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticBackup]: ... - - - class azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: ChangeZoneRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: ChangeZoneRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: ElasticCapacityPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: ElasticCapacityPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: ElasticCapacityPoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: ElasticCapacityPoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticCapacityPool]: ... - - @overload - def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: CheckElasticVolumeFilePathAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckElasticResourceAvailabilityResponse: ... - - @overload - def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: CheckElasticVolumeFilePathAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckElasticResourceAvailabilityResponse: ... - - @overload - def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckElasticResourceAvailabilityResponse: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> ElasticCapacityPool: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticCapacityPool]: ... - - - class azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshotPolicy]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshotPolicy]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshotPolicy]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'snapshot_policy_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshotPolicy]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: ElasticSnapshotPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshotPolicy]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshotPolicy]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'snapshot_policy_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - **kwargs: Any - ) -> ElasticSnapshotPolicy: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_account( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticSnapshotPolicy]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'snapshot_policy_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_elastic_volumes( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticVolume]: ... - - - class azure.mgmt.netapp.operations.ElasticSnapshotsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: ElasticSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshot]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: ElasticSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshot]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticSnapshot]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'snapshot_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'snapshot_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> ElasticSnapshot: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_volume( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticSnapshot]: ... - - - class azure.mgmt.netapp.operations.ElasticVolumesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolumeUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ElasticVolumeUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ElasticVolume]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ElasticVolume: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-15-preview', params_added_on={'2025-12-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'accept']}, api_versions_list=['2025-12-15-preview', '2026-01-15-preview', '2026-03-15-preview', '2026-04-15-preview', '2026-05-15-preview', '2026-06-15-preview']) - def list_by_elastic_pool( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> ItemPaged[ElasticVolume]: ... - - - class azure.mgmt.netapp.operations.NetAppResourceOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_update_network_sibling_set( - self, - location: str, - body: UpdateNetworkSiblingSetRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[NetworkSiblingSet]: ... - - @overload - def begin_update_network_sibling_set( - self, - location: str, - body: UpdateNetworkSiblingSetRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[NetworkSiblingSet]: ... - - @overload - def begin_update_network_sibling_set( - self, - location: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[NetworkSiblingSet]: ... - - @overload - def check_file_path_availability( - self, - location: str, - body: FilePathAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_file_path_availability( - self, - location: str, - body: FilePathAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_file_path_availability( - self, - location: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_name_availability( - self, - location: str, - body: ResourceNameAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_name_availability( - self, - location: str, - body: ResourceNameAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_name_availability( - self, - location: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_quota_availability( - self, - location: str, - body: QuotaAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_quota_availability( - self, - location: str, - body: QuotaAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def check_quota_availability( - self, - location: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CheckAvailabilityResponse: ... - - @overload - def query_network_sibling_set( - self, - location: str, - body: QueryNetworkSiblingSetRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> NetworkSiblingSet: ... - - @overload - def query_network_sibling_set( - self, - location: str, - body: QueryNetworkSiblingSetRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> NetworkSiblingSet: ... - - @overload - def query_network_sibling_set( - self, - location: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> NetworkSiblingSet: ... - - @distributed_trace - def query_region_info( - self, - location: str, - **kwargs: Any - ) -> RegionInfo: ... - - - class azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsAccountOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'quota_limit_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - quota_limit_name: str, - **kwargs: Any - ) -> QuotaItem: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2025-08-01', '2025-09-01', '2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[QuotaItem]: ... - - - class azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def get( - self, - location: str, - quota_limit_name: str, - **kwargs: Any - ) -> QuotaItem: ... - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> ItemPaged[QuotaItem]: ... - - - class azure.mgmt.netapp.operations.NetAppResourceRegionInfosOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def get( - self, - location: str, - **kwargs: Any - ) -> RegionInfoResource: ... - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> ItemPaged[RegionInfoResource]: ... - - - class azure.mgmt.netapp.operations.NetAppResourceUsagesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def get( - self, - location: str, - usage_type: str, - **kwargs: Any - ) -> UsageResult: ... - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> ItemPaged[UsageResult]: ... - - - class azure.mgmt.netapp.operations.Operations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... - - - class azure.mgmt.netapp.operations.PoolsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: CapacityPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CapacityPool]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: CapacityPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CapacityPool]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CapacityPool]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: CapacityPoolPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CapacityPool]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: CapacityPoolPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CapacityPool]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CapacityPool]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> CapacityPool: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[CapacityPool]: ... - - - class azure.mgmt.netapp.operations.RansomwareReportsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_clear_suspects( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - ransomware_report_name: str, - body: RansomwareSuspectsClearRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_clear_suspects( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - ransomware_report_name: str, - body: RansomwareSuspectsClearRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_clear_suspects( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - ransomware_report_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'ransomware_report_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - ransomware_report_name: str, - **kwargs: Any - ) -> RansomwareReport: ... - - @distributed_trace - @api_version_validation(method_added_on='2025-12-01', params_added_on={'2025-12-01': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'pool_name', 'volume_name', 'accept']}, api_versions_list=['2025-12-01', '2025-12-15-preview', '2026-01-01', '2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-04-01', '2026-04-15-preview', '2026-05-01', '2026-05-15-preview', '2026-06-01', '2026-06-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ItemPaged[RansomwareReport]: ... - - - class azure.mgmt.netapp.operations.SnapshotPoliciesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicyPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SnapshotPolicy]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicyPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SnapshotPolicy]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SnapshotPolicy]: ... - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> SnapshotPolicy: ... - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: SnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> SnapshotPolicy: ... - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> SnapshotPolicy: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - **kwargs: Any - ) -> SnapshotPolicy: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[SnapshotPolicy]: ... - - @distributed_trace - def list_volumes( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - **kwargs: Any - ) -> SnapshotPolicyVolumeList: ... - - - class azure.mgmt.netapp.operations.SnapshotsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Snapshot]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Snapshot]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Snapshot]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: SnapshotRestoreFiles, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: SnapshotRestoreFiles, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: SnapshotPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Snapshot]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: SnapshotPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Snapshot]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Snapshot]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> Snapshot: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ItemPaged[Snapshot]: ... - - - class azure.mgmt.netapp.operations.SubvolumesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumeInfo, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SubvolumeInfo]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumeInfo, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SubvolumeInfo]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SubvolumeInfo]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_get_metadata( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - **kwargs: Any - ) -> LROPoller[SubvolumeModel]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumePatchRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SubvolumeInfo]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: SubvolumePatchRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SubvolumeInfo]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[SubvolumeInfo]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - **kwargs: Any - ) -> SubvolumeInfo: ... - - @distributed_trace - def list_by_volume( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ItemPaged[SubvolumeInfo]: ... - - - class azure.mgmt.netapp.operations.VolumeGroupsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: VolumeGroupDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeGroupDetails]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: VolumeGroupDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeGroupDetails]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeGroupDetails]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - **kwargs: Any - ) -> VolumeGroupDetails: ... - - @distributed_trace - def list_by_net_app_account( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[VolumeGroup]: ... - - - class azure.mgmt.netapp.operations.VolumeQuotaRulesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeQuotaRule]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeQuotaRule]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeQuotaRule]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeQuotaRule]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: VolumeQuotaRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeQuotaRule]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[VolumeQuotaRule]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - **kwargs: Any - ) -> VolumeQuotaRule: ... - - @distributed_trace - def list_by_volume( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ItemPaged[VolumeQuotaRule]: ... - - - class azure.mgmt.netapp.operations.VolumesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def begin_authorize_external_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[SvmPeerCommandResponse]: ... - - @overload - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: AuthorizeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: AuthorizeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakFileLocksRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakFileLocksRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakReplicationRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[BreakReplicationRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Volume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Volume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - *, - force_delete: Optional[bool] = ..., - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_delete_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_finalize_external_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_finalize_relocation( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_list_get_group_id_list_for_ldap_user( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: GetGroupIdListForLDAPUserRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[GetGroupIdListForLDAPUserResponse]: ... - - @overload - def begin_list_get_group_id_list_for_ldap_user( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: GetGroupIdListForLDAPUserRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[GetGroupIdListForLDAPUserResponse]: ... - - @overload - def begin_list_get_group_id_list_for_ldap_user( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[GetGroupIdListForLDAPUserResponse]: ... - - @overload - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[QuotaReportFilterRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ListQuotaReportResult]: ... - - @overload - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[QuotaReportFilterRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ListQuotaReportResult]: ... - - @overload - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ListQuotaReportResult]: ... - - @overload - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PeerClusterForVolumeMigrationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ClusterPeerCommandResponse]: ... - - @overload - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PeerClusterForVolumeMigrationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ClusterPeerCommandResponse]: ... - - @overload - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ClusterPeerCommandResponse]: ... - - @distributed_trace - def begin_perform_replication_transfer( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_populate_availability_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @distributed_trace - def begin_re_initialize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ReestablishReplicationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: ReestablishReplicationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[RelocateVolumeRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[RelocateVolumeRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_reset_cifs_password( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_resync_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_revert_relocation( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_split_clone_from_parent( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: VolumePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Volume]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> Volume: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - **kwargs: Any - ) -> ItemPaged[Volume]: ... - - @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[ListReplicationsRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged[Replication]: ... - - @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[ListReplicationsRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged[Replication]: ... - - @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged[Replication]: ... - - @distributed_trace - def replication_status( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - **kwargs: Any - ) -> ReplicationStatus: ... - - -namespace azure.mgmt.netapp.types - - class azure.mgmt.netapp.types.AccountEncryption(TypedDict, total=False): - key "identity": ForwardRef('EncryptionIdentity', module='types') - key "keySource": Union[str, KeySource] - key "keyVaultProperties": ForwardRef('KeyVaultProperties', module='types') - identity: EncryptionIdentity - keySource: Union[str, KeySource] - keyVaultProperties: KeyVaultProperties - - - class azure.mgmt.netapp.types.AccountProperties(TypedDict, total=False): - key "disableShowmount": Optional[bool] - key "encryption": ForwardRef('AccountEncryption', module='types') - key "entraIdConfig": ForwardRef('EntraIdConfig', module='types') - key "ldapConfiguration": ForwardRef('LdapConfiguration', module='types') - key "multiAdStatus": Union[str, MultiAdStatus] - key "nfsV4IDDomain": Optional[str] - key "provisioningState": str - activeDirectories: list[ActiveDirectory] - disableShowmount: bool - encryption: AccountEncryption - entraIdConfig: EntraIdConfig - ldapConfiguration: LdapConfiguration - multiAdStatus: Union[str, MultiAdStatus] - nfsV4IDDomain: str - provisioningState: str - - - class azure.mgmt.netapp.types.AccountPropertiesPatch(TypedDict, total=False): - key "encryption": ForwardRef('AccountEncryption', module='types') - key "entraIdConfig": ForwardRef('EntraIdConfigPatch', module='types') - key "ldapConfiguration": ForwardRef('LdapConfigurationPatch', module='types') - key "nfsV4IDDomain": Optional[str] - activeDirectories: list[ActiveDirectory] - encryption: AccountEncryption - entraIdConfig: EntraIdConfigPatch - ldapConfiguration: LdapConfigurationPatch - nfsV4IDDomain: str - - - class azure.mgmt.netapp.types.ActiveDirectory(TypedDict, total=False): - key "activeDirectoryId": Optional[str] - key "adName": str - key "aesEncryption": bool - key "allowLocalNfsUsersWithLdap": bool - key "dns": str - key "domain": str - key "encryptDCConnections": bool - key "kdcIP": str - key "ldapOverTLS": bool - key "ldapSearchScope": ForwardRef('LdapSearchScopeOpt', module='types') - key "ldapSigning": bool - key "organizationalUnit": str - key "password": str - key "preferredServersForLdapClient": str - key "serverRootCACertificate": str - key "site": str - key "smbServerName": str - key "status": Union[str, ActiveDirectoryStatus] - key "statusDetails": str - key "username": str - activeDirectoryId: str - adName: str - administrators: list[str] - aesEncryption: bool - allowLocalNfsUsersWithLdap: bool - backupOperators: list[str] - dns: str - domain: str - encryptDCConnections: bool - kdcIP: str - ldapOverTLS: bool - ldapSearchScope: LdapSearchScopeOpt - ldapSigning: bool - organizationalUnit: str - password: str - preferredServersForLdapClient: str - securityOperators: list[str] - serverRootCACertificate: str - site: str - smbServerName: str - status: Union[str, ActiveDirectoryStatus] - statusDetails: str - username: str - - - class azure.mgmt.netapp.types.ActiveDirectoryConfig(TrackedResource): - key "etag": str - key "id": str - key "identity": ForwardRef('ManagedServiceIdentity', module='types') - key "location": Required[str] - key "name": str - key "properties": ForwardRef('ActiveDirectoryConfigProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - identity: ManagedServiceIdentity - location: str - name: str - properties: ActiveDirectoryConfigProperties - systemData: SystemData - tags: dict[str, str] - type: str - - - class azure.mgmt.netapp.types.ActiveDirectoryConfigProperties(TypedDict, total=False): - key "activeDirectoryStatus": Union[str, ActiveDirectoryStatus] - key "domain": Required[str] - key "organizationalUnit": str - key "provisioningState": Union[str, NetAppProvisioningState] - key "secretPassword": Required[SecretPassword] - key "site": Required[str] - key "smbServerName": str - key "userName": str - activeDirectoryStatus: Union[str, ActiveDirectoryStatus] - administrators: list[str] - backupOperators: list[str] - dns: list[str] - domain: str - organizationalUnit: str - provisioningState: Union[str, NetAppProvisioningState] - secretPassword: SecretPassword - securityOperators: list[str] - site: str - smbServerName: str - userName: str - - - class azure.mgmt.netapp.types.ActiveDirectoryConfigUpdate(TypedDict, total=False): - key "identity": ForwardRef('ManagedServiceIdentity', module='types') - key "properties": ForwardRef('ActiveDirectoryConfigUpdateProperties', module='types') - identity: ManagedServiceIdentity - properties: ActiveDirectoryConfigUpdateProperties - tags: dict[str, str] - - - class azure.mgmt.netapp.types.ActiveDirectoryConfigUpdateProperties(TypedDict, total=False): - key "domain": str - key "organizationalUnit": str - key "secretPassword": ForwardRef('SecretPassword', module='types') - key "site": str - key "smbServerName": str - key "userName": str - administrators: list[str] - backupOperators: list[str] - dns: list[str] - domain: str - organizationalUnit: str - secretPassword: SecretPassword - securityOperators: list[str] - site: str - smbServerName: str - userName: str - - - class azure.mgmt.netapp.types.AuthorizeRequest(TypedDict, total=False): - key "remoteVolumeResourceId": str - remoteVolumeResourceId: str - - - class azure.mgmt.netapp.types.AzureKeyVaultDetails(TypedDict, total=False): - key "certificateAkvDetails": ForwardRef('CertificateAkvDetails', module='types') - key "credentialsAkvDetails": ForwardRef('CredentialsAkvDetails', module='types') - certificateAkvDetails: CertificateAkvDetails - credentialsAkvDetails: CredentialsAkvDetails - - - class azure.mgmt.netapp.types.Backup(ProxyResource): - key "id": str - key "name": str - key "properties": Required[BackupProperties] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - name: str - properties: BackupProperties - systemData: SystemData - type: str - - - class azure.mgmt.netapp.types.BackupPatch(TypedDict, total=False): - key "properties": ForwardRef('BackupPatchProperties', module='types') - properties: BackupPatchProperties - - - class azure.mgmt.netapp.types.BackupPatchProperties(TypedDict, total=False): - key "label": str - label: str - - - class azure.mgmt.netapp.types.BackupPolicy(TrackedResource): - key "etag": str - key "id": str - key "location": Required[str] - key "name": str - key "properties": Required[BackupPolicyProperties] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - location: str - name: str - properties: BackupPolicyProperties - systemData: SystemData - tags: dict[str, str] - type: str - - - class azure.mgmt.netapp.types.BackupPolicyPatch(TypedDict, total=False): - key "id": str - key "location": str - key "name": str - key "properties": ForwardRef('BackupPolicyProperties', module='types') - key "type": str - id: str - location: str - name: str - properties: BackupPolicyProperties - tags: dict[str, str] - type: str - - - class azure.mgmt.netapp.types.BackupPolicyProperties(TypedDict, total=False): - key "backupPolicyId": str - key "dailyBackupsToKeep": int - key "enabled": bool - key "monthlyBackupsToKeep": int - key "provisioningState": str - key "volumesAssigned": int - key "weeklyBackupsToKeep": int - backupPolicyId: str - dailyBackupsToKeep: int - enabled: bool - monthlyBackupsToKeep: int - provisioningState: str - volumeBackups: list[VolumeBackups] - volumesAssigned: int - weeklyBackupsToKeep: int - - - class azure.mgmt.netapp.types.BackupProperties(TypedDict, total=False): - key "backupId": str - key "backupPolicyResourceId": str - key "backupType": Union[str, BackupType] - key "completionDate": Optional[str] - key "creationDate": str - key "failureReason": str - key "isLargeVolume": bool - key "label": str - key "provisioningState": str - key "size": int - key "snapshotCreationDate": Optional[str] - key "snapshotName": str - key "useExistingSnapshot": bool - key "volumeResourceId": Required[str] - backupId: str - backupPolicyResourceId: str - backupType: Union[str, BackupType] - completionDate: str - creationDate: str - failureReason: str - isLargeVolume: bool - label: str - provisioningState: str - size: int - snapshotCreationDate: str - snapshotName: str - useExistingSnapshot: bool - volumeResourceId: str - - - class azure.mgmt.netapp.types.BackupRestoreFiles(TypedDict, total=False): - key "destinationVolumeId": Required[str] - key "fileList": Required[list[str]] - key "restoreFilePath": str - destinationVolumeId: str - fileList: list[str] - restoreFilePath: str - - - class azure.mgmt.netapp.types.BackupVault(TrackedResource): - key "id": str - key "location": Required[str] - key "name": str - key "properties": ForwardRef('BackupVaultProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - location: str - name: str - properties: BackupVaultProperties - systemData: SystemData - tags: dict[str, str] - type: str - - - class azure.mgmt.netapp.types.BackupVaultPatch(TypedDict, total=False): - tags: dict[str, str] - - - class azure.mgmt.netapp.types.BackupVaultProperties(TypedDict, total=False): - key "provisioningState": str - provisioningState: str - - - class azure.mgmt.netapp.types.BackupsMigrationRequest(TypedDict, total=False): - key "backupVaultId": Required[str] - backupVaultId: str - - - class azure.mgmt.netapp.types.BindPasswordAkvConfig(TypedDict, total=False): - key "azureKeyVaultUri": Required[str] - key "secretName": Required[str] - key "userAssignedIdentity": str - azureKeyVaultUri: str - secretName: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.BindPasswordAkvConfigPatch(TypedDict, total=False): - key "azureKeyVaultUri": str - key "secretName": str - key "userAssignedIdentity": str - azureKeyVaultUri: str - secretName: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.BreakFileLocksRequest(TypedDict, total=False): - key "clientIp": str - key "confirmRunningDisruptiveOperation": bool - clientIp: str - confirmRunningDisruptiveOperation: bool - - - class azure.mgmt.netapp.types.BreakReplicationRequest(TypedDict, total=False): - key "forceBreakReplication": bool - forceBreakReplication: bool - - - class azure.mgmt.netapp.types.Bucket(ProxyResource): - key "id": str - key "name": str - key "properties": ForwardRef('BucketProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - name: str - properties: BucketProperties - systemData: SystemData - type: str - - - class azure.mgmt.netapp.types.BucketCredentialsExpiry(TypedDict, total=False): - key "keyPairExpiryDays": int - keyPairExpiryDays: int - - - class azure.mgmt.netapp.types.BucketPatch(ProxyResource): - key "id": str - key "name": str - key "properties": ForwardRef('BucketPatchProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - name: str - properties: BucketPatchProperties - systemData: SystemData - type: str - - - class azure.mgmt.netapp.types.BucketPatchProperties(TypedDict, total=False): - key "akvDetails": ForwardRef('AzureKeyVaultDetails', module='types') - key "fileSystemUser": ForwardRef('FileSystemUser', module='types') - key "permissions": Union[str, BucketPatchPermissions] - key "provisioningState": Union[str, NetAppProvisioningState] - key "server": ForwardRef('BucketServerPatchProperties', module='types') - akvDetails: AzureKeyVaultDetails - fileSystemUser: FileSystemUser - permissions: Union[str, BucketPatchPermissions] - provisioningState: Union[str, NetAppProvisioningState] - server: BucketServerPatchProperties - - - class azure.mgmt.netapp.types.BucketProperties(TypedDict, total=False): - key "akvDetails": ForwardRef('AzureKeyVaultDetails', module='types') - key "fileSystemUser": ForwardRef('FileSystemUser', module='types') - key "path": str - key "permissions": Union[str, BucketPermissions] - key "provisioningState": Union[str, NetAppProvisioningState] - key "server": ForwardRef('BucketServerProperties', module='types') - key "status": Union[str, CredentialsStatus] - akvDetails: AzureKeyVaultDetails - fileSystemUser: FileSystemUser - path: str - permissions: Union[str, BucketPermissions] - provisioningState: Union[str, NetAppProvisioningState] - server: BucketServerProperties - status: Union[str, CredentialsStatus] - - - class azure.mgmt.netapp.types.BucketServerPatchProperties(TypedDict, total=False): - key "certificateObject": str - key "fqdn": str - key "onCertificateConflictAction": Union[str, OnCertificateConflictAction] - certificateObject: str - fqdn: str - onCertificateConflictAction: Union[str, OnCertificateConflictAction] - - - class azure.mgmt.netapp.types.BucketServerProperties(TypedDict, total=False): - key "certificateCommonName": str - key "certificateExpiryDate": str - key "certificateObject": str - key "fqdn": str - key "ipAddress": str - key "onCertificateConflictAction": Union[str, OnCertificateConflictAction] - certificateCommonName: str - certificateExpiryDate: str - certificateObject: str - fqdn: str - ipAddress: str - onCertificateConflictAction: Union[str, OnCertificateConflictAction] - - - class azure.mgmt.netapp.types.Cache(TrackedResource): - key "etag": str - key "id": str - key "location": Required[str] - key "name": str - key "properties": Required[CacheProperties] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - location: str - name: str - properties: CacheProperties - systemData: SystemData - tags: dict[str, str] - type: str - zones: list[str] - - - class azure.mgmt.netapp.types.CacheMountTargetProperties(TypedDict, total=False): - key "ipAddress": str - key "mountTargetId": str - key "smbServerFqdn": str - ipAddress: str - mountTargetId: str - smbServerFqdn: str - - - class azure.mgmt.netapp.types.CacheProperties(TypedDict, total=False): - key "actualThroughputMibps": float - key "cacheState": Union[str, CacheLifeCycleState] - key "cacheSubnetResourceId": Required[str] - key "cifsChangeNotifications": Union[str, CifsChangeNotifyState] - key "encryption": Union[str, EncryptionState] - key "encryptionKeySource": Required[Union[str, EncryptionKeySource]] - key "exportPolicy": ForwardRef('CachePropertiesExportPolicy', module='types') - key "fileAccessLogs": Union[str, CacheFileAccessLogs] - key "filePath": Required[str] - key "globalFileLocking": Union[str, GlobalFileLockingState] - key "kerberos": Union[str, KerberosState] - key "keyVaultPrivateEndpointResourceId": str - key "language": Union[str, VolumeLanguage] - key "ldap": Union[str, LdapState] - key "ldapServerType": Union[str, LdapServerType] - key "maximumNumberOfFiles": int - key "originClusterInformation": Required[OriginClusterInformation] - key "peeringSubnetResourceId": Required[str] - key "provisioningState": Union[str, CacheProvisioningState] - key "size": Required[int] - key "smbSettings": ForwardRef('SmbSettings', module='types') - key "throughputMibps": float - key "writeBack": Union[str, EnableWriteBackState] - actualThroughputMibps: float - cacheState: Union[str, CacheLifeCycleState] - cacheSubnetResourceId: str - cifsChangeNotifications: Union[str, CifsChangeNotifyState] - encryption: Union[str, EncryptionState] - encryptionKeySource: Union[str, EncryptionKeySource] - exportPolicy: CachePropertiesExportPolicy - fileAccessLogs: Union[str, CacheFileAccessLogs] - filePath: str - globalFileLocking: Union[str, GlobalFileLockingState] - kerberos: Union[str, KerberosState] - keyVaultPrivateEndpointResourceId: str - language: Union[str, VolumeLanguage] - ldap: Union[str, LdapState] - ldapServerType: Union[str, LdapServerType] - maximumNumberOfFiles: int - mountTargets: list[CacheMountTargetProperties] - originClusterInformation: OriginClusterInformation - peeringSubnetResourceId: str - protocolTypes: list[Union[str, ProtocolTypes]] - provisioningState: Union[str, CacheProvisioningState] - size: int - smbSettings: SmbSettings - throughputMibps: float - writeBack: Union[str, EnableWriteBackState] - - - class azure.mgmt.netapp.types.CachePropertiesExportPolicy(TypedDict, total=False): - rules: list[ExportPolicyRule] - - - class azure.mgmt.netapp.types.CacheUpdate(TypedDict, total=False): - key "properties": ForwardRef('CacheUpdateProperties', module='types') - properties: CacheUpdateProperties - tags: dict[str, str] - - - class azure.mgmt.netapp.types.CacheUpdateProperties(TypedDict, total=False): - key "cifsChangeNotifications": Union[str, CifsChangeNotifyState] - key "exportPolicy": ForwardRef('CachePropertiesExportPolicy', module='types') - key "keyVaultPrivateEndpointResourceId": str - key "size": int - key "smbSettings": ForwardRef('SmbSettings', module='types') - key "throughputMibps": float - key "writeBack": Union[str, EnableWriteBackState] - cifsChangeNotifications: Union[str, CifsChangeNotifyState] - exportPolicy: CachePropertiesExportPolicy - keyVaultPrivateEndpointResourceId: str - protocolTypes: list[Union[str, ProtocolTypes]] - size: int - smbSettings: SmbSettings - throughputMibps: float - writeBack: Union[str, EnableWriteBackState] - - - class azure.mgmt.netapp.types.CapacityPool(TrackedResource): - key "etag": str - key "id": str - key "location": Required[str] - key "name": str - key "properties": Required[PoolProperties] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - location: str - name: str - properties: PoolProperties - systemData: SystemData - tags: dict[str, str] - type: str - - - class azure.mgmt.netapp.types.CapacityPoolPatch(TypedDict, total=False): - key "id": str - key "location": str - key "name": str - key "properties": ForwardRef('PoolPatchProperties', module='types') - key "type": str - id: str - location: str - name: str - properties: PoolPatchProperties - tags: dict[str, str] - type: str - - - class azure.mgmt.netapp.types.CertificateAkvDetails(TypedDict, total=False): - key "certificateKeyVaultUri": str - key "certificateName": str - key "userAssignedIdentity": str - certificateKeyVaultUri: str - certificateName: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.ChangeKeyVault(TypedDict, total=False): - key "keyName": Required[str] - key "keyVaultPrivateEndpoints": Required[list[KeyVaultPrivateEndpoint]] - key "keyVaultResourceId": str - key "keyVaultUri": Required[str] - keyName: str - keyVaultPrivateEndpoints: list[KeyVaultPrivateEndpoint] - keyVaultResourceId: str - keyVaultUri: str - - - class azure.mgmt.netapp.types.ChangeZoneRequest(TypedDict, total=False): - key "newZone": Required[str] - newZone: str - - - class azure.mgmt.netapp.types.CheckElasticVolumeFilePathAvailabilityRequest(TypedDict, total=False): - key "filePath": Required[str] - filePath: str + class azure.mgmt.netapp.types.AccountPropertiesPatch(TypedDict, total=False): + key "encryption": ForwardRef('AccountEncryptionPatch', module='types') + key "ldapConfiguration": ForwardRef('LdapConfigurationPatch', module='types') + key "nfsV4IDDomain": Optional[str] + activeDirectories: list[ActiveDirectoryPatch] + encryption: AccountEncryptionPatch + ldapConfiguration: LdapConfigurationPatch + nfsV4IDDomain: str - class azure.mgmt.netapp.types.CifsUser(TypedDict, total=False): + class azure.mgmt.netapp.types.ActiveDirectory(TypedDict, total=False): + key "activeDirectoryId": Optional[str] + key "adName": str + key "aesEncryption": bool + key "allowLocalNfsUsersWithLdap": bool + key "dns": str + key "domain": str + key "encryptDCConnections": bool + key "kdcIP": str + key "ldapOverTLS": bool + key "ldapSearchScope": ForwardRef('LdapSearchScopeOpt', module='types') + key "ldapSigning": bool + key "organizationalUnit": str + key "password": str + key "preferredServersForLdapClient": str + key "serverRootCACertificate": str + key "site": str + key "smbServerName": str + key "status": Union[str, ActiveDirectoryStatus] + key "statusDetails": str key "username": str + activeDirectoryId: str + adName: str + administrators: list[str] + aesEncryption: bool + allowLocalNfsUsersWithLdap: bool + backupOperators: list[str] + dns: str + domain: str + encryptDCConnections: bool + kdcIP: str + ldapOverTLS: bool + ldapSearchScope: LdapSearchScopeOpt + ldapSigning: bool + organizationalUnit: str + password: str + preferredServersForLdapClient: str + securityOperators: list[str] + serverRootCACertificate: str + site: str + smbServerName: str + status: Union[str, ActiveDirectoryStatus] + statusDetails: str username: str - class azure.mgmt.netapp.types.CredentialsAkvDetails(TypedDict, total=False): - key "credentialsKeyVaultUri": str - key "secretName": str - key "userAssignedIdentity": str - credentialsKeyVaultUri: str - secretName: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.DailySchedule(TypedDict, total=False): - key "hour": int - key "minute": int - key "snapshotsToKeep": int - key "usedBytes": int - hour: int - minute: int - snapshotsToKeep: int - usedBytes: int + class azure.mgmt.netapp.types.ActiveDirectoryPatch(TypedDict, total=False): + key "activeDirectoryId": Optional[str] + key "adName": str + key "aesEncryption": bool + key "allowLocalNfsUsersWithLdap": bool + key "dns": str + key "domain": str + key "encryptDCConnections": bool + key "kdcIP": str + key "ldapOverTLS": bool + key "ldapSearchScope": ForwardRef('LdapSearchScopeOpt', module='types') + key "ldapSigning": bool + key "organizationalUnit": str + key "password": str + key "preferredServersForLdapClient": str + key "serverRootCACertificate": str + key "site": str + key "smbServerName": str + key "username": str + activeDirectoryId: str + adName: str + administrators: list[str] + aesEncryption: bool + allowLocalNfsUsersWithLdap: bool + backupOperators: list[str] + dns: str + domain: str + encryptDCConnections: bool + kdcIP: str + ldapOverTLS: bool + ldapSearchScope: LdapSearchScopeOpt + ldapSigning: bool + organizationalUnit: str + password: str + preferredServersForLdapClient: str + securityOperators: list[str] + serverRootCACertificate: str + site: str + smbServerName: str + username: str - class azure.mgmt.netapp.types.DestinationReplication(TypedDict, total=False): - key "region": str - key "replicationType": Union[str, ReplicationType] - key "resourceId": str - key "zone": str - region: str - replicationType: Union[str, ReplicationType] - resourceId: str - zone: str + class azure.mgmt.netapp.types.AuthorizeRequest(TypedDict, total=False): + key "remoteVolumeResourceId": str + remoteVolumeResourceId: str + + + class azure.mgmt.netapp.types.AzureKeyVaultDetails(TypedDict, total=False): + key "certificateAkvDetails": ForwardRef('CertificateAkvDetails', module='types') + key "credentialsAkvDetails": ForwardRef('CredentialsAkvDetails', module='types') + certificateAkvDetails: CertificateAkvDetails + credentialsAkvDetails: CredentialsAkvDetails - class azure.mgmt.netapp.types.ElasticAccount(TrackedResource): - key "eTag": str + class azure.mgmt.netapp.types.Backup(ProxyResource): key "id": str - key "identity": ForwardRef('ManagedServiceIdentity', module='types') - key "location": Required[str] key "name": str - key "properties": ForwardRef('ElasticAccountProperties', module='types') + key "properties": Required[BackupProperties] key "systemData": ForwardRef('SystemData', module='types') key "type": str - eTag: str id: str - identity: ManagedServiceIdentity - location: str name: str - properties: ElasticAccountProperties + properties: BackupProperties systemData: SystemData - tags: dict[str, str] type: str - class azure.mgmt.netapp.types.ElasticAccountProperties(TypedDict, total=False): - key "encryption": ForwardRef('ElasticEncryption', module='types') - key "provisioningState": Union[str, NetAppProvisioningState] - encryption: ElasticEncryption - provisioningState: Union[str, NetAppProvisioningState] - - - class azure.mgmt.netapp.types.ElasticAccountUpdate(TypedDict, total=False): - key "identity": ForwardRef('ManagedServiceIdentity', module='types') - key "properties": ForwardRef('ElasticAccountUpdateProperties', module='types') - identity: ManagedServiceIdentity - properties: ElasticAccountUpdateProperties - tags: dict[str, str] + class azure.mgmt.netapp.types.BackupPatch(TypedDict, total=False): + key "properties": ForwardRef('BackupPatchProperties', module='types') + properties: BackupPatchProperties - class azure.mgmt.netapp.types.ElasticAccountUpdateProperties(TypedDict, total=False): - key "encryption": ForwardRef('ElasticEncryption', module='types') - encryption: ElasticEncryption + class azure.mgmt.netapp.types.BackupPatchProperties(TypedDict, total=False): + key "label": str + label: str - class azure.mgmt.netapp.types.ElasticBackup(ProxyResource): + class azure.mgmt.netapp.types.BackupPolicy(TrackedResource): + key "etag": str key "id": str + key "location": Required[str] key "name": str - key "properties": ForwardRef('ElasticBackupProperties', module='types') + key "properties": Required[BackupPolicyProperties] key "systemData": ForwardRef('SystemData', module='types') key "type": str + etag: str id: str + location: str name: str - properties: ElasticBackupProperties + properties: BackupPolicyProperties systemData: SystemData + tags: dict[str, str] type: str - class azure.mgmt.netapp.types.ElasticBackupPolicy(TrackedResource): - key "eTag": str + class azure.mgmt.netapp.types.BackupPolicyPatch(TypedDict, total=False): key "id": str - key "location": Required[str] + key "location": str key "name": str - key "properties": ForwardRef('ElasticBackupPolicyProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') + key "properties": ForwardRef('BackupPolicyProperties', module='types') key "type": str - eTag: str id: str location: str name: str - properties: ElasticBackupPolicyProperties - systemData: SystemData + properties: BackupPolicyProperties tags: dict[str, str] type: str - class azure.mgmt.netapp.types.ElasticBackupPolicyProperties(TypedDict, total=False): - key "assignedVolumesCount": int - key "dailyBackupsToKeep": int - key "monthlyBackupsToKeep": int - key "policyState": Union[str, ElasticBackupPolicyState] - key "provisioningState": Union[str, NetAppProvisioningState] - key "weeklyBackupsToKeep": int - assignedVolumesCount: int - dailyBackupsToKeep: int - monthlyBackupsToKeep: int - policyState: Union[str, ElasticBackupPolicyState] - provisioningState: Union[str, NetAppProvisioningState] - weeklyBackupsToKeep: int - - - class azure.mgmt.netapp.types.ElasticBackupPolicyUpdate(TypedDict, total=False): - key "properties": ForwardRef('ElasticBackupPolicyUpdateProperties', module='types') - properties: ElasticBackupPolicyUpdateProperties - tags: dict[str, str] - - - class azure.mgmt.netapp.types.ElasticBackupPolicyUpdateProperties(TypedDict, total=False): + class azure.mgmt.netapp.types.BackupPolicyProperties(TypedDict, total=False): + key "backupPolicyId": str key "dailyBackupsToKeep": int + key "enabled": bool key "monthlyBackupsToKeep": int - key "policyState": Union[str, ElasticBackupPolicyState] + key "provisioningState": str + key "volumesAssigned": int key "weeklyBackupsToKeep": int + backupPolicyId: str dailyBackupsToKeep: int + enabled: bool monthlyBackupsToKeep: int - policyState: Union[str, ElasticBackupPolicyState] + provisioningState: str + volumeBackups: list[VolumeBackups] + volumesAssigned: int weeklyBackupsToKeep: int - class azure.mgmt.netapp.types.ElasticBackupProperties(TypedDict, total=False): - key "backupType": Union[str, ElasticBackupType] - key "completionDate": str + class azure.mgmt.netapp.types.BackupProperties(TypedDict, total=False): + key "backupId": str + key "backupPolicyResourceId": str + key "backupType": Union[str, BackupType] + key "completionDate": Optional[str] key "creationDate": str - key "elasticBackupPolicyResourceId": str - key "elasticSnapshotResourceId": str - key "elasticVolumeResourceId": Required[str] key "failureReason": str + key "isLargeVolume": bool key "label": str - key "provisioningState": Union[str, NetAppProvisioningState] + key "provisioningState": str key "size": int - key "snapshotCreationDate": str - key "snapshotUsage": Union[str, SnapshotUsage] - key "volumeSize": Union[str, VolumeSize] - backupType: Union[str, ElasticBackupType] + key "snapshotCreationDate": Optional[str] + key "snapshotName": str + key "useExistingSnapshot": bool + key "volumeResourceId": Required[str] + backupId: str + backupPolicyResourceId: str + backupType: Union[str, BackupType] completionDate: str creationDate: str - elasticBackupPolicyResourceId: str - elasticSnapshotResourceId: str - elasticVolumeResourceId: str failureReason: str + isLargeVolume: bool label: str - provisioningState: Union[str, NetAppProvisioningState] + provisioningState: str size: int snapshotCreationDate: str - snapshotUsage: Union[str, SnapshotUsage] - volumeSize: Union[str, VolumeSize] + snapshotName: str + useExistingSnapshot: bool + volumeResourceId: str + + + class azure.mgmt.netapp.types.BackupRestoreFiles(TypedDict, total=False): + key "destinationVolumeId": Required[str] + key "fileList": Required[list[str]] + key "restoreFilePath": str + destinationVolumeId: str + fileList: list[str] + restoreFilePath: str - class azure.mgmt.netapp.types.ElasticBackupVault(TrackedResource): - key "eTag": str + class azure.mgmt.netapp.types.BackupVault(TrackedResource): key "id": str key "location": Required[str] key "name": str - key "properties": ForwardRef('ElasticBackupVaultProperties', module='types') + key "properties": ForwardRef('BackupVaultProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str - eTag: str id: str location: str name: str - properties: ElasticBackupVaultProperties + properties: BackupVaultProperties systemData: SystemData tags: dict[str, str] type: str - class azure.mgmt.netapp.types.ElasticBackupVaultProperties(TypedDict, total=False): - key "provisioningState": Union[str, NetAppProvisioningState] - provisioningState: Union[str, NetAppProvisioningState] + class azure.mgmt.netapp.types.BackupVaultPatch(TypedDict, total=False): + tags: dict[str, str] - class azure.mgmt.netapp.types.ElasticBackupVaultUpdate(TypedDict, total=False): - tags: dict[str, str] + class azure.mgmt.netapp.types.BackupVaultProperties(TypedDict, total=False): + key "provisioningState": str + provisioningState: str - class azure.mgmt.netapp.types.ElasticCapacityPool(TrackedResource): - key "eTag": str - key "id": str - key "location": Required[str] - key "name": str - key "properties": ForwardRef('ElasticCapacityPoolProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - eTag: str - id: str - location: str - name: str - properties: ElasticCapacityPoolProperties - systemData: SystemData - tags: dict[str, str] - type: str - zones: list[str] + class azure.mgmt.netapp.types.BackupsMigrationRequest(TypedDict, total=False): + key "backupVaultId": Required[str] + backupVaultId: str - class azure.mgmt.netapp.types.ElasticCapacityPoolProperties(TypedDict, total=False): - key "activeDirectoryConfigResourceId": str - key "availabilityStatus": Union[str, ElasticResourceAvailabilityStatus] - key "currentZone": str - key "encryption": ForwardRef('ElasticEncryptionConfiguration', module='types') - key "provisioningState": Union[str, NetAppProvisioningState] - key "serviceLevel": Required[Union[str, ElasticServiceLevel]] - key "size": Required[int] - key "subnetResourceId": Required[str] - key "totalThroughputMibps": float - activeDirectoryConfigResourceId: str - availabilityStatus: Union[str, ElasticResourceAvailabilityStatus] - currentZone: str - encryption: ElasticEncryptionConfiguration - provisioningState: Union[str, NetAppProvisioningState] - serviceLevel: Union[str, ElasticServiceLevel] - size: int - subnetResourceId: str - totalThroughputMibps: float + class azure.mgmt.netapp.types.BindPasswordAkvConfig(TypedDict, total=False): + key "azureKeyVaultUri": Required[str] + key "secretName": Required[str] + key "userAssignedIdentity": str + azureKeyVaultUri: str + secretName: str + userAssignedIdentity: str - class azure.mgmt.netapp.types.ElasticCapacityPoolUpdate(TypedDict, total=False): - key "properties": ForwardRef('ElasticCapacityPoolUpdateProperties', module='types') - properties: ElasticCapacityPoolUpdateProperties - tags: dict[str, str] + class azure.mgmt.netapp.types.BindPasswordAkvConfigPatch(TypedDict, total=False): + key "azureKeyVaultUri": str + key "secretName": str + key "userAssignedIdentity": str + azureKeyVaultUri: str + secretName: str + userAssignedIdentity: str - class azure.mgmt.netapp.types.ElasticCapacityPoolUpdateProperties(TypedDict, total=False): - key "activeDirectoryConfigResourceId": str - key "encryption": ForwardRef('ElasticEncryptionConfiguration', module='types') - key "size": int - activeDirectoryConfigResourceId: str - encryption: ElasticEncryptionConfiguration - size: int + class azure.mgmt.netapp.types.BreakFileLocksRequest(TypedDict, total=False): + key "clientIp": str + key "confirmRunningDisruptiveOperation": bool + clientIp: str + confirmRunningDisruptiveOperation: bool - class azure.mgmt.netapp.types.ElasticEncryption(TypedDict, total=False): - key "identity": ForwardRef('ElasticEncryptionIdentity', module='types') - key "keySource": Union[str, KeySource] - key "keyVaultProperties": ForwardRef('ElasticKeyVaultProperties', module='types') - identity: ElasticEncryptionIdentity - keySource: Union[str, KeySource] - keyVaultProperties: ElasticKeyVaultProperties + class azure.mgmt.netapp.types.BreakReplicationRequest(TypedDict, total=False): + key "forceBreakReplication": bool + forceBreakReplication: bool - class azure.mgmt.netapp.types.ElasticEncryptionConfiguration(TypedDict, total=False): - key "elasticPoolEncryptionKeySource": Required[Union[str, ElasticPoolEncryptionKeySource]] - key "keyVaultPrivateEndpointResourceId": Required[str] - elasticPoolEncryptionKeySource: Union[str, ElasticPoolEncryptionKeySource] - keyVaultPrivateEndpointResourceId: str + class azure.mgmt.netapp.types.Bucket(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('BucketProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: BucketProperties + systemData: SystemData + type: str - class azure.mgmt.netapp.types.ElasticEncryptionIdentity(TypedDict, total=False): - key "federatedClientId": str - key "principalId": str - key "userAssignedIdentity": str - federatedClientId: str - principalId: str - userAssignedIdentity: str + class azure.mgmt.netapp.types.BucketCredentialsExpiry(TypedDict, total=False): + key "keyPairExpiryDays": int + keyPairExpiryDays: int - class azure.mgmt.netapp.types.ElasticExportPolicy(TypedDict, total=False): - rules: list[ElasticExportPolicyRule] + class azure.mgmt.netapp.types.BucketPatch(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('BucketPatchProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: BucketPatchProperties + systemData: SystemData + type: str - class azure.mgmt.netapp.types.ElasticExportPolicyRule(TypedDict, total=False): - key "nfsv3": Union[str, ElasticNfsv3Access] - key "nfsv4": Union[str, ElasticNfsv4Access] - key "rootAccess": Union[str, ElasticRootAccess] - key "ruleIndex": int - key "unixAccessRule": Union[str, ElasticUnixAccessRule] - allowedClients: list[str] - nfsv3: Union[str, ElasticNfsv3Access] - nfsv4: Union[str, ElasticNfsv4Access] - rootAccess: Union[str, ElasticRootAccess] - ruleIndex: int - unixAccessRule: Union[str, ElasticUnixAccessRule] + class azure.mgmt.netapp.types.BucketPatchProperties(TypedDict, total=False): + key "akvDetails": ForwardRef('AzureKeyVaultDetails', module='types') + key "fileSystemUser": ForwardRef('FileSystemUser', module='types') + key "permissions": Union[str, BucketPatchPermissions] + key "provisioningState": Union[str, NetAppProvisioningState] + key "server": ForwardRef('BucketServerPatchProperties', module='types') + akvDetails: AzureKeyVaultDetails + fileSystemUser: FileSystemUser + permissions: Union[str, BucketPatchPermissions] + provisioningState: Union[str, NetAppProvisioningState] + server: BucketServerPatchProperties - class azure.mgmt.netapp.types.ElasticKeyVaultProperties(TypedDict, total=False): - key "keyName": str - key "keyVaultResourceId": str - key "keyVaultUri": str - key "status": Union[str, ElasticKeyVaultStatus] - keyName: str - keyVaultResourceId: str - keyVaultUri: str - status: Union[str, ElasticKeyVaultStatus] + class azure.mgmt.netapp.types.BucketProperties(TypedDict, total=False): + key "akvDetails": ForwardRef('AzureKeyVaultDetails', module='types') + key "fileSystemUser": ForwardRef('FileSystemUser', module='types') + key "path": str + key "permissions": Union[str, BucketPermissions] + key "provisioningState": Union[str, NetAppProvisioningState] + key "server": ForwardRef('BucketServerProperties', module='types') + key "status": Union[str, CredentialsStatus] + akvDetails: AzureKeyVaultDetails + fileSystemUser: FileSystemUser + path: str + permissions: Union[str, BucketPermissions] + provisioningState: Union[str, NetAppProvisioningState] + server: BucketServerProperties + status: Union[str, CredentialsStatus] + + + class azure.mgmt.netapp.types.BucketServerPatchProperties(TypedDict, total=False): + key "certificateObject": str + key "fqdn": str + key "onCertificateConflictAction": Union[str, OnCertificateConflictAction] + certificateObject: str + fqdn: str + onCertificateConflictAction: Union[str, OnCertificateConflictAction] - class azure.mgmt.netapp.types.ElasticMountTargetProperties(TypedDict, total=False): + class azure.mgmt.netapp.types.BucketServerProperties(TypedDict, total=False): + key "certificateCommonName": str + key "certificateExpiryDate": str + key "certificateObject": str + key "fqdn": str key "ipAddress": str - key "smbServerFqdn": str + key "onCertificateConflictAction": Union[str, OnCertificateConflictAction] + certificateCommonName: str + certificateExpiryDate: str + certificateObject: str + fqdn: str ipAddress: str - smbServerFqdn: str - - - class azure.mgmt.netapp.types.ElasticSmbPatchProperties(TypedDict, total=False): - key "smbEncryption": Union[str, ElasticSmbEncryption] - smbEncryption: Union[str, ElasticSmbEncryption] - - - class azure.mgmt.netapp.types.ElasticSmbProperties(TypedDict, total=False): - key "smbEncryption": Union[str, ElasticSmbEncryption] - smbEncryption: Union[str, ElasticSmbEncryption] - - - class azure.mgmt.netapp.types.ElasticSnapshot(ProxyResource): - key "id": str - key "name": str - key "properties": ForwardRef('ElasticSnapshotProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - name: str - properties: ElasticSnapshotProperties - systemData: SystemData - type: str + onCertificateConflictAction: Union[str, OnCertificateConflictAction] - class azure.mgmt.netapp.types.ElasticSnapshotPolicy(TrackedResource): - key "eTag": str + class azure.mgmt.netapp.types.Cache(TrackedResource): + key "etag": str key "id": str key "location": Required[str] key "name": str - key "properties": ForwardRef('ElasticSnapshotPolicyProperties', module='types') + key "properties": Required[CacheProperties] key "systemData": ForwardRef('SystemData', module='types') key "type": str - eTag: str + etag: str id: str location: str name: str - properties: ElasticSnapshotPolicyProperties + properties: CacheProperties systemData: SystemData tags: dict[str, str] type: str + zones: list[str] - class azure.mgmt.netapp.types.ElasticSnapshotPolicyDailySchedule(TypedDict, total=False): - key "hour": int - key "minute": int - key "snapshotsToKeep": int - hour: int - minute: int - snapshotsToKeep: int - - - class azure.mgmt.netapp.types.ElasticSnapshotPolicyHourlySchedule(TypedDict, total=False): - key "minute": int - key "snapshotsToKeep": int - minute: int - snapshotsToKeep: int + class azure.mgmt.netapp.types.CacheMountTargetProperties(TypedDict, total=False): + key "ipAddress": str + key "mountTargetId": str + key "smbServerFqdn": str + ipAddress: str + mountTargetId: str + smbServerFqdn: str - class azure.mgmt.netapp.types.ElasticSnapshotPolicyMonthlySchedule(TypedDict, total=False): - key "hour": int - key "minute": int - key "snapshotsToKeep": int - daysOfMonth: list[int] - hour: int - minute: int - snapshotsToKeep: int + class azure.mgmt.netapp.types.CacheProperties(TypedDict, total=False): + key "actualThroughputMibps": float + key "cacheState": Union[str, CacheLifeCycleState] + key "cacheSubnetResourceId": Required[str] + key "cifsChangeNotifications": Union[str, CifsChangeNotifyState] + key "encryption": Union[str, EncryptionState] + key "encryptionKeySource": Required[Union[str, EncryptionKeySource]] + key "exportPolicy": ForwardRef('CachePropertiesExportPolicy', module='types') + key "fileAccessLogs": Union[str, CacheFileAccessLogs] + key "filePath": Required[str] + key "globalFileLocking": Union[str, GlobalFileLockingState] + key "kerberos": Union[str, KerberosState] + key "keyVaultPrivateEndpointResourceId": str + key "language": Union[str, VolumeLanguage] + key "ldap": Union[str, LdapState] + key "ldapServerType": Union[str, LdapServerType] + key "maximumNumberOfFiles": int + key "originClusterInformation": Required[OriginClusterInformation] + key "peeringSubnetResourceId": Required[str] + key "provisioningState": Union[str, CacheProvisioningState] + key "size": Required[int] + key "smbSettings": ForwardRef('SmbSettings', module='types') + key "throughputMibps": float + key "writeBack": Union[str, EnableWriteBackState] + actualThroughputMibps: float + cacheState: Union[str, CacheLifeCycleState] + cacheSubnetResourceId: str + cifsChangeNotifications: Union[str, CifsChangeNotifyState] + encryption: Union[str, EncryptionState] + encryptionKeySource: Union[str, EncryptionKeySource] + exportPolicy: CachePropertiesExportPolicy + fileAccessLogs: Union[str, CacheFileAccessLogs] + filePath: str + globalFileLocking: Union[str, GlobalFileLockingState] + kerberos: Union[str, KerberosState] + keyVaultPrivateEndpointResourceId: str + language: Union[str, VolumeLanguage] + ldap: Union[str, LdapState] + ldapServerType: Union[str, LdapServerType] + maximumNumberOfFiles: int + mountTargets: list[CacheMountTargetProperties] + originClusterInformation: OriginClusterInformation + peeringSubnetResourceId: str + protocolTypes: list[Union[str, ProtocolTypes]] + provisioningState: Union[str, CacheProvisioningState] + size: int + smbSettings: SmbSettings + throughputMibps: float + writeBack: Union[str, EnableWriteBackState] - class azure.mgmt.netapp.types.ElasticSnapshotPolicyProperties(TypedDict, total=False): - key "dailySchedule": ForwardRef('ElasticSnapshotPolicyDailySchedule', module='types') - key "hourlySchedule": ForwardRef('ElasticSnapshotPolicyHourlySchedule', module='types') - key "monthlySchedule": ForwardRef('ElasticSnapshotPolicyMonthlySchedule', module='types') - key "policyStatus": Union[str, PolicyStatus] - key "provisioningState": Union[str, NetAppProvisioningState] - key "weeklySchedule": ForwardRef('ElasticSnapshotPolicyWeeklySchedule', module='types') - dailySchedule: ElasticSnapshotPolicyDailySchedule - hourlySchedule: ElasticSnapshotPolicyHourlySchedule - monthlySchedule: ElasticSnapshotPolicyMonthlySchedule - policyStatus: Union[str, PolicyStatus] - provisioningState: Union[str, NetAppProvisioningState] - weeklySchedule: ElasticSnapshotPolicyWeeklySchedule + class azure.mgmt.netapp.types.CachePropertiesExportPolicy(TypedDict, total=False): + rules: list[ExportPolicyRule] - class azure.mgmt.netapp.types.ElasticSnapshotPolicyUpdate(TypedDict, total=False): - key "properties": ForwardRef('ElasticSnapshotPolicyUpdateProperties', module='types') - properties: ElasticSnapshotPolicyUpdateProperties + class azure.mgmt.netapp.types.CacheUpdate(TypedDict, total=False): + key "properties": ForwardRef('CacheUpdateProperties', module='types') + properties: CacheUpdateProperties tags: dict[str, str] - class azure.mgmt.netapp.types.ElasticSnapshotPolicyUpdateProperties(TypedDict, total=False): - key "dailySchedule": ForwardRef('ElasticSnapshotPolicyDailySchedule', module='types') - key "hourlySchedule": ForwardRef('ElasticSnapshotPolicyHourlySchedule', module='types') - key "monthlySchedule": ForwardRef('ElasticSnapshotPolicyMonthlySchedule', module='types') - key "policyStatus": Union[str, PolicyStatus] - key "weeklySchedule": ForwardRef('ElasticSnapshotPolicyWeeklySchedule', module='types') - dailySchedule: ElasticSnapshotPolicyDailySchedule - hourlySchedule: ElasticSnapshotPolicyHourlySchedule - monthlySchedule: ElasticSnapshotPolicyMonthlySchedule - policyStatus: Union[str, PolicyStatus] - weeklySchedule: ElasticSnapshotPolicyWeeklySchedule - - - class azure.mgmt.netapp.types.ElasticSnapshotPolicyWeeklySchedule(TypedDict, total=False): - key "hour": int - key "minute": int - key "snapshotsToKeep": int - days: list[Union[str, DayOfWeek]] - hour: int - minute: int - snapshotsToKeep: int - - - class azure.mgmt.netapp.types.ElasticSnapshotProperties(TypedDict, total=False): - key "provisioningState": Union[str, NetAppProvisioningState] - provisioningState: Union[str, NetAppProvisioningState] + class azure.mgmt.netapp.types.CacheUpdateProperties(TypedDict, total=False): + key "cifsChangeNotifications": Union[str, CifsChangeNotifyState] + key "exportPolicy": ForwardRef('CachePropertiesExportPolicy', module='types') + key "keyVaultPrivateEndpointResourceId": str + key "size": int + key "smbSettings": ForwardRef('SmbSettings', module='types') + key "throughputMibps": float + key "writeBack": Union[str, EnableWriteBackState] + cifsChangeNotifications: Union[str, CifsChangeNotifyState] + exportPolicy: CachePropertiesExportPolicy + keyVaultPrivateEndpointResourceId: str + protocolTypes: list[Union[str, ProtocolTypes]] + size: int + smbSettings: SmbSettings + throughputMibps: float + writeBack: Union[str, EnableWriteBackState] - class azure.mgmt.netapp.types.ElasticVolume(TrackedResource): - key "eTag": str + class azure.mgmt.netapp.types.CapacityPool(TrackedResource): + key "etag": str key "id": str key "location": Required[str] key "name": str - key "properties": ForwardRef('ElasticVolumeProperties', module='types') + key "properties": Required[PoolProperties] key "systemData": ForwardRef('SystemData', module='types') key "type": str - eTag: str + etag: str id: str location: str name: str - properties: ElasticVolumeProperties + properties: PoolProperties systemData: SystemData tags: dict[str, str] type: str - zones: list[str] - - class azure.mgmt.netapp.types.ElasticVolumeBackupProperties(TypedDict, total=False): - key "elasticBackupPolicyResourceId": str - key "elasticBackupVaultResourceId": str - key "policyEnforcement": Union[str, ElasticVolumePolicyEnforcement] - elasticBackupPolicyResourceId: str - elasticBackupVaultResourceId: str - policyEnforcement: Union[str, ElasticVolumePolicyEnforcement] - - class azure.mgmt.netapp.types.ElasticVolumeDataProtectionPatchProperties(TypedDict, total=False): - key "backup": ForwardRef('ElasticVolumeBackupProperties', module='types') - key "snapshot": ForwardRef('ElasticVolumeSnapshotProperties', module='types') - backup: ElasticVolumeBackupProperties - snapshot: ElasticVolumeSnapshotProperties + class azure.mgmt.netapp.types.CapacityPoolPatch(TypedDict, total=False): + key "id": str + key "location": str + key "name": str + key "properties": ForwardRef('PoolPatchProperties', module='types') + key "type": str + id: str + location: str + name: str + properties: PoolPatchProperties + tags: dict[str, str] + type: str - class azure.mgmt.netapp.types.ElasticVolumeDataProtectionProperties(TypedDict, total=False): - key "backup": ForwardRef('ElasticVolumeBackupProperties', module='types') - key "snapshot": ForwardRef('ElasticVolumeSnapshotProperties', module='types') - backup: ElasticVolumeBackupProperties - snapshot: ElasticVolumeSnapshotProperties + class azure.mgmt.netapp.types.CertificateAkvDetails(TypedDict, total=False): + key "certificateKeyVaultUri": str + key "certificateName": str + certificateKeyVaultUri: str + certificateName: str - class azure.mgmt.netapp.types.ElasticVolumeProperties(TypedDict, total=False): - key "availabilityStatus": Union[str, ElasticResourceAvailabilityStatus] - key "backupResourceId": str - key "dataProtection": ForwardRef('ElasticVolumeDataProtectionProperties', module='types') - key "exportPolicy": ForwardRef('ElasticExportPolicy', module='types') - key "filePath": Required[str] - key "protocolTypes": Required[list[Union[str, ElasticProtocolType]]] - key "provisioningState": Union[str, NetAppProvisioningState] - key "restorationState": Union[str, ElasticVolumeRestorationState] - key "size": Required[int] - key "smbProperties": ForwardRef('ElasticSmbProperties', module='types') - key "snapshotDirectoryVisibility": Union[str, SnapshotDirectoryVisibility] - key "snapshotResourceId": str - availabilityStatus: Union[str, ElasticResourceAvailabilityStatus] - backupResourceId: str - dataProtection: ElasticVolumeDataProtectionProperties - exportPolicy: ElasticExportPolicy - filePath: str - mountTargets: list[ElasticMountTargetProperties] - protocolTypes: list[Union[str, ElasticProtocolType]] - provisioningState: Union[str, NetAppProvisioningState] - restorationState: Union[str, ElasticVolumeRestorationState] - size: int - smbProperties: ElasticSmbProperties - snapshotDirectoryVisibility: Union[str, SnapshotDirectoryVisibility] - snapshotResourceId: str + class azure.mgmt.netapp.types.ChangeKeyVault(TypedDict, total=False): + key "keyName": Required[str] + key "keyVaultPrivateEndpoints": Required[list[KeyVaultPrivateEndpoint]] + key "keyVaultResourceId": str + key "keyVaultUri": Required[str] + keyName: str + keyVaultPrivateEndpoints: list[KeyVaultPrivateEndpoint] + keyVaultResourceId: str + keyVaultUri: str - class azure.mgmt.netapp.types.ElasticVolumeRevert(TypedDict, total=False): - key "snapshotResourceId": str - snapshotResourceId: str + class azure.mgmt.netapp.types.CifsUser(TypedDict, total=False): + key "username": str + username: str - class azure.mgmt.netapp.types.ElasticVolumeSnapshotProperties(TypedDict, total=False): - key "snapshotPolicyResourceId": str - snapshotPolicyResourceId: str + class azure.mgmt.netapp.types.CredentialsAkvDetails(TypedDict, total=False): + key "credentialsKeyVaultUri": str + key "secretName": str + credentialsKeyVaultUri: str + secretName: str - class azure.mgmt.netapp.types.ElasticVolumeUpdate(TypedDict, total=False): - key "properties": ForwardRef('ElasticVolumeUpdateProperties', module='types') - properties: ElasticVolumeUpdateProperties - tags: dict[str, str] + class azure.mgmt.netapp.types.DailySchedule(TypedDict, total=False): + key "hour": int + key "minute": int + key "snapshotsToKeep": int + key "usedBytes": int + hour: int + minute: int + snapshotsToKeep: int + usedBytes: int - class azure.mgmt.netapp.types.ElasticVolumeUpdateProperties(TypedDict, total=False): - key "dataProtection": ForwardRef('ElasticVolumeDataProtectionPatchProperties', module='types') - key "exportPolicy": ForwardRef('ElasticExportPolicy', module='types') - key "size": int - key "smbProperties": ForwardRef('ElasticSmbPatchProperties', module='types') - key "snapshotDirectoryVisibility": Union[str, SnapshotDirectoryVisibility] - dataProtection: ElasticVolumeDataProtectionPatchProperties - exportPolicy: ElasticExportPolicy - size: int - smbProperties: ElasticSmbPatchProperties - snapshotDirectoryVisibility: Union[str, SnapshotDirectoryVisibility] + class azure.mgmt.netapp.types.DestinationReplication(TypedDict, total=False): + key "region": str + key "replicationType": Union[str, ReplicationType] + key "resourceId": str + key "zone": str + region: str + replicationType: Union[str, ReplicationType] + resourceId: str + zone: str class azure.mgmt.netapp.types.EncryptionIdentity(TypedDict, total=False): @@ -14107,6 +10245,13 @@ namespace azure.mgmt.netapp.types userAssignedIdentity: str + class azure.mgmt.netapp.types.EncryptionIdentityPatch(TypedDict, total=False): + key "federatedClientId": str + key "userAssignedIdentity": str + federatedClientId: str + userAssignedIdentity: str + + class azure.mgmt.netapp.types.EncryptionTransitionRequest(TypedDict, total=False): key "privateEndpointId": Required[str] key "virtualNetworkId": Required[str] @@ -14114,46 +10259,6 @@ namespace azure.mgmt.netapp.types virtualNetworkId: str - class azure.mgmt.netapp.types.EntraIdAkvConfig(TypedDict, total=False): - key "azureKeyVaultUri": Required[str] - key "certificateName": Required[str] - key "userAssignedIdentity": str - azureKeyVaultUri: str - certificateName: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.EntraIdAkvConfigPatch(TypedDict, total=False): - key "azureKeyVaultUri": str - key "certificateName": str - key "userAssignedIdentity": str - azureKeyVaultUri: str - certificateName: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.EntraIdConfig(TypedDict, total=False): - key "applicationId": Required[str] - key "domain": Required[str] - key "entraIdAkvConfig": ForwardRef('EntraIdAkvConfig', module='types') - key "serverNamePrefix": Required[str] - applicationId: str - domain: str - entraIdAkvConfig: EntraIdAkvConfig - serverNamePrefix: str - - - class azure.mgmt.netapp.types.EntraIdConfigPatch(TypedDict, total=False): - key "applicationId": str - key "domain": str - key "entraIdAkvConfig": ForwardRef('EntraIdAkvConfigPatch', module='types') - key "serverNamePrefix": str - applicationId: str - domain: str - entraIdAkvConfig: EntraIdAkvConfigPatch - serverNamePrefix: str - - class azure.mgmt.netapp.types.ExportPolicyRule(TypedDict, total=False): key "allowedClients": str key "chownMode": Union[str, ChownMode] @@ -14237,6 +10342,15 @@ namespace azure.mgmt.netapp.types status: Union[str, KeyVaultStatus] + class azure.mgmt.netapp.types.KeyVaultPropertiesPatch(TypedDict, total=False): + key "keyName": str + key "keyVaultResourceId": str + key "keyVaultUri": str + keyName: str + keyVaultResourceId: str + keyVaultUri: str + + class azure.mgmt.netapp.types.LdapConfiguration(TypedDict, total=False): key "bindAuthenticationLevel": Union[str, BindAuthenticationLevel] key "bindDN": str @@ -14554,27 +10668,6 @@ namespace azure.mgmt.netapp.types type: Union[str, CheckNameResourceTypes] - class azure.mgmt.netapp.types.SecretPassword(TypedDict, total=False): - key "identity": ForwardRef('SecretPasswordIdentity', module='types') - key "keyVaultProperties": ForwardRef('SecretPasswordKeyVaultProperties', module='types') - identity: SecretPasswordIdentity - keyVaultProperties: SecretPasswordKeyVaultProperties - - - class azure.mgmt.netapp.types.SecretPasswordIdentity(TypedDict, total=False): - key "principalId": str - key "userAssignedIdentity": str - principalId: str - userAssignedIdentity: str - - - class azure.mgmt.netapp.types.SecretPasswordKeyVaultProperties(TypedDict, total=False): - key "keyVaultUri": Required[str] - key "secretName": Required[str] - keyVaultUri: str - secretName: str - - class azure.mgmt.netapp.types.SmbSettings(TypedDict, total=False): key "smbAccessBasedEnumeration": Union[str, SmbAccessBasedEnumeration] key "smbEncryption": Union[str, SmbEncryptionState] @@ -14929,10 +11022,7 @@ namespace azure.mgmt.netapp.types key "isRestoring": bool key "kerberosEnabled": bool key "keyVaultPrivateEndpointResourceId": str - key "language": Union[str, VolumeLanguage] - key "largeVolumeType": Union[str, LargeVolumeType] key "ldapEnabled": bool - key "ldapServerType": Union[str, LdapServerType] key "maximumNumberOfFiles": int key "networkFeatures": Union[str, NetworkFeatures] key "networkSiblingSetId": str @@ -14988,10 +11078,7 @@ namespace azure.mgmt.netapp.types isRestoring: bool kerberosEnabled: bool keyVaultPrivateEndpointResourceId: str - language: Union[str, VolumeLanguage] - largeVolumeType: Union[str, LargeVolumeType] ldapEnabled: bool - ldapServerType: Union[str, LdapServerType] maximumNumberOfFiles: int mountTargets: list[MountTargetProperties] networkFeatures: Union[str, NetworkFeatures] diff --git a/sdk/netapp/azure-mgmt-netapp/api.metadata.yml b/sdk/netapp/azure-mgmt-netapp/api.metadata.yml index 3eae3ae97c6e..697365222cb6 100644 --- a/sdk/netapp/azure-mgmt-netapp/api.metadata.yml +++ b/sdk/netapp/azure-mgmt-netapp/api.metadata.yml @@ -1,3 +1,4 @@ -apiMdSha256: 072caa248ad8c870b3d79de31ccf442d8ec0a9792fe4087e963913fd942bfa80 +apiHash: 0fbc46d284c7ee9a2c2690bd17071fe1cc0da60194bdb624dff818743a65425e +packageVersion: 18.0.0 parserVersion: 0.3.31 -pythonVersion: 3.13.15 +pythonVersion: 3.13.16 diff --git a/sdk/netapp/azure-mgmt-netapp/apiview-properties.json b/sdk/netapp/azure-mgmt-netapp/apiview-properties.json index 65a6b0c12b33..1be0411539f4 100644 --- a/sdk/netapp/azure-mgmt-netapp/apiview-properties.json +++ b/sdk/netapp/azure-mgmt-netapp/apiview-properties.json @@ -2,21 +2,19 @@ "CrossLanguagePackageId": "Microsoft.NetApp", "CrossLanguageDefinitionId": { "azure.mgmt.netapp.models.AccountEncryption": "Microsoft.NetApp.AccountEncryption", + "azure.mgmt.netapp.models.AccountEncryptionPatch": "Microsoft.NetApp.AccountEncryptionPatch", "azure.mgmt.netapp.models.AccountProperties": "Microsoft.NetApp.AccountProperties", "azure.mgmt.netapp.models.AccountPropertiesPatch": "Microsoft.NetApp.AccountPropertiesPatch", "azure.mgmt.netapp.models.ActiveDirectory": "Microsoft.NetApp.ActiveDirectory", - "azure.mgmt.netapp.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", - "azure.mgmt.netapp.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", - "azure.mgmt.netapp.models.ActiveDirectoryConfig": "Microsoft.NetApp.ActiveDirectoryConfig", - "azure.mgmt.netapp.models.ActiveDirectoryConfigProperties": "Microsoft.NetApp.ActiveDirectoryConfigProperties", - "azure.mgmt.netapp.models.ActiveDirectoryConfigUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ActiveDirectoryConfigUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.netapp.models.ActiveDirectoryPatch": "Microsoft.NetApp.ActiveDirectoryPatch", "azure.mgmt.netapp.models.AuthorizeRequest": "Microsoft.NetApp.AuthorizeRequest", "azure.mgmt.netapp.models.AzureKeyVaultDetails": "Microsoft.NetApp.AzureKeyVaultDetails", + "azure.mgmt.netapp.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.netapp.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", "azure.mgmt.netapp.models.Backup": "Microsoft.NetApp.Backup", "azure.mgmt.netapp.models.BackupPatch": "Microsoft.NetApp.BackupPatch", "azure.mgmt.netapp.models.BackupPatchProperties": "Microsoft.NetApp.BackupPatchProperties", + "azure.mgmt.netapp.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.netapp.models.BackupPolicy": "Microsoft.NetApp.BackupPolicy", "azure.mgmt.netapp.models.BackupPolicyPatch": "Microsoft.NetApp.BackupPolicyPatch", "azure.mgmt.netapp.models.BackupPolicyProperties": "Microsoft.NetApp.BackupPolicyProperties", @@ -49,10 +47,7 @@ "azure.mgmt.netapp.models.CapacityPoolPatch": "Microsoft.NetApp.CapacityPoolPatch", "azure.mgmt.netapp.models.CertificateAkvDetails": "Microsoft.NetApp.CertificateAkvDetails", "azure.mgmt.netapp.models.ChangeKeyVault": "Microsoft.NetApp.ChangeKeyVault", - "azure.mgmt.netapp.models.ChangeZoneRequest": "Microsoft.NetApp.ChangeZoneRequest", "azure.mgmt.netapp.models.CheckAvailabilityResponse": "Microsoft.NetApp.CheckAvailabilityResponse", - "azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse": "Microsoft.NetApp.CheckElasticResourceAvailabilityResponse", - "azure.mgmt.netapp.models.CheckElasticVolumeFilePathAvailabilityRequest": "Microsoft.NetApp.CheckElasticVolumeFilePathAvailabilityRequest", "azure.mgmt.netapp.models.CifsUser": "Microsoft.NetApp.CifsUser", "azure.mgmt.netapp.models.ClusterPeerCommandResponse": "Microsoft.NetApp.ClusterPeerCommandResponse", "azure.mgmt.netapp.models.ClusterPeerCommandResponseProperties": "Microsoft.NetApp.ClusterPeerCommandResponseProperties", @@ -60,57 +55,9 @@ "azure.mgmt.netapp.models.DailySchedule": "Microsoft.NetApp.DailySchedule", "azure.mgmt.netapp.models.DestinationReplication": "Microsoft.NetApp.DestinationReplication", "azure.mgmt.netapp.models.Dimension": "Microsoft.NetApp.Dimension", - "azure.mgmt.netapp.models.ElasticAccount": "Microsoft.NetApp.ElasticAccount", - "azure.mgmt.netapp.models.ElasticAccountProperties": "Microsoft.NetApp.ElasticAccountProperties", - "azure.mgmt.netapp.models.ElasticAccountUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ElasticAccountUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", - "azure.mgmt.netapp.models.ElasticBackup": "Microsoft.NetApp.ElasticBackup", - "azure.mgmt.netapp.models.ElasticBackupPolicy": "Microsoft.NetApp.ElasticBackupPolicy", - "azure.mgmt.netapp.models.ElasticBackupPolicyProperties": "Microsoft.NetApp.ElasticBackupPolicyProperties", - "azure.mgmt.netapp.models.ElasticBackupPolicyUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ElasticBackupPolicyUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", - "azure.mgmt.netapp.models.ElasticBackupProperties": "Microsoft.NetApp.ElasticBackupProperties", - "azure.mgmt.netapp.models.ElasticBackupVault": "Microsoft.NetApp.ElasticBackupVault", - "azure.mgmt.netapp.models.ElasticBackupVaultProperties": "Microsoft.NetApp.ElasticBackupVaultProperties", - "azure.mgmt.netapp.models.ElasticBackupVaultUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ElasticCapacityPool": "Microsoft.NetApp.ElasticCapacityPool", - "azure.mgmt.netapp.models.ElasticCapacityPoolProperties": "Microsoft.NetApp.ElasticCapacityPoolProperties", - "azure.mgmt.netapp.models.ElasticCapacityPoolUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ElasticCapacityPoolUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", - "azure.mgmt.netapp.models.ElasticEncryption": "Microsoft.NetApp.ElasticEncryption", - "azure.mgmt.netapp.models.ElasticEncryptionConfiguration": "Microsoft.NetApp.ElasticEncryptionConfiguration", - "azure.mgmt.netapp.models.ElasticEncryptionIdentity": "Microsoft.NetApp.ElasticEncryptionIdentity", - "azure.mgmt.netapp.models.ElasticExportPolicy": "Microsoft.NetApp.ElasticExportPolicy", - "azure.mgmt.netapp.models.ElasticExportPolicyRule": "Microsoft.NetApp.ElasticExportPolicyRule", - "azure.mgmt.netapp.models.ElasticKeyVaultProperties": "Microsoft.NetApp.ElasticKeyVaultProperties", - "azure.mgmt.netapp.models.ElasticMountTargetProperties": "Microsoft.NetApp.ElasticMountTargetProperties", - "azure.mgmt.netapp.models.ElasticSmbPatchProperties": "Microsoft.NetApp.ElasticSmbPatchProperties", - "azure.mgmt.netapp.models.ElasticSmbProperties": "Microsoft.NetApp.ElasticSmbProperties", - "azure.mgmt.netapp.models.ElasticSnapshot": "Microsoft.NetApp.ElasticSnapshot", - "azure.mgmt.netapp.models.ElasticSnapshotPolicy": "Microsoft.NetApp.ElasticSnapshotPolicy", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyDailySchedule": "Microsoft.NetApp.ElasticSnapshotPolicyDailySchedule", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyHourlySchedule": "Microsoft.NetApp.ElasticSnapshotPolicyHourlySchedule", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyMonthlySchedule": "Microsoft.NetApp.ElasticSnapshotPolicyMonthlySchedule", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyProperties": "Microsoft.NetApp.ElasticSnapshotPolicyProperties", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", - "azure.mgmt.netapp.models.ElasticSnapshotPolicyWeeklySchedule": "Microsoft.NetApp.ElasticSnapshotPolicyWeeklySchedule", - "azure.mgmt.netapp.models.ElasticSnapshotProperties": "Microsoft.NetApp.ElasticSnapshotProperties", - "azure.mgmt.netapp.models.ElasticVolume": "Microsoft.NetApp.ElasticVolume", - "azure.mgmt.netapp.models.ElasticVolumeBackupProperties": "Microsoft.NetApp.ElasticVolumeBackupProperties", - "azure.mgmt.netapp.models.ElasticVolumeDataProtectionPatchProperties": "Microsoft.NetApp.ElasticVolumeDataProtectionPatchProperties", - "azure.mgmt.netapp.models.ElasticVolumeDataProtectionProperties": "Microsoft.NetApp.ElasticVolumeDataProtectionProperties", - "azure.mgmt.netapp.models.ElasticVolumeProperties": "Microsoft.NetApp.ElasticVolumeProperties", - "azure.mgmt.netapp.models.ElasticVolumeRevert": "Microsoft.NetApp.ElasticVolumeRevert", - "azure.mgmt.netapp.models.ElasticVolumeSnapshotProperties": "Microsoft.NetApp.ElasticVolumeSnapshotProperties", - "azure.mgmt.netapp.models.ElasticVolumeUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.netapp.models.ElasticVolumeUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.netapp.models.EncryptionIdentity": "Microsoft.NetApp.EncryptionIdentity", + "azure.mgmt.netapp.models.EncryptionIdentityPatch": "Microsoft.NetApp.EncryptionIdentityPatch", "azure.mgmt.netapp.models.EncryptionTransitionRequest": "Microsoft.NetApp.EncryptionTransitionRequest", - "azure.mgmt.netapp.models.EntraIdAkvConfig": "Microsoft.NetApp.EntraIdAkvConfig", - "azure.mgmt.netapp.models.EntraIdAkvConfigPatch": "Microsoft.NetApp.EntraIdAkvConfigPatch", - "azure.mgmt.netapp.models.EntraIdConfig": "Microsoft.NetApp.EntraIdConfig", - "azure.mgmt.netapp.models.EntraIdConfigPatch": "Microsoft.NetApp.EntraIdConfigPatch", "azure.mgmt.netapp.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.netapp.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.netapp.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", @@ -124,6 +71,7 @@ "azure.mgmt.netapp.models.HourlySchedule": "Microsoft.NetApp.HourlySchedule", "azure.mgmt.netapp.models.KeyVaultPrivateEndpoint": "Microsoft.NetApp.KeyVaultPrivateEndpoint", "azure.mgmt.netapp.models.KeyVaultProperties": "Microsoft.NetApp.KeyVaultProperties", + "azure.mgmt.netapp.models.KeyVaultPropertiesPatch": "Microsoft.NetApp.KeyVaultPropertiesPatch", "azure.mgmt.netapp.models.LdapConfiguration": "Microsoft.NetApp.LdapConfiguration", "azure.mgmt.netapp.models.LdapConfigurationPatch": "Microsoft.NetApp.LdapConfigurationPatch", "azure.mgmt.netapp.models.LdapSearchScopeOpt": "Microsoft.NetApp.LdapSearchScopeOpt", @@ -173,9 +121,6 @@ "azure.mgmt.netapp.models.ReplicationStatus": "Microsoft.NetApp.ReplicationStatus", "azure.mgmt.netapp.models.ResourceNameAvailabilityRequest": "Microsoft.NetApp.ResourceNameAvailabilityRequest", "azure.mgmt.netapp.models.RestoreStatus": "Microsoft.NetApp.RestoreStatus", - "azure.mgmt.netapp.models.SecretPassword": "Microsoft.NetApp.SecretPassword", - "azure.mgmt.netapp.models.SecretPasswordIdentity": "Microsoft.NetApp.SecretPasswordIdentity", - "azure.mgmt.netapp.models.SecretPasswordKeyVaultProperties": "Microsoft.NetApp.SecretPasswordKeyVaultProperties", "azure.mgmt.netapp.models.ServiceSpecification": "Microsoft.NetApp.ServiceSpecification", "azure.mgmt.netapp.models.SmbSettings": "Microsoft.NetApp.SmbSettings", "azure.mgmt.netapp.models.Snapshot": "Microsoft.NetApp.Snapshot", @@ -244,14 +189,11 @@ "azure.mgmt.netapp.models.SmbAccessBasedEnumeration": "Microsoft.NetApp.SmbAccessBasedEnumeration", "azure.mgmt.netapp.models.SmbNonBrowsable": "Microsoft.NetApp.SmbNonBrowsable", "azure.mgmt.netapp.models.EncryptionKeySource": "Microsoft.NetApp.EncryptionKeySource", - "azure.mgmt.netapp.models.LdapServerType": "Microsoft.NetApp.LdapServerType", "azure.mgmt.netapp.models.CoolAccessRetrievalPolicy": "Microsoft.NetApp.CoolAccessRetrievalPolicy", "azure.mgmt.netapp.models.CoolAccessTieringPolicy": "Microsoft.NetApp.CoolAccessTieringPolicy", "azure.mgmt.netapp.models.FileAccessLogs": "Microsoft.NetApp.FileAccessLogs", "azure.mgmt.netapp.models.AvsDataStore": "Microsoft.NetApp.AvsDataStore", "azure.mgmt.netapp.models.EnableSubvolumes": "Microsoft.NetApp.EnableSubvolumes", - "azure.mgmt.netapp.models.LargeVolumeType": "Microsoft.NetApp.LargeVolumeType", - "azure.mgmt.netapp.models.VolumeLanguage": "Microsoft.NetApp.VolumeLanguage", "azure.mgmt.netapp.models.BreakthroughMode": "Microsoft.NetApp.BreakthroughMode", "azure.mgmt.netapp.models.BackupType": "Microsoft.NetApp.BackupType", "azure.mgmt.netapp.models.VolumeBackupRelationshipStatus": "Microsoft.NetApp.VolumeBackupRelationshipStatus", @@ -273,40 +215,21 @@ "azure.mgmt.netapp.models.KerberosState": "Microsoft.NetApp.KerberosState", "azure.mgmt.netapp.models.SmbEncryptionState": "Microsoft.NetApp.SmbEncryptionState", "azure.mgmt.netapp.models.EncryptionState": "Microsoft.NetApp.EncryptionState", + "azure.mgmt.netapp.models.VolumeLanguage": "Microsoft.NetApp.VolumeLanguage", "azure.mgmt.netapp.models.LdapState": "Microsoft.NetApp.LdapState", + "azure.mgmt.netapp.models.LdapServerType": "Microsoft.NetApp.LdapServerType", "azure.mgmt.netapp.models.CifsChangeNotifyState": "Microsoft.NetApp.CifsChangeNotifyState", "azure.mgmt.netapp.models.GlobalFileLockingState": "Microsoft.NetApp.GlobalFileLockingState", "azure.mgmt.netapp.models.EnableWriteBackState": "Microsoft.NetApp.EnableWriteBackState", "azure.mgmt.netapp.models.CacheFileAccessLogs": "Microsoft.NetApp.CacheFileAccessLogs", - "azure.mgmt.netapp.models.KeySource": "Microsoft.NetApp.KeySource", - "azure.mgmt.netapp.models.ElasticKeyVaultStatus": "Microsoft.NetApp.ElasticKeyVaultStatus", - "azure.mgmt.netapp.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", - "azure.mgmt.netapp.models.ElasticServiceLevel": "Microsoft.NetApp.ElasticServiceLevel", - "azure.mgmt.netapp.models.ElasticPoolEncryptionKeySource": "Microsoft.NetApp.ElasticPoolEncryptionKeySource", - "azure.mgmt.netapp.models.ElasticResourceAvailabilityStatus": "Microsoft.NetApp.ElasticResourceAvailabilityStatus", - "azure.mgmt.netapp.models.CheckElasticResourceAvailabilityStatus": "Microsoft.NetApp.CheckElasticResourceAvailabilityStatus", - "azure.mgmt.netapp.models.CheckElasticResourceAvailabilityReason": "Microsoft.NetApp.CheckElasticResourceAvailabilityReason", - "azure.mgmt.netapp.models.ElasticUnixAccessRule": "Microsoft.NetApp.ElasticUnixAccessRule", - "azure.mgmt.netapp.models.ElasticNfsv3Access": "Microsoft.NetApp.ElasticNfsv3Access", - "azure.mgmt.netapp.models.ElasticNfsv4Access": "Microsoft.NetApp.ElasticNfsv4Access", - "azure.mgmt.netapp.models.ElasticRootAccess": "Microsoft.NetApp.ElasticRootAccess", - "azure.mgmt.netapp.models.ElasticProtocolType": "Microsoft.NetApp.ElasticProtocolType", - "azure.mgmt.netapp.models.ElasticVolumePolicyEnforcement": "Microsoft.NetApp.ElasticVolumePolicyEnforcement", - "azure.mgmt.netapp.models.SnapshotDirectoryVisibility": "Microsoft.NetApp.SnapshotDirectoryVisibility", - "azure.mgmt.netapp.models.ElasticSmbEncryption": "Microsoft.NetApp.ElasticSmbEncryption", - "azure.mgmt.netapp.models.ElasticVolumeRestorationState": "Microsoft.NetApp.ElasticVolumeRestorationState", - "azure.mgmt.netapp.models.DayOfWeek": "Microsoft.NetApp.DayOfWeek", - "azure.mgmt.netapp.models.PolicyStatus": "Microsoft.NetApp.PolicyStatus", - "azure.mgmt.netapp.models.ElasticBackupPolicyState": "Microsoft.NetApp.ElasticBackupPolicyState", - "azure.mgmt.netapp.models.ElasticBackupType": "Microsoft.NetApp.ElasticBackupType", - "azure.mgmt.netapp.models.SnapshotUsage": "Microsoft.NetApp.SnapshotUsage", - "azure.mgmt.netapp.models.VolumeSize": "Microsoft.NetApp.VolumeSize", - "azure.mgmt.netapp.models.ActiveDirectoryStatus": "Microsoft.NetApp.ActiveDirectoryStatus", "azure.mgmt.netapp.models.RegionStorageToNetworkProximity": "Microsoft.NetApp.RegionStorageToNetworkProximity", + "azure.mgmt.netapp.models.ActiveDirectoryStatus": "Microsoft.NetApp.ActiveDirectoryStatus", + "azure.mgmt.netapp.models.KeySource": "Microsoft.NetApp.KeySource", "azure.mgmt.netapp.models.KeyVaultStatus": "Microsoft.NetApp.KeyVaultStatus", "azure.mgmt.netapp.models.MultiAdStatus": "Microsoft.NetApp.MultiAdStatus", "azure.mgmt.netapp.models.SecureLdapType": "Microsoft.NetApp.SecureLdapType", "azure.mgmt.netapp.models.BindAuthenticationLevel": "Microsoft.NetApp.BindAuthenticationLevel", + "azure.mgmt.netapp.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.netapp.models.QosType": "Microsoft.NetApp.QosType", "azure.mgmt.netapp.models.EncryptionType": "Microsoft.NetApp.EncryptionType", "azure.mgmt.netapp.models.InAvailabilityReasonType": "Microsoft.NetApp.InAvailabilityReasonType", @@ -489,106 +412,6 @@ "azure.mgmt.netapp.aio.operations.CachesOperations.begin_pool_change": "Microsoft.NetApp.Caches.poolChange", "azure.mgmt.netapp.operations.CachesOperations.begin_reset_smb_password": "Microsoft.NetApp.Caches.resetSmbPassword", "azure.mgmt.netapp.aio.operations.CachesOperations.begin_reset_smb_password": "Microsoft.NetApp.Caches.resetSmbPassword", - "azure.mgmt.netapp.operations.ElasticAccountsOperations.get": "Microsoft.NetApp.ElasticAccounts.get", - "azure.mgmt.netapp.aio.operations.ElasticAccountsOperations.get": "Microsoft.NetApp.ElasticAccounts.get", - "azure.mgmt.netapp.operations.ElasticAccountsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticAccounts.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticAccountsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticAccounts.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticAccountsOperations.begin_update": "Microsoft.NetApp.ElasticAccounts.update", - "azure.mgmt.netapp.aio.operations.ElasticAccountsOperations.begin_update": "Microsoft.NetApp.ElasticAccounts.update", - "azure.mgmt.netapp.operations.ElasticAccountsOperations.begin_delete": "Microsoft.NetApp.ElasticAccounts.delete", - "azure.mgmt.netapp.aio.operations.ElasticAccountsOperations.begin_delete": "Microsoft.NetApp.ElasticAccounts.delete", - "azure.mgmt.netapp.operations.ElasticAccountsOperations.list_by_resource_group": "Microsoft.NetApp.ElasticAccounts.listByResourceGroup", - "azure.mgmt.netapp.aio.operations.ElasticAccountsOperations.list_by_resource_group": "Microsoft.NetApp.ElasticAccounts.listByResourceGroup", - "azure.mgmt.netapp.operations.ElasticAccountsOperations.list_by_subscription": "Microsoft.NetApp.ElasticAccounts.listBySubscription", - "azure.mgmt.netapp.aio.operations.ElasticAccountsOperations.list_by_subscription": "Microsoft.NetApp.ElasticAccounts.listBySubscription", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.get": "Microsoft.NetApp.ElasticCapacityPools.get", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.get": "Microsoft.NetApp.ElasticCapacityPools.get", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticCapacityPools.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticCapacityPools.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.begin_update": "Microsoft.NetApp.ElasticCapacityPools.update", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.begin_update": "Microsoft.NetApp.ElasticCapacityPools.update", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.begin_delete": "Microsoft.NetApp.ElasticCapacityPools.delete", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.begin_delete": "Microsoft.NetApp.ElasticCapacityPools.delete", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticCapacityPools.listByElasticAccount", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticCapacityPools.listByElasticAccount", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.begin_change_zone": "Microsoft.NetApp.ElasticCapacityPools.changeZone", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.begin_change_zone": "Microsoft.NetApp.ElasticCapacityPools.changeZone", - "azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations.check_volume_file_path_availability": "Microsoft.NetApp.ElasticCapacityPools.checkVolumeFilePathAvailability", - "azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations.check_volume_file_path_availability": "Microsoft.NetApp.ElasticCapacityPools.checkVolumeFilePathAvailability", - "azure.mgmt.netapp.operations.ElasticVolumesOperations.get": "Microsoft.NetApp.ElasticVolumes.get", - "azure.mgmt.netapp.aio.operations.ElasticVolumesOperations.get": "Microsoft.NetApp.ElasticVolumes.get", - "azure.mgmt.netapp.operations.ElasticVolumesOperations.begin_create_or_update": "Microsoft.NetApp.ElasticVolumes.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticVolumesOperations.begin_create_or_update": "Microsoft.NetApp.ElasticVolumes.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticVolumesOperations.begin_update": "Microsoft.NetApp.ElasticVolumes.update", - "azure.mgmt.netapp.aio.operations.ElasticVolumesOperations.begin_update": "Microsoft.NetApp.ElasticVolumes.update", - "azure.mgmt.netapp.operations.ElasticVolumesOperations.begin_delete": "Microsoft.NetApp.ElasticVolumes.delete", - "azure.mgmt.netapp.aio.operations.ElasticVolumesOperations.begin_delete": "Microsoft.NetApp.ElasticVolumes.delete", - "azure.mgmt.netapp.operations.ElasticVolumesOperations.list_by_elastic_pool": "Microsoft.NetApp.ElasticVolumes.listByElasticPool", - "azure.mgmt.netapp.aio.operations.ElasticVolumesOperations.list_by_elastic_pool": "Microsoft.NetApp.ElasticVolumes.listByElasticPool", - "azure.mgmt.netapp.operations.ElasticVolumesOperations.begin_revert": "Microsoft.NetApp.ElasticVolumes.revert", - "azure.mgmt.netapp.aio.operations.ElasticVolumesOperations.begin_revert": "Microsoft.NetApp.ElasticVolumes.revert", - "azure.mgmt.netapp.operations.ElasticSnapshotsOperations.get": "Microsoft.NetApp.ElasticSnapshots.get", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotsOperations.get": "Microsoft.NetApp.ElasticSnapshots.get", - "azure.mgmt.netapp.operations.ElasticSnapshotsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticSnapshots.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticSnapshots.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticSnapshotsOperations.begin_delete": "Microsoft.NetApp.ElasticSnapshots.delete", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotsOperations.begin_delete": "Microsoft.NetApp.ElasticSnapshots.delete", - "azure.mgmt.netapp.operations.ElasticSnapshotsOperations.list_by_elastic_volume": "Microsoft.NetApp.ElasticSnapshots.listByElasticVolume", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotsOperations.list_by_elastic_volume": "Microsoft.NetApp.ElasticSnapshots.listByElasticVolume", - "azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations.get": "Microsoft.NetApp.ElasticSnapshotPolicies.get", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations.get": "Microsoft.NetApp.ElasticSnapshotPolicies.get", - "azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations.begin_create_or_update": "Microsoft.NetApp.ElasticSnapshotPolicies.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations.begin_create_or_update": "Microsoft.NetApp.ElasticSnapshotPolicies.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations.begin_update": "Microsoft.NetApp.ElasticSnapshotPolicies.update", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations.begin_update": "Microsoft.NetApp.ElasticSnapshotPolicies.update", - "azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations.begin_delete": "Microsoft.NetApp.ElasticSnapshotPolicies.delete", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations.begin_delete": "Microsoft.NetApp.ElasticSnapshotPolicies.delete", - "azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticSnapshotPolicies.listByElasticAccount", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticSnapshotPolicies.listByElasticAccount", - "azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations.list_elastic_volumes": "Microsoft.NetApp.ElasticSnapshotPolicies.listElasticVolumes", - "azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations.list_elastic_volumes": "Microsoft.NetApp.ElasticSnapshotPolicies.listElasticVolumes", - "azure.mgmt.netapp.operations.ElasticBackupVaultsOperations.get": "Microsoft.NetApp.ElasticBackupVaults.get", - "azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations.get": "Microsoft.NetApp.ElasticBackupVaults.get", - "azure.mgmt.netapp.operations.ElasticBackupVaultsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticBackupVaults.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticBackupVaults.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticBackupVaultsOperations.begin_update": "Microsoft.NetApp.ElasticBackupVaults.update", - "azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations.begin_update": "Microsoft.NetApp.ElasticBackupVaults.update", - "azure.mgmt.netapp.operations.ElasticBackupVaultsOperations.begin_delete": "Microsoft.NetApp.ElasticBackupVaults.delete", - "azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations.begin_delete": "Microsoft.NetApp.ElasticBackupVaults.delete", - "azure.mgmt.netapp.operations.ElasticBackupVaultsOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticBackupVaults.listByElasticAccount", - "azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticBackupVaults.listByElasticAccount", - "azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations.get": "Microsoft.NetApp.ElasticBackupPolicies.get", - "azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations.get": "Microsoft.NetApp.ElasticBackupPolicies.get", - "azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations.begin_create_or_update": "Microsoft.NetApp.ElasticBackupPolicies.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations.begin_create_or_update": "Microsoft.NetApp.ElasticBackupPolicies.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations.begin_update": "Microsoft.NetApp.ElasticBackupPolicies.update", - "azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations.begin_update": "Microsoft.NetApp.ElasticBackupPolicies.update", - "azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations.begin_delete": "Microsoft.NetApp.ElasticBackupPolicies.delete", - "azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations.begin_delete": "Microsoft.NetApp.ElasticBackupPolicies.delete", - "azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticBackupPolicies.listByElasticAccount", - "azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations.list_by_elastic_account": "Microsoft.NetApp.ElasticBackupPolicies.listByElasticAccount", - "azure.mgmt.netapp.operations.ElasticBackupsOperations.get": "Microsoft.NetApp.ElasticBackups.get", - "azure.mgmt.netapp.aio.operations.ElasticBackupsOperations.get": "Microsoft.NetApp.ElasticBackups.get", - "azure.mgmt.netapp.operations.ElasticBackupsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticBackups.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ElasticBackupsOperations.begin_create_or_update": "Microsoft.NetApp.ElasticBackups.createOrUpdate", - "azure.mgmt.netapp.operations.ElasticBackupsOperations.begin_update": "Microsoft.NetApp.ElasticBackups.update", - "azure.mgmt.netapp.aio.operations.ElasticBackupsOperations.begin_update": "Microsoft.NetApp.ElasticBackups.update", - "azure.mgmt.netapp.operations.ElasticBackupsOperations.begin_delete": "Microsoft.NetApp.ElasticBackups.delete", - "azure.mgmt.netapp.aio.operations.ElasticBackupsOperations.begin_delete": "Microsoft.NetApp.ElasticBackups.delete", - "azure.mgmt.netapp.operations.ElasticBackupsOperations.list_by_vault": "Microsoft.NetApp.ElasticBackups.listByVault", - "azure.mgmt.netapp.aio.operations.ElasticBackupsOperations.list_by_vault": "Microsoft.NetApp.ElasticBackups.listByVault", - "azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations.get": "Microsoft.NetApp.ActiveDirectoryConfigs.get", - "azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations.get": "Microsoft.NetApp.ActiveDirectoryConfigs.get", - "azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations.begin_create_or_update": "Microsoft.NetApp.ActiveDirectoryConfigs.createOrUpdate", - "azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations.begin_create_or_update": "Microsoft.NetApp.ActiveDirectoryConfigs.createOrUpdate", - "azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations.begin_update": "Microsoft.NetApp.ActiveDirectoryConfigs.update", - "azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations.begin_update": "Microsoft.NetApp.ActiveDirectoryConfigs.update", - "azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations.begin_delete": "Microsoft.NetApp.ActiveDirectoryConfigs.delete", - "azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations.begin_delete": "Microsoft.NetApp.ActiveDirectoryConfigs.delete", - "azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations.list_by_resource_group": "Microsoft.NetApp.ActiveDirectoryConfigs.listByResourceGroup", - "azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations.list_by_resource_group": "Microsoft.NetApp.ActiveDirectoryConfigs.listByResourceGroup", - "azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations.list_by_subscription": "Microsoft.NetApp.ActiveDirectoryConfigs.listBySubscription", - "azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations.list_by_subscription": "Microsoft.NetApp.ActiveDirectoryConfigs.listBySubscription", "azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations.get": "Microsoft.NetApp.SubscriptionQuotaItems.get", "azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsOperations.get": "Microsoft.NetApp.SubscriptionQuotaItems.get", "azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations.list": "Microsoft.NetApp.SubscriptionQuotaItems.list", @@ -664,5 +487,5 @@ "azure.mgmt.netapp.operations.NetAppResourceUsagesOperations.get": "Microsoft.NetApp.NetAppResourceUsagesOperationGroup.get", "azure.mgmt.netapp.aio.operations.NetAppResourceUsagesOperations.get": "Microsoft.NetApp.NetAppResourceUsagesOperationGroup.get" }, - "CrossLanguageVersion": "d250abc99948" + "CrossLanguageVersion": "364a2f7b75ab" } \ No newline at end of file diff --git a/sdk/netapp/azure-mgmt-netapp/assets.json b/sdk/netapp/azure-mgmt-netapp/assets.json index 2c2d930ce48d..6529f3dc5e72 100644 --- a/sdk/netapp/azure-mgmt-netapp/assets.json +++ b/sdk/netapp/azure-mgmt-netapp/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/netapp/azure-mgmt-netapp", - "Tag": "python/netapp/azure-mgmt-netapp_4bae16672d" + "Tag": "python/netapp/azure-mgmt-netapp_62a27881b2" } diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_client.py index 4d69fa57125e..9e12d1cbecd6 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_client.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_client.py @@ -22,7 +22,6 @@ from ._utils.serialization import Deserializer, Serializer from .operations import ( AccountsOperations, - ActiveDirectoryConfigsOperations, BackupPoliciesOperations, BackupVaultsOperations, BackupsOperations, @@ -31,14 +30,6 @@ BackupsUnderVolumeOperations, BucketsOperations, CachesOperations, - ElasticAccountsOperations, - ElasticBackupPoliciesOperations, - ElasticBackupVaultsOperations, - ElasticBackupsOperations, - ElasticCapacityPoolsOperations, - ElasticSnapshotPoliciesOperations, - ElasticSnapshotsOperations, - ElasticVolumesOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsAccountOperations, NetAppResourceQuotaLimitsOperations, @@ -96,26 +87,6 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes,do :vartype buckets: azure.mgmt.netapp.operations.BucketsOperations :ivar caches: CachesOperations operations :vartype caches: azure.mgmt.netapp.operations.CachesOperations - :ivar elastic_accounts: ElasticAccountsOperations operations - :vartype elastic_accounts: azure.mgmt.netapp.operations.ElasticAccountsOperations - :ivar elastic_capacity_pools: ElasticCapacityPoolsOperations operations - :vartype elastic_capacity_pools: azure.mgmt.netapp.operations.ElasticCapacityPoolsOperations - :ivar elastic_volumes: ElasticVolumesOperations operations - :vartype elastic_volumes: azure.mgmt.netapp.operations.ElasticVolumesOperations - :ivar elastic_snapshots: ElasticSnapshotsOperations operations - :vartype elastic_snapshots: azure.mgmt.netapp.operations.ElasticSnapshotsOperations - :ivar elastic_snapshot_policies: ElasticSnapshotPoliciesOperations operations - :vartype elastic_snapshot_policies: - azure.mgmt.netapp.operations.ElasticSnapshotPoliciesOperations - :ivar elastic_backup_vaults: ElasticBackupVaultsOperations operations - :vartype elastic_backup_vaults: azure.mgmt.netapp.operations.ElasticBackupVaultsOperations - :ivar elastic_backup_policies: ElasticBackupPoliciesOperations operations - :vartype elastic_backup_policies: azure.mgmt.netapp.operations.ElasticBackupPoliciesOperations - :ivar elastic_backups: ElasticBackupsOperations operations - :vartype elastic_backups: azure.mgmt.netapp.operations.ElasticBackupsOperations - :ivar active_directory_configs: ActiveDirectoryConfigsOperations operations - :vartype active_directory_configs: - azure.mgmt.netapp.operations.ActiveDirectoryConfigsOperations :ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations :vartype net_app_resource_quota_limits: azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations @@ -148,10 +119,9 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes,do :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-06-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-08-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -225,29 +195,6 @@ def __init__( self.backup_vaults = BackupVaultsOperations(self._client, self._config, self._serialize, self._deserialize) self.buckets = BucketsOperations(self._client, self._config, self._serialize, self._deserialize) self.caches = CachesOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_accounts = ElasticAccountsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_capacity_pools = ElasticCapacityPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_volumes = ElasticVolumesOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_snapshots = ElasticSnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_snapshot_policies = ElasticSnapshotPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_backup_vaults = ElasticBackupVaultsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_backup_policies = ElasticBackupPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_backups = ElasticBackupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.active_directory_configs = ActiveDirectoryConfigsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py index 072e0d70cf99..22fc8d7205c3 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py @@ -34,10 +34,9 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance- :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-06-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-08-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-06-15-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py index aa5777eb2f3b..b648ad20dcc4 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0b3" +VERSION = "18.0.0" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_client.py index 04f821e47ebd..9c082b3ba830 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_client.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_client.py @@ -22,7 +22,6 @@ from ._configuration import NetAppManagementClientConfiguration from .operations import ( AccountsOperations, - ActiveDirectoryConfigsOperations, BackupPoliciesOperations, BackupVaultsOperations, BackupsOperations, @@ -31,14 +30,6 @@ BackupsUnderVolumeOperations, BucketsOperations, CachesOperations, - ElasticAccountsOperations, - ElasticBackupPoliciesOperations, - ElasticBackupVaultsOperations, - ElasticBackupsOperations, - ElasticCapacityPoolsOperations, - ElasticSnapshotPoliciesOperations, - ElasticSnapshotsOperations, - ElasticVolumesOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsAccountOperations, NetAppResourceQuotaLimitsOperations, @@ -96,28 +87,6 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes,do :vartype buckets: azure.mgmt.netapp.aio.operations.BucketsOperations :ivar caches: CachesOperations operations :vartype caches: azure.mgmt.netapp.aio.operations.CachesOperations - :ivar elastic_accounts: ElasticAccountsOperations operations - :vartype elastic_accounts: azure.mgmt.netapp.aio.operations.ElasticAccountsOperations - :ivar elastic_capacity_pools: ElasticCapacityPoolsOperations operations - :vartype elastic_capacity_pools: - azure.mgmt.netapp.aio.operations.ElasticCapacityPoolsOperations - :ivar elastic_volumes: ElasticVolumesOperations operations - :vartype elastic_volumes: azure.mgmt.netapp.aio.operations.ElasticVolumesOperations - :ivar elastic_snapshots: ElasticSnapshotsOperations operations - :vartype elastic_snapshots: azure.mgmt.netapp.aio.operations.ElasticSnapshotsOperations - :ivar elastic_snapshot_policies: ElasticSnapshotPoliciesOperations operations - :vartype elastic_snapshot_policies: - azure.mgmt.netapp.aio.operations.ElasticSnapshotPoliciesOperations - :ivar elastic_backup_vaults: ElasticBackupVaultsOperations operations - :vartype elastic_backup_vaults: azure.mgmt.netapp.aio.operations.ElasticBackupVaultsOperations - :ivar elastic_backup_policies: ElasticBackupPoliciesOperations operations - :vartype elastic_backup_policies: - azure.mgmt.netapp.aio.operations.ElasticBackupPoliciesOperations - :ivar elastic_backups: ElasticBackupsOperations operations - :vartype elastic_backups: azure.mgmt.netapp.aio.operations.ElasticBackupsOperations - :ivar active_directory_configs: ActiveDirectoryConfigsOperations operations - :vartype active_directory_configs: - azure.mgmt.netapp.aio.operations.ActiveDirectoryConfigsOperations :ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations :vartype net_app_resource_quota_limits: azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsOperations @@ -151,10 +120,9 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes,do :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-06-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-08-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -230,29 +198,6 @@ def __init__( self.backup_vaults = BackupVaultsOperations(self._client, self._config, self._serialize, self._deserialize) self.buckets = BucketsOperations(self._client, self._config, self._serialize, self._deserialize) self.caches = CachesOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_accounts = ElasticAccountsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_capacity_pools = ElasticCapacityPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_volumes = ElasticVolumesOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_snapshots = ElasticSnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_snapshot_policies = ElasticSnapshotPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_backup_vaults = ElasticBackupVaultsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_backup_policies = ElasticBackupPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.elastic_backups = ElasticBackupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.active_directory_configs = ActiveDirectoryConfigsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py index 6e866c99cc2c..1bc73c9edd52 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py @@ -34,10 +34,9 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance- :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-06-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-08-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-06-15-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py index dc8916780c55..4edfa8469e9a 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py @@ -25,15 +25,6 @@ from ._operations import BackupVaultsOperations # type: ignore from ._operations import BucketsOperations # type: ignore from ._operations import CachesOperations # type: ignore -from ._operations import ElasticAccountsOperations # type: ignore -from ._operations import ElasticCapacityPoolsOperations # type: ignore -from ._operations import ElasticVolumesOperations # type: ignore -from ._operations import ElasticSnapshotsOperations # type: ignore -from ._operations import ElasticSnapshotPoliciesOperations # type: ignore -from ._operations import ElasticBackupVaultsOperations # type: ignore -from ._operations import ElasticBackupPoliciesOperations # type: ignore -from ._operations import ElasticBackupsOperations # type: ignore -from ._operations import ActiveDirectoryConfigsOperations # type: ignore from ._operations import NetAppResourceQuotaLimitsOperations # type: ignore from ._operations import NetAppResourceRegionInfosOperations # type: ignore from ._operations import AccountsOperations # type: ignore @@ -63,15 +54,6 @@ "BackupVaultsOperations", "BucketsOperations", "CachesOperations", - "ElasticAccountsOperations", - "ElasticCapacityPoolsOperations", - "ElasticVolumesOperations", - "ElasticSnapshotsOperations", - "ElasticSnapshotPoliciesOperations", - "ElasticBackupVaultsOperations", - "ElasticBackupPoliciesOperations", - "ElasticBackupsOperations", - "ActiveDirectoryConfigsOperations", "NetAppResourceQuotaLimitsOperations", "NetAppResourceRegionInfosOperations", "AccountsOperations", diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py index 0c451cf1888c..3d78ce91057c 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py @@ -49,12 +49,6 @@ build_accounts_renew_credentials_request, build_accounts_transition_to_cmk_request, build_accounts_update_request, - build_active_directory_configs_create_or_update_request, - build_active_directory_configs_delete_request, - build_active_directory_configs_get_request, - build_active_directory_configs_list_by_resource_group_request, - build_active_directory_configs_list_by_subscription_request, - build_active_directory_configs_update_request, build_backup_policies_create_request, build_backup_policies_delete_request, build_backup_policies_get_request, @@ -91,50 +85,6 @@ build_caches_pool_change_request, build_caches_reset_smb_password_request, build_caches_update_request, - build_elastic_accounts_create_or_update_request, - build_elastic_accounts_delete_request, - build_elastic_accounts_get_request, - build_elastic_accounts_list_by_resource_group_request, - build_elastic_accounts_list_by_subscription_request, - build_elastic_accounts_update_request, - build_elastic_backup_policies_create_or_update_request, - build_elastic_backup_policies_delete_request, - build_elastic_backup_policies_get_request, - build_elastic_backup_policies_list_by_elastic_account_request, - build_elastic_backup_policies_update_request, - build_elastic_backup_vaults_create_or_update_request, - build_elastic_backup_vaults_delete_request, - build_elastic_backup_vaults_get_request, - build_elastic_backup_vaults_list_by_elastic_account_request, - build_elastic_backup_vaults_update_request, - build_elastic_backups_create_or_update_request, - build_elastic_backups_delete_request, - build_elastic_backups_get_request, - build_elastic_backups_list_by_vault_request, - build_elastic_backups_update_request, - build_elastic_capacity_pools_change_zone_request, - build_elastic_capacity_pools_check_volume_file_path_availability_request, - build_elastic_capacity_pools_create_or_update_request, - build_elastic_capacity_pools_delete_request, - build_elastic_capacity_pools_get_request, - build_elastic_capacity_pools_list_by_elastic_account_request, - build_elastic_capacity_pools_update_request, - build_elastic_snapshot_policies_create_or_update_request, - build_elastic_snapshot_policies_delete_request, - build_elastic_snapshot_policies_get_request, - build_elastic_snapshot_policies_list_by_elastic_account_request, - build_elastic_snapshot_policies_list_elastic_volumes_request, - build_elastic_snapshot_policies_update_request, - build_elastic_snapshots_create_or_update_request, - build_elastic_snapshots_delete_request, - build_elastic_snapshots_get_request, - build_elastic_snapshots_list_by_elastic_volume_request, - build_elastic_volumes_create_or_update_request, - build_elastic_volumes_delete_request, - build_elastic_volumes_get_request, - build_elastic_volumes_list_by_elastic_pool_request, - build_elastic_volumes_revert_request, - build_elastic_volumes_update_request, build_net_app_resource_check_file_path_availability_request, build_net_app_resource_check_name_availability_request, build_net_app_resource_check_quota_availability_request, @@ -376,6 +326,9 @@ def __init__(self, *args, **kwargs) -> None: "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def get( @@ -473,6 +426,9 @@ async def get( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.QuotaItem"]: @@ -4005,6 +3961,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _list_get_group_id_list_for_ldap_user_initial( # pylint: disable=name-too-long @@ -4224,6 +4183,9 @@ async def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-to "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long @@ -5037,6 +4999,9 @@ def list_replications( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def list_replications( @@ -7295,6 +7260,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _list_quota_report_initial( @@ -7513,6 +7481,9 @@ async def begin_list_quota_report( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_list_quota_report( @@ -11416,6 +11387,9 @@ def __init__(self, *args, **kwargs) -> None: "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def get( @@ -11535,6 +11509,9 @@ async def get( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def list( @@ -11676,6 +11653,9 @@ async def get_next(next_link=None): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _clear_suspects_initial( @@ -11906,6 +11886,9 @@ async def begin_clear_suspects( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_clear_suspects( @@ -12859,6 +12842,9 @@ def __init__(self, *args, **kwargs) -> None: "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def get( @@ -12975,6 +12961,9 @@ async def get( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _create_or_update_initial( @@ -13205,6 +13194,9 @@ async def begin_create_or_update( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_create_or_update( @@ -13321,6 +13313,9 @@ def get_long_running_output(pipeline_response): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _update_initial( @@ -13549,6 +13544,9 @@ async def begin_update( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_update( @@ -13663,6 +13661,9 @@ def get_long_running_output(pipeline_response): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _delete_initial( @@ -13764,6 +13765,9 @@ async def _delete_initial( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_delete( @@ -13865,6 +13869,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def list( @@ -14120,6 +14127,9 @@ async def generate_credentials( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def generate_credentials( @@ -14251,6 +14261,9 @@ async def generate_credentials( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _generate_akv_credentials_initial( @@ -14474,6 +14487,9 @@ async def begin_generate_akv_credentials( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_generate_akv_credentials( @@ -14583,6 +14599,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _refresh_certificate_initial( @@ -14683,6 +14702,9 @@ async def _refresh_certificate_initial( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_refresh_certificate( @@ -14803,6 +14825,9 @@ def __init__(self, *args, **kwargs) -> None: "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def get( @@ -14908,6 +14933,9 @@ async def get( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _create_or_update_initial( @@ -15120,6 +15148,9 @@ async def begin_create_or_update( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_create_or_update( @@ -15229,6 +15260,9 @@ def get_long_running_output(pipeline_response): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _update_initial( @@ -15442,6 +15476,9 @@ async def begin_update( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_update( @@ -15551,6 +15588,9 @@ def get_long_running_output(pipeline_response): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _delete_initial( @@ -15641,6 +15681,9 @@ async def _delete_initial( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_delete( @@ -15731,6 +15774,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def list( @@ -15863,6 +15909,9 @@ async def get_next(next_link=None): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def list_peering_passphrases( @@ -15969,6 +16018,9 @@ async def list_peering_passphrases( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _pool_change_initial( @@ -16179,6 +16231,9 @@ async def begin_pool_change( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_pool_change( @@ -16289,6 +16344,9 @@ def get_long_running_output(pipeline_response): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _reset_smb_password_initial( @@ -16380,6 +16438,9 @@ async def _reset_smb_password_initial( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_reset_smb_password( @@ -16453,9813 +16514,6 @@ def get_long_running_output(pipeline_response): ) -class ElasticAccountsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_accounts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.ElasticAccount: - """Get the NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: ElasticAccount. The ElasticAccount is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticAccount - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticAccount] = kwargs.pop("cls", None) - - _request = build_elastic_accounts_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticAccount, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - body: Union[_models.ElasticAccount, _types.ElasticAccount, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_accounts_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: _models.ElasticAccount, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccount - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: _types.ElasticAccount, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticAccount - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - body: Union[_models.ElasticAccount, _types.ElasticAccount, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: Resource create parameters. Is either a ElasticAccount type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccount or ~azure.mgmt.netapp.types.ElasticAccount - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticAccount] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticAccount, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticAccount].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticAccount]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - body: Union[_models.ElasticAccountUpdate, _types.ElasticAccountUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_accounts_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - body: _models.ElasticAccountUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccountUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - body: _types.ElasticAccountUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticAccountUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - body: Union[_models.ElasticAccountUpdate, _types.ElasticAccountUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param body: The resource properties to be updated. Is either a ElasticAccountUpdate type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccountUpdate or - ~azure.mgmt.netapp.types.ElasticAccountUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticAccount. The ElasticAccount is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticAccount] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticAccount, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticAccount].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticAccount]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_accounts_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete the specified NetApp elastic account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticAccount"]: - """List and describe all NetApp elastic accounts in the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of ElasticAccount - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticAccount]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_accounts_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticAccount], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ElasticAccount"]: - """List and describe all NetApp elastic accounts in the subscription. - - :return: An iterator like instance of ElasticAccount - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticAccount]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_accounts_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticAccount], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ElasticCapacityPoolsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_capacity_pools` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> _models.ElasticCapacityPool: - """Get the NetApp Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :return: ElasticCapacityPool. The ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticCapacityPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) - - _request = build_elastic_capacity_pools_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPool, _types.ElasticCapacityPool, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_capacity_pools_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _models.ElasticCapacityPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _types.ElasticCapacityPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticCapacityPool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPool, _types.ElasticCapacityPool, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Is either a ElasticCapacityPool type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPool or - ~azure.mgmt.netapp.types.ElasticCapacityPool or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticCapacityPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticCapacityPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPoolUpdate, _types.ElasticCapacityPoolUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_capacity_pools_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _models.ElasticCapacityPoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPoolUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _types.ElasticCapacityPoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticCapacityPoolUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPoolUpdate, _types.ElasticCapacityPoolUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Is either a ElasticCapacityPoolUpdate type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPoolUpdate or - ~azure.mgmt.netapp.types.ElasticCapacityPoolUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticCapacityPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticCapacityPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "pool_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_capacity_pools_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "pool_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete the specified NetApp Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticCapacityPool"]: - """List and describe all NetApp Elastic Capacity Pools in the Elastic NetApp Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticCapacityPool - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticCapacityPool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_capacity_pools_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticCapacityPool], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _change_zone_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ChangeZoneRequest, _types.ChangeZoneRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_capacity_pools_change_zone_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _models.ChangeZoneRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.ChangeZoneRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _types.ChangeZoneRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.ChangeZoneRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ChangeZoneRequest, _types.ChangeZoneRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Is either a ChangeZoneRequest type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ChangeZoneRequest or - ~azure.mgmt.netapp.types.ChangeZoneRequest or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticCapacityPool. The - ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._change_zone_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticCapacityPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticCapacityPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _models.CheckElasticVolumeFilePathAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.CheckElasticVolumeFilePathAvailabilityRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _types.CheckElasticVolumeFilePathAvailabilityRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.CheckElasticVolumeFilePathAvailabilityRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def check_volume_file_path_availability( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[ - _models.CheckElasticVolumeFilePathAvailabilityRequest, - _types.CheckElasticVolumeFilePathAvailabilityRequest, - IO[bytes], - ], - **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Is either a - CheckElasticVolumeFilePathAvailabilityRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.CheckElasticVolumeFilePathAvailabilityRequest or - ~azure.mgmt.netapp.types.CheckElasticVolumeFilePathAvailabilityRequest or IO[bytes] - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckElasticResourceAvailabilityResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_capacity_pools_check_volume_file_path_availability_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CheckElasticResourceAvailabilityResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ElasticVolumesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_volumes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.ElasticVolume: - """Get the details of the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :return: ElasticVolume. The ElasticVolume is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticVolume - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) - - _request = build_elastic_volumes_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticVolume, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolume, _types.ElasticVolume, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_volumes_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.ElasticVolume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolume - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.ElasticVolume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticVolume - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolume, _types.ElasticVolume, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Is either a ElasticVolume type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolume or ~azure.mgmt.netapp.types.ElasticVolume - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticVolume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticVolume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticVolume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolumeUpdate, _types.ElasticVolumeUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_volumes_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.ElasticVolumeUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.ElasticVolumeUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticVolumeUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolumeUpdate, _types.ElasticVolumeUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The resource properties to be updated. Is either a ElasticVolumeUpdate type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeUpdate or - ~azure.mgmt.netapp.types.ElasticVolumeUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticVolume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticVolume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticVolume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_volumes_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete the specified Elastic Volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_pool( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticVolume"]: - """List all Elastic Volumes within the Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :return: An iterator like instance of ElasticVolume - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticVolume]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_volumes_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticVolume], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _revert_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolumeRevert, _types.ElasticVolumeRevert, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_volumes_revert_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.ElasticVolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeRevert - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.ElasticVolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.ElasticVolumeRevert - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolumeRevert, _types.ElasticVolumeRevert, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Is either a ElasticVolumeRevert type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeRevert or - ~azure.mgmt.netapp.types.ElasticVolumeRevert or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticVolume. The ElasticVolume is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._revert_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticVolume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticVolume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticVolume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class ElasticSnapshotsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_snapshots` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "snapshot_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> _models.ElasticSnapshot: - """Get a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :return: ElasticSnapshot. The ElasticSnapshot is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticSnapshot] = kwargs.pop("cls", None) - - _request = build_elastic_snapshots_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticSnapshot, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "snapshot_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.ElasticSnapshot, _types.ElasticSnapshot, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_snapshots_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _models.ElasticSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _types.ElasticSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticSnapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "snapshot_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.ElasticSnapshot, _types.ElasticSnapshot, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Is either a ElasticSnapshot type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshot or - ~azure.mgmt.netapp.types.ElasticSnapshot or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticSnapshot] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticSnapshot, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticSnapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticSnapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "snapshot_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_snapshots_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "snapshot_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_volume( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticSnapshot"]: - """List ElasticSnapshot resources by ElasticVolume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :return: An iterator like instance of ElasticSnapshot - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticSnapshot]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_snapshots_list_by_elastic_volume_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticSnapshot], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ElasticSnapshotPoliciesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_snapshot_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> _models.ElasticSnapshotPolicy: - """Get a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :return: ElasticSnapshotPolicy. The ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticSnapshotPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticSnapshotPolicy] = kwargs.pop("cls", None) - - _request = build_elastic_snapshot_policies_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticSnapshotPolicy, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicy, _types.ElasticSnapshotPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_snapshot_policies_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: _models.ElasticSnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: _types.ElasticSnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticSnapshotPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicy, _types.ElasticSnapshotPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Is either a ElasticSnapshotPolicy type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicy or - ~azure.mgmt.netapp.types.ElasticSnapshotPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticSnapshotPolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticSnapshotPolicy, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticSnapshotPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticSnapshotPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicyUpdate, _types.ElasticSnapshotPolicyUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_snapshot_policies_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: _models.ElasticSnapshotPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: _types.ElasticSnapshotPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticSnapshotPolicyUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicyUpdate, _types.ElasticSnapshotPolicyUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Is either a ElasticSnapshotPolicyUpdate - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdate or - ~azure.mgmt.netapp.types.ElasticSnapshotPolicyUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticSnapshotPolicy. The - ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticSnapshotPolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticSnapshotPolicy, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticSnapshotPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticSnapshotPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_snapshot_policies_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a ElasticSnapshotPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticSnapshotPolicy"]: - """List ElasticSnapshotPolicy resources by ElasticAccount. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticSnapshotPolicy - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticSnapshotPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_snapshot_policies_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticSnapshotPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_elastic_volumes( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticVolume"]: - """Get elastic volumes associated with Elastic Snapshot Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :return: An iterator like instance of ElasticVolume - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticVolume]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_snapshot_policies_list_elastic_volumes_request( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticVolume], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ElasticBackupVaultsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_backup_vaults` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> _models.ElasticBackupVault: - """Get the Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :return: ElasticBackupVault. The ElasticBackupVault is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticBackupVault - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticBackupVault] = kwargs.pop("cls", None) - - _request = build_elastic_backup_vaults_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticBackupVault, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVault, _types.ElasticBackupVault, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_backup_vaults_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: _models.ElasticBackupVault, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVault - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: _types.ElasticBackupVault, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupVault - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVault, _types.ElasticBackupVault, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Is either a ElasticBackupVault type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVault or - ~azure.mgmt.netapp.types.ElasticBackupVault or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupVault] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupVault, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticBackupVault].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticBackupVault]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVaultUpdate, _types.ElasticBackupVaultUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_backup_vaults_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: _models.ElasticBackupVaultUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVaultUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: _types.ElasticBackupVaultUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupVaultUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVaultUpdate, _types.ElasticBackupVaultUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Is either a ElasticBackupVaultUpdate type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVaultUpdate or - ~azure.mgmt.netapp.types.ElasticBackupVaultUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticBackupVault. The ElasticBackupVault - is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupVault] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupVault, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticBackupVault].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticBackupVault]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_backup_vaults_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete the specified Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticBackupVault"]: - """List and describe all Elastic Backup Vaults in the elastic account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticBackupVault - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticBackupVault]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_backup_vaults_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticBackupVault], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ElasticBackupPoliciesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_backup_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any - ) -> _models.ElasticBackupPolicy: - """Get the Elastic Backup Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :return: ElasticBackupPolicy. The ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticBackupPolicy] = kwargs.pop("cls", None) - - _request = build_elastic_backup_policies_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticBackupPolicy, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicy, _types.ElasticBackupPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_backup_policies_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: _models.ElasticBackupPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: _types.ElasticBackupPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicy, _types.ElasticBackupPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Is either a ElasticBackupPolicy type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicy or - ~azure.mgmt.netapp.types.ElasticBackupPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupPolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupPolicy, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticBackupPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticBackupPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicyUpdate, _types.ElasticBackupPolicyUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_backup_policies_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: _models.ElasticBackupPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicyUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: _types.ElasticBackupPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupPolicyUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicyUpdate, _types.ElasticBackupPolicyUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Is either a ElasticBackupPolicyUpdate type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicyUpdate or - ~azure.mgmt.netapp.types.ElasticBackupPolicyUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticBackupPolicy. The - ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupPolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupPolicy, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticBackupPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticBackupPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_backup_policies_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete the specified Elastic Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticBackupPolicy"]: - """List and describe all Elastic Backup Policies in the elastic account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticBackupPolicy - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticBackupPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_backup_policies_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticBackupPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ElasticBackupsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`elastic_backups` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> _models.ElasticBackup: - """Get the specified Elastic Backup under Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :return: ElasticBackup. The ElasticBackup is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticBackup] = kwargs.pop("cls", None) - - _request = build_elastic_backups_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticBackup, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_backups_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: _models.ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: _types.ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: Resource create parameters. Is either a ElasticBackup type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup or ~azure.mgmt.netapp.types.ElasticBackup - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_backups_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: _models.ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: _types.ElasticBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: The resource properties to be updated. Is either a ElasticBackup type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup or ~azure.mgmt.netapp.types.ElasticBackup - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ElasticBackup. The ElasticBackup is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_elastic_backups_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "backup_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a ElasticBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_vault_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_vault( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticBackup"]: - """List all elastic backups Under an elastic Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :return: An iterator like instance of ElasticBackup - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ElasticBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticBackup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_backups_list_by_vault_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticBackup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ActiveDirectoryConfigsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`active_directory_configs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def get( - self, resource_group_name: str, active_directory_config_name: str, **kwargs: Any - ) -> _models.ActiveDirectoryConfig: - """Get the details of the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :return: ActiveDirectoryConfig. The ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ActiveDirectoryConfig - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ActiveDirectoryConfig] = kwargs.pop("cls", None) - - _request = build_active_directory_configs_get_request( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ActiveDirectoryConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfig, _types.ActiveDirectoryConfig, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_active_directory_configs_create_or_update_request( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: _models.ActiveDirectoryConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfig - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: _types.ActiveDirectoryConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ActiveDirectoryConfig - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfig, _types.ActiveDirectoryConfig, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Is either a ActiveDirectoryConfig type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfig or - ~azure.mgmt.netapp.types.ActiveDirectoryConfig or IO[bytes] - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ActiveDirectoryConfig] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ActiveDirectoryConfig, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ActiveDirectoryConfig].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ActiveDirectoryConfig]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _update_initial( - self, - resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfigUpdate, _types.ActiveDirectoryConfigUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_active_directory_configs_update_request( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: _models.ActiveDirectoryConfigUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfigUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: _types.ActiveDirectoryConfigUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ActiveDirectoryConfigUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfigUpdate, _types.ActiveDirectoryConfigUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Is either a ActiveDirectoryConfigUpdate - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfigUpdate or - ~azure.mgmt.netapp.types.ActiveDirectoryConfigUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ActiveDirectoryConfig. The - ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ActiveDirectoryConfig] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ActiveDirectoryConfig, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ActiveDirectoryConfig].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ActiveDirectoryConfig]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def _delete_initial( - self, resource_group_name: str, active_directory_config_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_active_directory_configs_delete_request( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - async def begin_delete( - self, resource_group_name: str, active_directory_config_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete the specified Active Directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ActiveDirectoryConfig"]: - """List all active directory configurations within the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of ActiveDirectoryConfig - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ActiveDirectoryConfig]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_active_directory_configs_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ActiveDirectoryConfig], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ActiveDirectoryConfig"]: - """List all active directory configurations within the subscription. - - :return: An iterator like instance of ActiveDirectoryConfig - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ActiveDirectoryConfig]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_active_directory_configs_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ActiveDirectoryConfig], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - class NetAppResourceQuotaLimitsOperations: # pylint: disable=docstring-missing-param """ .. warning:: @@ -26966,6 +17220,9 @@ def get_long_running_output(pipeline_response): "2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def _update_initial( @@ -27147,6 +17404,9 @@ async def begin_update( "2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) async def begin_update( @@ -28273,7 +18533,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2026-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] }, - api_versions_list=["2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview"], + api_versions_list=[ + "2026-04-15-preview", + "2026-05-15-preview", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], ) async def _refresh_ldap_bind_password_initial( self, resource_group_name: str, account_name: str, **kwargs: Any @@ -28344,7 +18611,14 @@ async def _refresh_ldap_bind_password_initial( params_added_on={ "2026-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] }, - api_versions_list=["2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview"], + api_versions_list=[ + "2026-04-15-preview", + "2026-05-15-preview", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], ) async def begin_refresh_ldap_bind_password( self, resource_group_name: str, account_name: str, **kwargs: Any diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index 8b1da82c6286..dfb6672284b8 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -15,13 +15,11 @@ from ._models import ( # type: ignore AccountEncryption, + AccountEncryptionPatch, AccountProperties, AccountPropertiesPatch, ActiveDirectory, - ActiveDirectoryConfig, - ActiveDirectoryConfigProperties, - ActiveDirectoryConfigUpdate, - ActiveDirectoryConfigUpdateProperties, + ActiveDirectoryPatch, AuthorizeRequest, AzureKeyVaultDetails, Backup, @@ -59,10 +57,7 @@ CapacityPoolPatch, CertificateAkvDetails, ChangeKeyVault, - ChangeZoneRequest, CheckAvailabilityResponse, - CheckElasticResourceAvailabilityResponse, - CheckElasticVolumeFilePathAvailabilityRequest, CifsUser, ClusterPeerCommandResponse, ClusterPeerCommandResponseProperties, @@ -70,57 +65,9 @@ DailySchedule, DestinationReplication, Dimension, - ElasticAccount, - ElasticAccountProperties, - ElasticAccountUpdate, - ElasticAccountUpdateProperties, - ElasticBackup, - ElasticBackupPolicy, - ElasticBackupPolicyProperties, - ElasticBackupPolicyUpdate, - ElasticBackupPolicyUpdateProperties, - ElasticBackupProperties, - ElasticBackupVault, - ElasticBackupVaultProperties, - ElasticBackupVaultUpdate, - ElasticCapacityPool, - ElasticCapacityPoolProperties, - ElasticCapacityPoolUpdate, - ElasticCapacityPoolUpdateProperties, - ElasticEncryption, - ElasticEncryptionConfiguration, - ElasticEncryptionIdentity, - ElasticExportPolicy, - ElasticExportPolicyRule, - ElasticKeyVaultProperties, - ElasticMountTargetProperties, - ElasticSmbPatchProperties, - ElasticSmbProperties, - ElasticSnapshot, - ElasticSnapshotPolicy, - ElasticSnapshotPolicyDailySchedule, - ElasticSnapshotPolicyHourlySchedule, - ElasticSnapshotPolicyMonthlySchedule, - ElasticSnapshotPolicyProperties, - ElasticSnapshotPolicyUpdate, - ElasticSnapshotPolicyUpdateProperties, - ElasticSnapshotPolicyWeeklySchedule, - ElasticSnapshotProperties, - ElasticVolume, - ElasticVolumeBackupProperties, - ElasticVolumeDataProtectionPatchProperties, - ElasticVolumeDataProtectionProperties, - ElasticVolumeProperties, - ElasticVolumeRevert, - ElasticVolumeSnapshotProperties, - ElasticVolumeUpdate, - ElasticVolumeUpdateProperties, EncryptionIdentity, + EncryptionIdentityPatch, EncryptionTransitionRequest, - EntraIdAkvConfig, - EntraIdAkvConfigPatch, - EntraIdConfig, - EntraIdConfigPatch, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, @@ -134,6 +81,7 @@ HourlySchedule, KeyVaultPrivateEndpoint, KeyVaultProperties, + KeyVaultPropertiesPatch, LdapConfiguration, LdapConfigurationPatch, LdapSearchScopeOpt, @@ -185,9 +133,6 @@ Resource, ResourceNameAvailabilityRequest, RestoreStatus, - SecretPassword, - SecretPasswordIdentity, - SecretPasswordKeyVaultProperties, ServiceSpecification, SmbSettings, Snapshot, @@ -253,8 +198,6 @@ CacheFileAccessLogs, CacheLifeCycleState, CacheProvisioningState, - CheckElasticResourceAvailabilityReason, - CheckElasticResourceAvailabilityStatus, CheckNameResourceTypes, CheckQuotaNameResourceTypes, ChownMode, @@ -263,22 +206,7 @@ CoolAccessTieringPolicy, CreatedByType, CredentialsStatus, - DayOfWeek, DesiredRansomwareProtectionState, - ElasticBackupPolicyState, - ElasticBackupType, - ElasticKeyVaultStatus, - ElasticNfsv3Access, - ElasticNfsv4Access, - ElasticPoolEncryptionKeySource, - ElasticProtocolType, - ElasticResourceAvailabilityStatus, - ElasticRootAccess, - ElasticServiceLevel, - ElasticSmbEncryption, - ElasticUnixAccessRule, - ElasticVolumePolicyEnforcement, - ElasticVolumeRestorationState, EnableSubvolumes, EnableWriteBackState, EncryptionKeySource, @@ -293,7 +221,6 @@ KerberosState, KeySource, KeyVaultStatus, - LargeVolumeType, LdapServerType, LdapState, ManagedServiceIdentityType, @@ -304,7 +231,6 @@ NetworkFeatures, NetworkSiblingSetProvisioningState, OnCertificateConflictAction, - PolicyStatus, ProtocolTypes, QosType, QuotaType, @@ -321,13 +247,10 @@ SmbAccessBasedEnumeration, SmbEncryptionState, SmbNonBrowsable, - SnapshotDirectoryVisibility, - SnapshotUsage, VolumeBackupRelationshipStatus, VolumeLanguage, VolumeReplicationRelationshipStatus, VolumeRestoreRelationshipStatus, - VolumeSize, VolumeStorageToNetworkProximity, ) from ._patch import __all__ as _patch_all @@ -336,13 +259,11 @@ __all__ = [ "AccountEncryption", + "AccountEncryptionPatch", "AccountProperties", "AccountPropertiesPatch", "ActiveDirectory", - "ActiveDirectoryConfig", - "ActiveDirectoryConfigProperties", - "ActiveDirectoryConfigUpdate", - "ActiveDirectoryConfigUpdateProperties", + "ActiveDirectoryPatch", "AuthorizeRequest", "AzureKeyVaultDetails", "Backup", @@ -380,10 +301,7 @@ "CapacityPoolPatch", "CertificateAkvDetails", "ChangeKeyVault", - "ChangeZoneRequest", "CheckAvailabilityResponse", - "CheckElasticResourceAvailabilityResponse", - "CheckElasticVolumeFilePathAvailabilityRequest", "CifsUser", "ClusterPeerCommandResponse", "ClusterPeerCommandResponseProperties", @@ -391,57 +309,9 @@ "DailySchedule", "DestinationReplication", "Dimension", - "ElasticAccount", - "ElasticAccountProperties", - "ElasticAccountUpdate", - "ElasticAccountUpdateProperties", - "ElasticBackup", - "ElasticBackupPolicy", - "ElasticBackupPolicyProperties", - "ElasticBackupPolicyUpdate", - "ElasticBackupPolicyUpdateProperties", - "ElasticBackupProperties", - "ElasticBackupVault", - "ElasticBackupVaultProperties", - "ElasticBackupVaultUpdate", - "ElasticCapacityPool", - "ElasticCapacityPoolProperties", - "ElasticCapacityPoolUpdate", - "ElasticCapacityPoolUpdateProperties", - "ElasticEncryption", - "ElasticEncryptionConfiguration", - "ElasticEncryptionIdentity", - "ElasticExportPolicy", - "ElasticExportPolicyRule", - "ElasticKeyVaultProperties", - "ElasticMountTargetProperties", - "ElasticSmbPatchProperties", - "ElasticSmbProperties", - "ElasticSnapshot", - "ElasticSnapshotPolicy", - "ElasticSnapshotPolicyDailySchedule", - "ElasticSnapshotPolicyHourlySchedule", - "ElasticSnapshotPolicyMonthlySchedule", - "ElasticSnapshotPolicyProperties", - "ElasticSnapshotPolicyUpdate", - "ElasticSnapshotPolicyUpdateProperties", - "ElasticSnapshotPolicyWeeklySchedule", - "ElasticSnapshotProperties", - "ElasticVolume", - "ElasticVolumeBackupProperties", - "ElasticVolumeDataProtectionPatchProperties", - "ElasticVolumeDataProtectionProperties", - "ElasticVolumeProperties", - "ElasticVolumeRevert", - "ElasticVolumeSnapshotProperties", - "ElasticVolumeUpdate", - "ElasticVolumeUpdateProperties", "EncryptionIdentity", + "EncryptionIdentityPatch", "EncryptionTransitionRequest", - "EntraIdAkvConfig", - "EntraIdAkvConfigPatch", - "EntraIdConfig", - "EntraIdConfigPatch", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -455,6 +325,7 @@ "HourlySchedule", "KeyVaultPrivateEndpoint", "KeyVaultProperties", + "KeyVaultPropertiesPatch", "LdapConfiguration", "LdapConfigurationPatch", "LdapSearchScopeOpt", @@ -506,9 +377,6 @@ "Resource", "ResourceNameAvailabilityRequest", "RestoreStatus", - "SecretPassword", - "SecretPasswordIdentity", - "SecretPasswordKeyVaultProperties", "ServiceSpecification", "SmbSettings", "Snapshot", @@ -571,8 +439,6 @@ "CacheFileAccessLogs", "CacheLifeCycleState", "CacheProvisioningState", - "CheckElasticResourceAvailabilityReason", - "CheckElasticResourceAvailabilityStatus", "CheckNameResourceTypes", "CheckQuotaNameResourceTypes", "ChownMode", @@ -581,22 +447,7 @@ "CoolAccessTieringPolicy", "CreatedByType", "CredentialsStatus", - "DayOfWeek", "DesiredRansomwareProtectionState", - "ElasticBackupPolicyState", - "ElasticBackupType", - "ElasticKeyVaultStatus", - "ElasticNfsv3Access", - "ElasticNfsv4Access", - "ElasticPoolEncryptionKeySource", - "ElasticProtocolType", - "ElasticResourceAvailabilityStatus", - "ElasticRootAccess", - "ElasticServiceLevel", - "ElasticSmbEncryption", - "ElasticUnixAccessRule", - "ElasticVolumePolicyEnforcement", - "ElasticVolumeRestorationState", "EnableSubvolumes", "EnableWriteBackState", "EncryptionKeySource", @@ -611,7 +462,6 @@ "KerberosState", "KeySource", "KeyVaultStatus", - "LargeVolumeType", "LdapServerType", "LdapState", "ManagedServiceIdentityType", @@ -622,7 +472,6 @@ "NetworkFeatures", "NetworkSiblingSetProvisioningState", "OnCertificateConflictAction", - "PolicyStatus", "ProtocolTypes", "QosType", "QuotaType", @@ -639,13 +488,10 @@ "SmbAccessBasedEnumeration", "SmbEncryptionState", "SmbNonBrowsable", - "SnapshotDirectoryVisibility", - "SnapshotUsage", "VolumeBackupRelationshipStatus", "VolumeLanguage", "VolumeReplicationRelationshipStatus", "VolumeRestoreRelationshipStatus", - "VolumeSize", "VolumeStorageToNetworkProximity", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_enums.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_enums.py index 62ffb1dd3c49..621e5932c44e 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_enums.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_enums.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -169,24 +168,6 @@ class CacheProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Resource creation was canceled.""" -class CheckElasticResourceAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Availability reason.""" - - INVALID = "Invalid" - """Value indicating the name provided does not match Azure NetApp Files naming requirements.""" - ALREADY_EXISTS = "AlreadyExists" - """Value indicating the name is already in use and is therefore unavailable.""" - - -class CheckElasticResourceAvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Availability status.""" - - TRUE = "True" - """Value indicating the name is valid and available.""" - FALSE = "False" - """Value indicating the the name is invalid, unavailable, or both.""" - - class CheckNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Resource type used for verification.""" @@ -299,9 +280,9 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CredentialsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The bucket credentials status. There states: - "NoCredentialsSet": Access and Secret key pair have not been generated. - "CredentialsExpired": Access and Secret key pair have expired. - "Active": The certificate has been installed and credentials are unexpired. + \"NoCredentialsSet\": Access and Secret key pair have not been generated. + \"CredentialsExpired\": Access and Secret key pair have expired. + \"Active\": The certificate has been installed and credentials are unexpired. """ NO_CREDENTIALS_SET = "NoCredentialsSet" @@ -313,25 +294,6 @@ class CredentialsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): unexpired.""" -class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Day of the week.""" - - SUNDAY = "Sunday" - """Take a snapshot each Sunday.""" - MONDAY = "Monday" - """Take a snapshot each Monday.""" - TUESDAY = "Tuesday" - """Take a snapshot each Tuesday.""" - WEDNESDAY = "Wednesday" - """Take a snapshot each Wednesday.""" - THURSDAY = "Thursday" - """Take a snapshot each Thursday.""" - FRIDAY = "Friday" - """Take a snapshot each Friday.""" - SATURDAY = "Saturday" - """Take a snapshot each Saturday.""" - - class DesiredRansomwareProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The desired state of the Advanced Ransomware Protection feature.""" @@ -341,142 +303,6 @@ class DesiredRansomwareProtectionState(str, Enum, metaclass=CaseInsensitiveEnumM """Advanced Ransomware Protection is enabled.""" -class ElasticBackupPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Elastic Backup Policy state.""" - - ENABLED = "Enabled" - """Value indicating the policy is enabled.""" - DISABLED = "Disabled" - """Value indicating the policy is disabled.""" - - -class ElasticBackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of backup.""" - - MANUAL = "Manual" - """Manual backup type.""" - SCHEDULED = "Scheduled" - """Scheduled backup type.""" - - -class ElasticKeyVaultStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """KeyVault status.""" - - CREATED = "Created" - """KeyVault connection created but not in use.""" - IN_USE = "InUse" - """KeyVault connection in use by SMB Volume.""" - DELETED = "Deleted" - """KeyVault connection Deleted.""" - ERROR = "Error" - """Error with the KeyVault connection.""" - UPDATING = "Updating" - """KeyVault connection Updating.""" - - -class ElasticNfsv3Access(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """NFSv3 access.""" - - ENABLED = "Enabled" - """Clients can connect to the volume using the NFSv3 protocol.""" - DISABLED = "Disabled" - """Clients can't connect to the volume using the NFSv3 protocol.""" - - -class ElasticNfsv4Access(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """NFSv4 access.""" - - ENABLED = "Enabled" - """Clients can connect to the volume using the NFSv4 protocol.""" - DISABLED = "Disabled" - """Clients can't connect to the volume using the NFSv4 protocol.""" - - -class ElasticPoolEncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Pool Encryption Key Source.""" - - NET_APP = "NetApp" - """Represents the encryption key source of Elastic pool is Microsoft.NetApp.""" - KEY_VAULT = "KeyVault" - """Represents the encryption key source of Elastic pool is Microsoft.KeyVault.""" - - -class ElasticProtocolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol types for elastic volume.""" - - NF_SV3 = "NFSv3" - """NFSv3 protocol type.""" - NF_SV4 = "NFSv4" - """NFSv4 protocol type.""" - SMB = "SMB" - """SMB/CIFS protocol type.""" - - -class ElasticResourceAvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current availability status of the resource.""" - - ONLINE = "Online" - """The resource is currently Online and accessible.""" - OFFLINE = "Offline" - """The resource is currently Offline and not accessible.""" - - -class ElasticRootAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Root access.""" - - ENABLED = "Enabled" - """Root user access is enabled for clients affected by this rule.""" - DISABLED = "Disabled" - """Root user access is disabled for clients affected by this rule.""" - - -class ElasticServiceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Service level for elastic capacity pool.""" - - ZONE_REDUNDANT = "ZoneRedundant" - """Zone redundant storage service level.""" - - -class ElasticSmbEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SMB encryption.""" - - ENABLED = "Enabled" - """Value indicating the SMB encryption is enabled.""" - DISABLED = "Disabled" - """Value indicating the SMB encryption is disabled.""" - - -class ElasticUnixAccessRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Unix access rule.""" - - READ_ONLY = "ReadOnly" - """Clients connecting with this rule will only have read access to the volume.""" - READ_WRITE = "ReadWrite" - """Clients connecting with this rule will have full read and write access to the volume.""" - NO_ACCESS = "NoAccess" - """Clients connecting with this rule will have no access to the volume.""" - - -class ElasticVolumePolicyEnforcement(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy enforcement.""" - - ENFORCED = "Enforced" - """Value indicating the policy is enforced on the volume.""" - NOT_ENFORCED = "NotEnforced" - """Value indicating the policy is not enforced on the volume.""" - - -class ElasticVolumeRestorationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current state of the restoration process.""" - - RESTORING = "Restoring" - """Value indicating that the volume is currently restoring.""" - RESTORED = "Restored" - """Value indicating that the volume is restored.""" - FAILED = "Failed" - """Value indicating that the volume restore has failed.""" - - class EnableSubvolumes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Flag indicating whether subvolume operations are enabled on the volume Deprecated. This type will be removed in a future API version. @@ -635,21 +461,6 @@ class KeyVaultStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """KeyVault connection Updating.""" -class LargeVolumeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the type of the Large Volume. When set to 'LargeVolume', the large volume is created - with standard configuration. If it is set to 'ExtraLargeVolume7Dot2PiB', the extra large volume - is created with higher capacity limit 7.2PiB with cool access enabled, delivering higher - capacity limit with lower costs. - """ - - LARGE_VOLUME = "LargeVolume" - """The large volume is created with standard configuration that provides standard performance and - throughput.""" - EXTRA_LARGE_VOLUME7_DOT2_PI_B = "PremExtraLargeVolume7Dot2PiB" - """The extra large volume is created with higher volume capacity limit 7.2PiB with cool access - enabled, delivering higher capacity limit with lower costs.""" - - class LdapServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the LDAP server.""" @@ -713,6 +524,12 @@ class MultiAdStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): class NetAppProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gets the status of the VolumeQuotaRule at the time the operation was called.""" + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" ACCEPTED = "Accepted" """Resource has been Accepted.""" CREATING = "Creating" @@ -725,10 +542,6 @@ class NetAppProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Resource is being Deleted.""" MOVING = "Moving" """Resource is being Moved.""" - FAILED = "Failed" - """Resource has Failed.""" - SUCCEEDED = "Succeeded" - """Resource has Succeeded.""" class NetworkFeatures(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -776,15 +589,6 @@ class OnCertificateConflictAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): existing certificate will continue to be in use.""" -class PolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy status.""" - - ENABLED = "Enabled" - """Value indicating the policy is enabled.""" - DISABLED = "Disabled" - """Value indicating the policy is disabled.""" - - class ProtocolTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Set of supported protocol types, which include NFSv3, NFSv4 and SMB protocol.""" @@ -969,26 +773,6 @@ class SmbNonBrowsable(str, Enum, metaclass=CaseInsensitiveEnumMeta): """smbNonBrowsable share setting is enabled.""" -class SnapshotDirectoryVisibility(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Controls the visibility of the Elastic Volume's read-only snapshot directory, which provides - access to each of the volume's snapshots. - """ - - HIDDEN = "Hidden" - """Value indicating the read-only snapshot directory is not visible.""" - VISIBLE = "Visible" - """Value indicating the read-only snapshot directory is visible.""" - - -class SnapshotUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Snapshot usage for backup.""" - - USE_EXISTING_SNAPSHOT = "UseExistingSnapshot" - """Value indicating an existing snapshot is used.""" - CREATE_NEW_SNAPSHOT = "CreateNewSnapshot" - """Value indicating a new snapshot is created.""" - - class VolumeBackupRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of the volume backup relationship.""" @@ -1167,15 +951,6 @@ class VolumeRestoreRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMe """UNKNOWN.""" -class VolumeSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Volume size for backup.""" - - LARGE = "Large" - """Value indicating backup is for a large volume.""" - REGULAR = "Regular" - """Value indicating backup is not for a large volume.""" - - class VolumeStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provides storage to network proximity information for the volume.""" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py index 5672eb036ddd..44a91d0cf355 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py @@ -66,6 +66,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class AccountEncryptionPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Encryption settings for PATCH operations (no default values). + + :ivar key_source: The encryption keySource (provider). Possible values (case-insensitive): + Microsoft.NetApp, Microsoft.KeyVault. Known values are: "Microsoft.NetApp" and + "Microsoft.KeyVault". + :vartype key_source: str or ~azure.mgmt.netapp.models.KeySource + :ivar key_vault_properties: Properties provided by KeVault. Applicable if keySource is + 'Microsoft.KeyVault'. + :vartype key_vault_properties: ~azure.mgmt.netapp.models.KeyVaultPropertiesPatch + :ivar identity: Identity used to authenticate to KeyVault. Applicable if keySource is + 'Microsoft.KeyVault'. + :vartype identity: ~azure.mgmt.netapp.models.EncryptionIdentityPatch + """ + + key_source: Optional[Union[str, "_models.KeySource"]] = rest_field( + name="keySource", visibility=["read", "create", "update", "delete", "query"] + ) + """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.NetApp, + Microsoft.KeyVault. Known values are: \"Microsoft.NetApp\" and \"Microsoft.KeyVault\".""" + key_vault_properties: Optional["_models.KeyVaultPropertiesPatch"] = rest_field( + name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Properties provided by KeVault. Applicable if keySource is 'Microsoft.KeyVault'.""" + identity: Optional["_models.EncryptionIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" + + @overload + def __init__( + self, + *, + key_source: Optional[Union[str, "_models.KeySource"]] = None, + key_vault_properties: Optional["_models.KeyVaultPropertiesPatch"] = None, + identity: Optional["_models.EncryptionIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """NetApp account properties. @@ -73,8 +122,6 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat :vartype provisioning_state: str :ivar active_directories: Active Directories. :vartype active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] - :ivar entra_id_config: Entra ID configuration for the account. - :vartype entra_id_config: ~azure.mgmt.netapp.models.EntraIdConfig :ivar encryption: Encryption settings. :vartype encryption: ~azure.mgmt.netapp.models.AccountEncryption :ivar disable_showmount: Shows the status of disableShowmount for all volumes under the @@ -96,10 +143,6 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat name="activeDirectories", visibility=["read", "create", "update", "delete", "query"] ) """Active Directories.""" - entra_id_config: Optional["_models.EntraIdConfig"] = rest_field( - name="entraIdConfig", visibility=["read", "create", "update", "delete", "query"] - ) - """Entra ID configuration for the account.""" encryption: Optional["_models.AccountEncryption"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -125,7 +168,6 @@ def __init__( self, *, active_directories: Optional[list["_models.ActiveDirectory"]] = None, - entra_id_config: Optional["_models.EntraIdConfig"] = None, encryption: Optional["_models.AccountEncryption"] = None, nfs_v4_id_domain: Optional[str] = None, ldap_configuration: Optional["_models.LdapConfiguration"] = None, @@ -146,23 +188,21 @@ class AccountPropertiesPatch(_Model): # pylint: disable=docstring-keyword-shoul """NetApp account patch properties. :ivar active_directories: Active Directories. - :vartype active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] + :vartype active_directories: list[~azure.mgmt.netapp.models.ActiveDirectoryPatch] :ivar encryption: Encryption settings. - :vartype encryption: ~azure.mgmt.netapp.models.AccountEncryption + :vartype encryption: ~azure.mgmt.netapp.models.AccountEncryptionPatch :ivar nfs_v4_id_domain: Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. :vartype nfs_v4_id_domain: str - :ivar entra_id_config: Entra ID configuration for the account. - :vartype entra_id_config: ~azure.mgmt.netapp.models.EntraIdConfigPatch :ivar ldap_configuration: LDAP Configuration for the account. :vartype ldap_configuration: ~azure.mgmt.netapp.models.LdapConfigurationPatch """ - active_directories: Optional[list["_models.ActiveDirectory"]] = rest_field( + active_directories: Optional[list["_models.ActiveDirectoryPatch"]] = rest_field( name="activeDirectories", visibility=["read", "create", "update", "delete", "query"] ) """Active Directories.""" - encryption: Optional["_models.AccountEncryption"] = rest_field( + encryption: Optional["_models.AccountEncryptionPatch"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Encryption settings.""" @@ -171,10 +211,6 @@ class AccountPropertiesPatch(_Model): # pylint: disable=docstring-keyword-shoul ) """Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes.""" - entra_id_config: Optional["_models.EntraIdConfigPatch"] = rest_field( - name="entraIdConfig", visibility=["read", "create", "update", "delete", "query"] - ) - """Entra ID configuration for the account.""" ldap_configuration: Optional["_models.LdapConfigurationPatch"] = rest_field( name="ldapConfiguration", visibility=["read", "create", "update", "delete", "query"] ) @@ -184,10 +220,9 @@ class AccountPropertiesPatch(_Model): # pylint: disable=docstring-keyword-shoul def __init__( self, *, - active_directories: Optional[list["_models.ActiveDirectory"]] = None, - encryption: Optional["_models.AccountEncryption"] = None, + active_directories: Optional[list["_models.ActiveDirectoryPatch"]] = None, + encryption: Optional["_models.AccountEncryptionPatch"] = None, nfs_v4_id_domain: Optional[str] = None, - entra_id_config: Optional["_models.EntraIdConfigPatch"] = None, ldap_configuration: Optional["_models.LdapConfigurationPatch"] = None, ) -> None: ... @@ -390,156 +425,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_Model): - """Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tracked Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ActiveDirectoryConfig(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Active Directory Configuration resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ActiveDirectoryConfigProperties - :ivar etag: "If etag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). - :vartype etag: str - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.netapp.models.ManagedServiceIdentity - """ - - properties: Optional["_models.ActiveDirectoryConfigProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """\"If etag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ActiveDirectoryConfigProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ActiveDirectoryConfigProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Active Directory Configuration properties. +class ActiveDirectoryPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Active Directory settings for PATCH operations (no default values). - :ivar user_name: A domain user account with permission to create machine accounts. - :vartype user_name: str - :ivar dns: An array of DNS server IP addresses(IPv4 only) for the Active Directory. - :vartype dns: list[str] + :ivar active_directory_id: Id of the Active Directory. + :vartype active_directory_id: str + :ivar username: A domain user account with permission to create machine accounts. + :vartype username: str + :ivar password: Plain text password of Active Directory domain administrator, value is masked + in the response. + :vartype password: str + :ivar domain: Name of the Active Directory domain. + :vartype domain: str + :ivar dns: Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory + domain. + :vartype dns: str :ivar smb_server_name: NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes. :vartype smb_server_name: str :ivar organizational_unit: The Organizational Unit (OU) within the Windows Active Directory. :vartype organizational_unit: str :ivar site: The Active Directory site the service will limit Domain Controller discovery to. - Required. :vartype site: str :ivar backup_operators: Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier. @@ -547,27 +453,52 @@ class ActiveDirectoryConfigProperties(_Model): # pylint: disable=docstring-keyw :ivar administrators: Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier. :vartype administrators: list[str] - :ivar security_operators: Domain Users in the Active directory to be given SecurityPrivilege + :ivar kdc_ip: kdc server IP address for the active directory machine. This optional parameter + is used only while creating kerberos volume. + :vartype kdc_ip: str + :ivar ad_name: Name of the active directory machine. This optional parameter is used only while + creating kerberos volume. + :vartype ad_name: str + :ivar server_root_ca_certificate: When LDAP over SSL/TLS is enabled, the LDAP client is + required to have base64 encoded Active Directory Certificate Service's self-signed root CA + certificate, this optional parameter is used only for dual protocol with LDAP user-mapping + volumes. + :vartype server_root_ca_certificate: str + :ivar aes_encryption: If enabled, AES encryption will be enabled for SMB communication. + :vartype aes_encryption: bool + :ivar ldap_signing: Specifies whether or not the LDAP traffic needs to be signed. + :vartype ldap_signing: bool + :ivar security_operators: Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier. :vartype security_operators: list[str] - :ivar active_directory_status: Status of the Active Directory. Known values are: "Created", - "InUse", "Deleted", "Error", and "Updating". - :vartype active_directory_status: str or ~azure.mgmt.netapp.models.ActiveDirectoryStatus - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - :ivar domain: Name of the Active Directory domain. Required. - :vartype domain: str - :ivar secret_password: Access password from Azure KeyVault Secrets to connect Active Directory. - Required. - :vartype secret_password: ~azure.mgmt.netapp.models.SecretPassword + :ivar ldap_over_tls: Specifies whether or not the LDAP traffic needs to be secured via TLS. + :vartype ldap_over_tls: bool + :ivar allow_local_nfs_users_with_ldap: If enabled, NFS client local users can also (in addition + to LDAP users) access the NFS volumes. + :vartype allow_local_nfs_users_with_ldap: bool + :ivar encrypt_dc_connections: If enabled, Traffic between the SMB server to Domain Controller + (DC) will be encrypted. + :vartype encrypt_dc_connections: bool + :ivar ldap_search_scope: LDAP Search scope options. + :vartype ldap_search_scope: ~azure.mgmt.netapp.models.LdapSearchScopeOpt + :ivar preferred_servers_for_ldap_client: Comma separated list of IPv4 addresses of preferred + servers for LDAP client. At most two comma separated IPv4 addresses can be passed. + :vartype preferred_servers_for_ldap_client: str """ - user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"]) + active_directory_id: Optional[str] = rest_field( + name="activeDirectoryId", visibility=["read", "create", "update", "delete", "query"] + ) + """Id of the Active Directory.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A domain user account with permission to create machine accounts.""" - dns: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An array of DNS server IP addresses(IPv4 only) for the Active Directory.""" + password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Plain text password of Active Directory domain administrator, value is masked in the response.""" + domain: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Active Directory domain.""" + dns: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain.""" smb_server_name: Optional[str] = rest_field( name="smbServerName", visibility=["read", "create", "update", "delete", "query"] ) @@ -577,8 +508,8 @@ class ActiveDirectoryConfigProperties(_Model): # pylint: disable=docstring-keyw name="organizationalUnit", visibility=["read", "create", "update", "delete", "query"] ) """The Organizational Unit (OU) within the Windows Active Directory.""" - site: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Active Directory site the service will limit Domain Controller discovery to. Required.""" + site: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Active Directory site the service will limit Domain Controller discovery to.""" backup_operators: Optional[list[str]] = rest_field( name="backupOperators", visibility=["read", "create", "update", "delete", "query"] ) @@ -587,176 +518,78 @@ class ActiveDirectoryConfigProperties(_Model): # pylint: disable=docstring-keyw administrators: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier.""" - security_operators: Optional[list[str]] = rest_field( - name="securityOperators", visibility=["read", "create", "update", "delete", "query"] + kdc_ip: Optional[str] = rest_field(name="kdcIP", visibility=["read", "create", "update", "delete", "query"]) + """kdc server IP address for the active directory machine. This optional parameter is used only + while creating kerberos volume.""" + ad_name: Optional[str] = rest_field(name="adName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the active directory machine. This optional parameter is used only while creating + kerberos volume.""" + server_root_ca_certificate: Optional[str] = rest_field( + name="serverRootCACertificate", visibility=["read", "create", "update", "delete", "query"] ) - """Domain Users in the Active directory to be given SecurityPrivilege privilege (Needed for SMB - Continuously available shares for SQL). A list of unique usernames without domain specifier.""" - active_directory_status: Optional[Union[str, "_models.ActiveDirectoryStatus"]] = rest_field( - name="activeDirectoryStatus", visibility=["read"] + """When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active + Directory Certificate Service's self-signed root CA certificate, this optional parameter is + used only for dual protocol with LDAP user-mapping volumes.""" + aes_encryption: Optional[bool] = rest_field( + name="aesEncryption", visibility=["read", "create", "update", "delete", "query"] ) - """Status of the Active Directory. Known values are: \"Created\", \"InUse\", \"Deleted\", - \"Error\", and \"Updating\".""" - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Active Directory domain. Required.""" - secret_password: "_models.SecretPassword" = rest_field( - name="secretPassword", visibility=["read", "create", "update", "delete", "query"] - ) - """Access password from Azure KeyVault Secrets to connect Active Directory. Required.""" - - @overload - def __init__( - self, - *, - site: str, - domain: str, - secret_password: "_models.SecretPassword", - user_name: Optional[str] = None, - dns: Optional[list[str]] = None, - smb_server_name: Optional[str] = None, - organizational_unit: Optional[str] = None, - backup_operators: Optional[list[str]] = None, - administrators: Optional[list[str]] = None, - security_operators: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ActiveDirectoryConfigUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ActiveDirectoryConfig. - - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.netapp.models.ManagedServiceIdentity - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ActiveDirectoryConfigUpdateProperties - """ - - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """If enabled, AES encryption will be enabled for SMB communication.""" + ldap_signing: Optional[bool] = rest_field( + name="ldapSigning", visibility=["read", "create", "update", "delete", "query"] ) - """The managed service identities assigned to this resource.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - properties: Optional["_models.ActiveDirectoryConfigUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Specifies whether or not the LDAP traffic needs to be signed.""" + security_operators: Optional[list[str]] = rest_field( + name="securityOperators", visibility=["read", "create", "update", "delete", "query"] ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ActiveDirectoryConfigUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ActiveDirectoryConfigUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The updatable properties of the ActiveDirectoryConfig. - - :ivar user_name: A domain user account with permission to create machine accounts. - :vartype user_name: str - :ivar dns: An array of DNS server IP addresses(IPv4 only) for the Active Directory. - :vartype dns: list[str] - :ivar smb_server_name: NetBIOS name of the SMB server. This name will be registered as a - computer account in the AD and used to mount volumes. - :vartype smb_server_name: str - :ivar organizational_unit: The Organizational Unit (OU) within the Windows Active Directory. - :vartype organizational_unit: str - :ivar site: The Active Directory site the service will limit Domain Controller discovery to. - :vartype site: str - :ivar backup_operators: Users to be added to the Built-in Backup Operator active directory - group. A list of unique usernames without domain specifier. - :vartype backup_operators: list[str] - :ivar administrators: Users to be added to the Built-in Administrators active directory group. - A list of unique usernames without domain specifier. - :vartype administrators: list[str] - :ivar security_operators: Domain Users in the Active directory to be given SecurityPrivilege - privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames - without domain specifier. - :vartype security_operators: list[str] - :ivar domain: Name of the Active Directory domain. - :vartype domain: str - :ivar secret_password: Access password from Azure KeyVault Secrets to connect Active Directory. - :vartype secret_password: ~azure.mgmt.netapp.models.SecretPassword - """ - - user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"]) - """A domain user account with permission to create machine accounts.""" - dns: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An array of DNS server IP addresses(IPv4 only) for the Active Directory.""" - smb_server_name: Optional[str] = rest_field( - name="smbServerName", visibility=["read", "create", "update", "delete", "query"] + """Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB + Continuously available shares for SQL). A list of unique usernames without domain specifier.""" + ldap_over_tls: Optional[bool] = rest_field( + name="ldapOverTLS", visibility=["read", "create", "update", "delete", "query"] ) - """NetBIOS name of the SMB server. This name will be registered as a computer account in the AD - and used to mount volumes.""" - organizational_unit: Optional[str] = rest_field( - name="organizationalUnit", visibility=["read", "create", "update", "delete", "query"] + """Specifies whether or not the LDAP traffic needs to be secured via TLS.""" + allow_local_nfs_users_with_ldap: Optional[bool] = rest_field( + name="allowLocalNfsUsersWithLdap", visibility=["read", "create", "update", "delete", "query"] ) - """The Organizational Unit (OU) within the Windows Active Directory.""" - site: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Active Directory site the service will limit Domain Controller discovery to.""" - backup_operators: Optional[list[str]] = rest_field( - name="backupOperators", visibility=["read", "create", "update", "delete", "query"] + """If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes.""" + encrypt_dc_connections: Optional[bool] = rest_field( + name="encryptDCConnections", visibility=["read", "create", "update", "delete", "query"] ) - """Users to be added to the Built-in Backup Operator active directory group. A list of unique - usernames without domain specifier.""" - administrators: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Users to be added to the Built-in Administrators active directory group. A list of unique - usernames without domain specifier.""" - security_operators: Optional[list[str]] = rest_field( - name="securityOperators", visibility=["read", "create", "update", "delete", "query"] + """If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted.""" + ldap_search_scope: Optional["_models.LdapSearchScopeOpt"] = rest_field( + name="ldapSearchScope", visibility=["read", "create", "update", "delete", "query"] ) - """Domain Users in the Active directory to be given SecurityPrivilege privilege (Needed for SMB - Continuously available shares for SQL). A list of unique usernames without domain specifier.""" - domain: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Active Directory domain.""" - secret_password: Optional["_models.SecretPassword"] = rest_field( - name="secretPassword", visibility=["read", "create", "update", "delete", "query"] + """LDAP Search scope options.""" + preferred_servers_for_ldap_client: Optional[str] = rest_field( + name="preferredServersForLdapClient", visibility=["read", "create", "update", "delete", "query"] ) - """Access password from Azure KeyVault Secrets to connect Active Directory.""" + """Comma separated list of IPv4 addresses of preferred servers for LDAP client. At most two comma + separated IPv4 addresses can be passed.""" @overload def __init__( self, *, - user_name: Optional[str] = None, - dns: Optional[list[str]] = None, + active_directory_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + domain: Optional[str] = None, + dns: Optional[str] = None, smb_server_name: Optional[str] = None, organizational_unit: Optional[str] = None, site: Optional[str] = None, backup_operators: Optional[list[str]] = None, administrators: Optional[list[str]] = None, + kdc_ip: Optional[str] = None, + ad_name: Optional[str] = None, + server_root_ca_certificate: Optional[str] = None, + aes_encryption: Optional[bool] = None, + ldap_signing: Optional[bool] = None, security_operators: Optional[list[str]] = None, - domain: Optional[str] = None, - secret_password: Optional["_models.SecretPassword"] = None, + ldap_over_tls: Optional[bool] = None, + allow_local_nfs_users_with_ldap: Optional[bool] = None, + encrypt_dc_connections: Optional[bool] = None, + ldap_search_scope: Optional["_models.LdapSearchScopeOpt"] = None, + preferred_servers_for_ldap_client: Optional[str] = None, ) -> None: ... @overload @@ -852,6 +685,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + class ProxyResource(Resource): """Proxy Resource. @@ -1021,6 +882,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class BackupPolicy(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Backup policy information. @@ -1926,8 +1831,8 @@ class BucketPatchProperties(_Model): # pylint: disable=docstring-keyword-should user's uid and gid. For Windows, this is the user's username. Note that the Unix and Windows user details are mutually exclusive, meaning one or other must be supplied, but not both. :vartype file_system_user: ~azure.mgmt.netapp.models.FileSystemUser - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Creating", "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", "Creating", "Patching", "Updating", "Deleting", and "Moving". :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState :ivar server: Properties of the server managing the lifecycle of volume buckets. :vartype server: ~azure.mgmt.netapp.models.BucketServerPatchProperties @@ -1959,8 +1864,8 @@ class BucketPatchProperties(_Model): # pylint: disable=docstring-keyword-should provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """Provisioning state of the resource. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", \"Creating\", \"Patching\", \"Updating\", \"Deleting\", and \"Moving\".""" server: Optional["_models.BucketServerPatchProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -2018,8 +1923,8 @@ class BucketProperties(_Model): # pylint: disable=docstring-keyword-should-matc user's uid and gid. For Windows, this is the user's username. Note that the Unix and Windows user details are mutually exclusive, meaning one or other must be supplied, but not both. :vartype file_system_user: ~azure.mgmt.netapp.models.FileSystemUser - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Creating", "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", "Creating", "Patching", "Updating", "Deleting", and "Moving". :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState :ivar status: The bucket credentials status. There states: @@ -2062,8 +1967,8 @@ class BucketProperties(_Model): # pylint: disable=docstring-keyword-should-matc provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """Provisioning state of the resource. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", \"Creating\", \"Patching\", \"Updating\", \"Deleting\", and \"Moving\".""" status: Optional[Union[str, "_models.CredentialsStatus"]] = rest_field(visibility=["read"]) """The bucket credentials status. There states: @@ -2864,11 +2769,6 @@ class CertificateAkvDetails(_Model): # pylint: disable=docstring-keyword-should :ivar certificate_name: The name of the bucket server certificate stored in the Azure Key Vault. :vartype certificate_name: str - :ivar user_assigned_identity: Optional resource ID of the managed identity that has access to - the Azure Key Vault (AKV) secret. If a value is provided, it is used to find a matching entry - in the account's collection of user-assigned managed identities. If no match is found, an - exception is thrown. If no value is provided, the system-assigned managed identity is used. - :vartype user_assigned_identity: str """ certificate_key_vault_uri: Optional[str] = rest_field( @@ -2879,13 +2779,6 @@ class CertificateAkvDetails(_Model): # pylint: disable=docstring-keyword-should name="certificateName", visibility=["read", "create", "update", "delete", "query"] ) """The name of the bucket server certificate stored in the Azure Key Vault.""" - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional resource ID of the managed identity that has access to the Azure Key Vault (AKV) - secret. If a value is provided, it is used to find a matching entry in the account's collection - of user-assigned managed identities. If no match is found, an exception is thrown. If no value - is provided, the system-assigned managed identity is used.""" @overload def __init__( @@ -2893,7 +2786,6 @@ def __init__( *, certificate_key_vault_uri: Optional[str] = None, certificate_name: Optional[str] = None, - user_assigned_identity: Optional[str] = None, ) -> None: ... @overload @@ -2959,34 +2851,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChangeZoneRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Changes the zone for the Zone Redundant elastic capacity pool. - - :ivar new_zone: Availability zone to move Zone Redundant elastic capacity pool to. Required. - :vartype new_zone: str - """ - - new_zone: str = rest_field(name="newZone", visibility=["read", "create", "update", "delete", "query"]) - """Availability zone to move Zone Redundant elastic capacity pool to. Required.""" - - @overload - def __init__( - self, - *, - new_zone: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class CheckAvailabilityResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Information regarding availability of a resource. @@ -3041,98 +2905,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CheckElasticResourceAvailabilityResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Information regarding availability of a resource. +class CifsUser(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The effective CIFS username when accessing the volume data. - :ivar is_available: True indicates name is valid and available. False indicates the name is - invalid, unavailable, or both. Known values are: "True" and "False". - :vartype is_available: str or ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityStatus - :ivar reason: Invalid indicates the name provided does not match Azure NetApp Files naming - requirements. AlreadyExists indicates that the name is already in use and is therefore - unavailable. Known values are: "Invalid" and "AlreadyExists". - :vartype reason: str or ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityReason - :ivar message: If reason == invalid, provide the user with the reason why the given name is - invalid, and provide the resource naming requirements so that the user can select a valid name. - If reason == AlreadyExists, explain that resource name is already in use, and direct them to - select a different name. - :vartype message: str - """ - - is_available: Optional[Union[str, "_models.CheckElasticResourceAvailabilityStatus"]] = rest_field( - name="isAvailable", visibility=["read", "create", "update", "delete", "query"] - ) - """True indicates name is valid and available. False indicates the name is invalid, unavailable, - or both. Known values are: \"True\" and \"False\".""" - reason: Optional[Union[str, "_models.CheckElasticResourceAvailabilityReason"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Invalid indicates the name provided does not match Azure NetApp Files naming requirements. - AlreadyExists indicates that the name is already in use and is therefore unavailable. Known - values are: \"Invalid\" and \"AlreadyExists\".""" - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If reason == invalid, provide the user with the reason why the given name is invalid, and - provide the resource naming requirements so that the user can select a valid name. If reason == - AlreadyExists, explain that resource name is already in use, and direct them to select a - different name.""" - - @overload - def __init__( - self, - *, - is_available: Optional[Union[str, "_models.CheckElasticResourceAvailabilityStatus"]] = None, - reason: Optional[Union[str, "_models.CheckElasticResourceAvailabilityReason"]] = None, - message: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CheckElasticVolumeFilePathAvailabilityRequest( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """File path availability request content - availability is based on the elastic volume filePath - within the given elastic capacityPool. - - :ivar file_path: A unique file path for the volume. Used when creating mount targets. This - needs to be unique within the elastic capacity pool. Required. - :vartype file_path: str - """ - - file_path: str = rest_field(name="filePath", visibility=["read", "create", "update", "delete", "query"]) - """A unique file path for the volume. Used when creating mount targets. This needs to be unique - within the elastic capacity pool. Required.""" - - @overload - def __init__( - self, - *, - file_path: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CifsUser(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The effective CIFS username when accessing the volume data. - - :ivar username: The CIFS user's username. - :vartype username: str + :ivar username: The CIFS user's username. + :vartype username: str """ username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3237,11 +3014,6 @@ class CredentialsAkvDetails(_Model): # pylint: disable=docstring-keyword-should "secret_access_key": "" }. :vartype secret_name: str - :ivar user_assigned_identity: Optional resource ID of the managed identity that has access to - the Azure Key Vault (AKV) secret. If a value is provided, it is used to find a matching entry - in the account's collection of user-assigned managed identities. If no match is found, an - exception is thrown. If no value is provided, the system-assigned managed identity is used. - :vartype user_assigned_identity: str """ credentials_key_vault_uri: Optional[str] = rest_field( @@ -3258,13 +3030,6 @@ class CredentialsAkvDetails(_Model): # pylint: disable=docstring-keyword-should \"access_key_id\": \"\", \"secret_access_key\": \"\" }.""" - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional resource ID of the managed identity that has access to the Azure Key Vault (AKV) - secret. If a value is provided, it is used to find a matching entry in the account's collection - of user-assigned managed identities. If no match is found, an exception is thrown. If no value - is provided, the system-assigned managed identity is used.""" @overload def __init__( @@ -3272,7 +3037,6 @@ def __init__( *, credentials_key_vault_uri: Optional[str] = None, secret_name: Optional[str] = None, - user_assigned_identity: Optional[str] = None, ) -> None: ... @overload @@ -3388,2299 +3152,20 @@ class Dimension(_Model): # pylint: disable=docstring-keyword-should-match-keywo :ivar display_name: Display name of dimension. :vartype display_name: str """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display name of dimension.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display name of dimension.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticAccount(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp elastic account resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticAccountProperties - :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype e_tag: str - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.netapp.models.ManagedServiceIdentity - """ - - properties: Optional["_models.ElasticAccountProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticAccountProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticAccountProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp elastic account properties. - - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - :ivar encryption: Encryption settings. - :vartype encryption: ~azure.mgmt.netapp.models.ElasticEncryption - """ - - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - encryption: Optional["_models.ElasticEncryption"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Encryption settings.""" - - @overload - def __init__( - self, - *, - encryption: Optional["_models.ElasticEncryption"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticAccountUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ElasticAccount. - - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.netapp.models.ManagedServiceIdentity - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticAccountUpdateProperties - """ - - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - properties: Optional["_models.ElasticAccountUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticAccountUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticAccountUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The updatable properties of the ElasticAccount. - - :ivar encryption: Encryption settings. - :vartype encryption: ~azure.mgmt.netapp.models.ElasticEncryption - """ - - encryption: Optional["_models.ElasticEncryption"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Encryption settings.""" - - @overload - def __init__( - self, - *, - encryption: Optional["_models.ElasticEncryption"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackup(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp Elastic Backup under an elastic Backup Vault. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticBackupProperties - """ - - properties: Optional["_models.ElasticBackupProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ElasticBackupProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupPolicy(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp Elastic Backup Policy resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticBackupPolicyProperties - :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype e_tag: str - """ - - properties: Optional["_models.ElasticBackupPolicyProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticBackupPolicyProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Backup Policy properties. - - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - :ivar daily_backups_to_keep: Daily backups count to keep. - :vartype daily_backups_to_keep: int - :ivar weekly_backups_to_keep: Weekly backups count to keep. - :vartype weekly_backups_to_keep: int - :ivar monthly_backups_to_keep: Monthly backups count to keep. - :vartype monthly_backups_to_keep: int - :ivar assigned_volumes_count: The number of volumes currently using this Backup Policy. - :vartype assigned_volumes_count: int - :ivar policy_state: The property to identify whether Backup Policy is enabled or not. Known - values are: "Enabled" and "Disabled". - :vartype policy_state: str or ~azure.mgmt.netapp.models.ElasticBackupPolicyState - """ - - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - daily_backups_to_keep: Optional[int] = rest_field( - name="dailyBackupsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Daily backups count to keep.""" - weekly_backups_to_keep: Optional[int] = rest_field( - name="weeklyBackupsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Weekly backups count to keep.""" - monthly_backups_to_keep: Optional[int] = rest_field( - name="monthlyBackupsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Monthly backups count to keep.""" - assigned_volumes_count: Optional[int] = rest_field(name="assignedVolumesCount", visibility=["read"]) - """The number of volumes currently using this Backup Policy.""" - policy_state: Optional[Union[str, "_models.ElasticBackupPolicyState"]] = rest_field( - name="policyState", visibility=["read", "create", "update", "delete", "query"] - ) - """The property to identify whether Backup Policy is enabled or not. Known values are: \"Enabled\" - and \"Disabled\".""" - - @overload - def __init__( - self, - *, - daily_backups_to_keep: Optional[int] = None, - weekly_backups_to_keep: Optional[int] = None, - monthly_backups_to_keep: Optional[int] = None, - policy_state: Optional[Union[str, "_models.ElasticBackupPolicyState"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupPolicyUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ElasticBackupPolicy. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticBackupPolicyUpdateProperties - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - properties: Optional["_models.ElasticBackupPolicyUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticBackupPolicyUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupPolicyUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The updatable properties of the ElasticBackupPolicy. - - :ivar daily_backups_to_keep: Daily backups count to keep. - :vartype daily_backups_to_keep: int - :ivar weekly_backups_to_keep: Weekly backups count to keep. - :vartype weekly_backups_to_keep: int - :ivar monthly_backups_to_keep: Monthly backups count to keep. - :vartype monthly_backups_to_keep: int - :ivar policy_state: The property to identify whether Backup Policy is enabled or not. Known - values are: "Enabled" and "Disabled". - :vartype policy_state: str or ~azure.mgmt.netapp.models.ElasticBackupPolicyState - """ - - daily_backups_to_keep: Optional[int] = rest_field( - name="dailyBackupsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Daily backups count to keep.""" - weekly_backups_to_keep: Optional[int] = rest_field( - name="weeklyBackupsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Weekly backups count to keep.""" - monthly_backups_to_keep: Optional[int] = rest_field( - name="monthlyBackupsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Monthly backups count to keep.""" - policy_state: Optional[Union[str, "_models.ElasticBackupPolicyState"]] = rest_field( - name="policyState", visibility=["read", "create", "update", "delete", "query"] - ) - """The property to identify whether Backup Policy is enabled or not. Known values are: \"Enabled\" - and \"Disabled\".""" - - @overload - def __init__( - self, - *, - daily_backups_to_keep: Optional[int] = None, - weekly_backups_to_keep: Optional[int] = None, - monthly_backups_to_keep: Optional[int] = None, - policy_state: Optional[Union[str, "_models.ElasticBackupPolicyState"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Backup properties. - - :ivar creation_date: The creation date of the backup. - :vartype creation_date: ~datetime.datetime - :ivar snapshot_creation_date: The snapshot creation date of the backup. - :vartype snapshot_creation_date: ~datetime.datetime - :ivar completion_date: The completion date of the backup. - :vartype completion_date: ~datetime.datetime - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - :ivar size: Size of backup in bytes. - :vartype size: int - :ivar label: Label for backup. - :vartype label: str - :ivar backup_type: Type of backup Manual or Scheduled. Known values are: "Manual" and - "Scheduled". - :vartype backup_type: str or ~azure.mgmt.netapp.models.ElasticBackupType - :ivar failure_reason: Failure reason. - :vartype failure_reason: str - :ivar elastic_volume_resource_id: ResourceId used to identify the Elastic Volume. Required. - :vartype elastic_volume_resource_id: str - :ivar snapshot_usage: Manual backup using an already existing snapshot. This will always be - CreateNewSnapshot for scheduled backups and UseExistingSnapshot/CreateNewSnapshot for manual - backups. Known values are: "UseExistingSnapshot" and "CreateNewSnapshot". - :vartype snapshot_usage: str or ~azure.mgmt.netapp.models.SnapshotUsage - :ivar elastic_snapshot_resource_id: ResourceId used to identify the elastic snapshot resource. - This is required when an existing snapshot needs to be used for creating a manual backup. - :vartype elastic_snapshot_resource_id: str - :ivar elastic_backup_policy_resource_id: ResourceId used to identify the elastic backup policy. - :vartype elastic_backup_policy_resource_id: str - :ivar volume_size: Specifies if the backup is for a large volume. Known values are: "Large" and - "Regular". - :vartype volume_size: str or ~azure.mgmt.netapp.models.VolumeSize - """ - - creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") - """The creation date of the backup.""" - snapshot_creation_date: Optional[datetime.datetime] = rest_field( - name="snapshotCreationDate", visibility=["read"], format="rfc3339" - ) - """The snapshot creation date of the backup.""" - completion_date: Optional[datetime.datetime] = rest_field( - name="completionDate", visibility=["read"], format="rfc3339" - ) - """The completion date of the backup.""" - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - size: Optional[int] = rest_field(visibility=["read"]) - """Size of backup in bytes.""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Label for backup.""" - backup_type: Optional[Union[str, "_models.ElasticBackupType"]] = rest_field(name="backupType", visibility=["read"]) - """Type of backup Manual or Scheduled. Known values are: \"Manual\" and \"Scheduled\".""" - failure_reason: Optional[str] = rest_field(name="failureReason", visibility=["read"]) - """Failure reason.""" - elastic_volume_resource_id: str = rest_field(name="elasticVolumeResourceId", visibility=["read", "create"]) - """ResourceId used to identify the Elastic Volume. Required.""" - snapshot_usage: Optional[Union[str, "_models.SnapshotUsage"]] = rest_field( - name="snapshotUsage", visibility=["read", "create"] - ) - """Manual backup using an already existing snapshot. This will always be CreateNewSnapshot for - scheduled backups and UseExistingSnapshot/CreateNewSnapshot for manual backups. Known values - are: \"UseExistingSnapshot\" and \"CreateNewSnapshot\".""" - elastic_snapshot_resource_id: Optional[str] = rest_field( - name="elasticSnapshotResourceId", visibility=["read", "create"] - ) - """ResourceId used to identify the elastic snapshot resource. This is required when an existing - snapshot needs to be used for creating a manual backup.""" - elastic_backup_policy_resource_id: Optional[str] = rest_field( - name="elasticBackupPolicyResourceId", visibility=["read"] - ) - """ResourceId used to identify the elastic backup policy.""" - volume_size: Optional[Union[str, "_models.VolumeSize"]] = rest_field(name="volumeSize", visibility=["read"]) - """Specifies if the backup is for a large volume. Known values are: \"Large\" and \"Regular\".""" - - @overload - def __init__( - self, - *, - elastic_volume_resource_id: str, - label: Optional[str] = None, - snapshot_usage: Optional[Union[str, "_models.SnapshotUsage"]] = None, - elastic_snapshot_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupVault(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp elastic backup vault resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticBackupVaultProperties - :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype e_tag: str - """ - - properties: Optional["_models.ElasticBackupVaultProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticBackupVaultProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticBackupVaultProperties(_Model): - """Elastic Backup Vault properties. - - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - - -class ElasticBackupVaultUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ElasticBackupVault. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticCapacityPool(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp Elastic Capacity Pool resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticCapacityPoolProperties - :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype e_tag: str - :ivar zones: The availability zones. - :vartype zones: list[str] - """ - - properties: Optional["_models.ElasticCapacityPoolProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - zones: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """The availability zones.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticCapacityPoolProperties"] = None, - zones: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticCapacityPoolProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic capacity pool properties. - - :ivar size: Provisioned size of the pool (in bytes). For zoneRedundant service level pool, - value must be in the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values - expressed in bytes as multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to - 128TiB. Pool size can't be shrunk once it is created. Required. - :vartype size: int - :ivar service_level: The service level of the elastic capacity pool. Required. "ZoneRedundant" - :vartype service_level: str or ~azure.mgmt.netapp.models.ElasticServiceLevel - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - :ivar encryption: Encryption settings. - :vartype encryption: ~azure.mgmt.netapp.models.ElasticEncryptionConfiguration - :ivar total_throughput_mibps: Total throughput of the pool in MiB/s. - :vartype total_throughput_mibps: float - :ivar subnet_resource_id: The Azure Resource URI for a delegated subnet. Must have the - delegation Microsoft.NetApp/elasticVolumes, this is used by all the volumes within the pool. - Required. - :vartype subnet_resource_id: str - :ivar current_zone: Indicates the current zone of the pool. This can be changed for - zoneRedundant service level pool with the changeZone action. - :vartype current_zone: str - :ivar availability_status: Current availability status of the resource. Known values are: - "Online" and "Offline". - :vartype availability_status: str or - ~azure.mgmt.netapp.models.ElasticResourceAvailabilityStatus - :ivar active_directory_config_resource_id: The Azure Resource URI for an Active Directory - configuration. This is used by all the SMB volumes within the pool. - :vartype active_directory_config_resource_id: str - """ - - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provisioned size of the pool (in bytes). For zoneRedundant service level pool, value must be in - the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values expressed in bytes as - multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to 128TiB. Pool size can't be - shrunk once it is created. Required.""" - service_level: Union[str, "_models.ElasticServiceLevel"] = rest_field( - name="serviceLevel", visibility=["read", "create"] - ) - """The service level of the elastic capacity pool. Required. \"ZoneRedundant\"""" - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - encryption: Optional["_models.ElasticEncryptionConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Encryption settings.""" - total_throughput_mibps: Optional[float] = rest_field(name="totalThroughputMibps", visibility=["read"]) - """Total throughput of the pool in MiB/s.""" - subnet_resource_id: str = rest_field(name="subnetResourceId", visibility=["read", "create"]) - """The Azure Resource URI for a delegated subnet. Must have the delegation - Microsoft.NetApp/elasticVolumes, this is used by all the volumes within the pool. Required.""" - current_zone: Optional[str] = rest_field(name="currentZone", visibility=["read"]) - """Indicates the current zone of the pool. This can be changed for zoneRedundant service level - pool with the changeZone action.""" - availability_status: Optional[Union[str, "_models.ElasticResourceAvailabilityStatus"]] = rest_field( - name="availabilityStatus", visibility=["read"] - ) - """Current availability status of the resource. Known values are: \"Online\" and \"Offline\".""" - active_directory_config_resource_id: Optional[str] = rest_field( - name="activeDirectoryConfigResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure Resource URI for an Active Directory configuration. This is used by all the SMB - volumes within the pool.""" - - @overload - def __init__( - self, - *, - size: int, - service_level: Union[str, "_models.ElasticServiceLevel"], - subnet_resource_id: str, - encryption: Optional["_models.ElasticEncryptionConfiguration"] = None, - active_directory_config_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticCapacityPoolUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ElasticCapacityPool. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticCapacityPoolUpdateProperties - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - properties: Optional["_models.ElasticCapacityPoolUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticCapacityPoolUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticCapacityPoolUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The updatable properties of the ElasticCapacityPool. - - :ivar size: Provisioned size of the pool (in bytes). For zoneRedundant service level pool, - value must be in the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values - expressed in bytes as multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to - 128TiB. Pool size can't be shrunk once it is created. - :vartype size: int - :ivar encryption: Encryption settings. - :vartype encryption: ~azure.mgmt.netapp.models.ElasticEncryptionConfiguration - :ivar active_directory_config_resource_id: The Azure Resource URI for an Active Directory - configuration. This is used by all the SMB volumes within the pool. - :vartype active_directory_config_resource_id: str - """ - - size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provisioned size of the pool (in bytes). For zoneRedundant service level pool, value must be in - the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values expressed in bytes as - multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to 128TiB. Pool size can't be - shrunk once it is created.""" - encryption: Optional["_models.ElasticEncryptionConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Encryption settings.""" - active_directory_config_resource_id: Optional[str] = rest_field( - name="activeDirectoryConfigResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure Resource URI for an Active Directory configuration. This is used by all the SMB - volumes within the pool.""" - - @overload - def __init__( - self, - *, - size: Optional[int] = None, - encryption: Optional["_models.ElasticEncryptionConfiguration"] = None, - active_directory_config_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticEncryption(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Encryption settings. - - :ivar key_source: The encryption keySource (provider). Possible values (case-insensitive): - Microsoft.NetApp, Microsoft.KeyVault. Known values are: "Microsoft.NetApp" and - "Microsoft.KeyVault". - :vartype key_source: str or ~azure.mgmt.netapp.models.KeySource - :ivar key_vault_properties: Properties provided by KeyVault. Applicable if keySource is - 'Microsoft.KeyVault'. - :vartype key_vault_properties: ~azure.mgmt.netapp.models.ElasticKeyVaultProperties - :ivar identity: Identity used to authenticate to KeyVault. Applicable if keySource is - 'Microsoft.KeyVault'. - :vartype identity: ~azure.mgmt.netapp.models.ElasticEncryptionIdentity - """ - - key_source: Optional[Union[str, "_models.KeySource"]] = rest_field( - name="keySource", visibility=["read", "create", "update", "delete", "query"] - ) - """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.NetApp, - Microsoft.KeyVault. Known values are: \"Microsoft.NetApp\" and \"Microsoft.KeyVault\".""" - key_vault_properties: Optional["_models.ElasticKeyVaultProperties"] = rest_field( - name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Properties provided by KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" - identity: Optional["_models.ElasticEncryptionIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" - - @overload - def __init__( - self, - *, - key_source: Optional[Union[str, "_models.KeySource"]] = None, - key_vault_properties: Optional["_models.ElasticKeyVaultProperties"] = None, - identity: Optional["_models.ElasticEncryptionIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticEncryptionConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """CMK Encryption Configuration. - - :ivar elastic_pool_encryption_key_source: Pool Encryption Key Source. Required. Known values - are: "NetApp" and "KeyVault". - :vartype elastic_pool_encryption_key_source: str or - ~azure.mgmt.netapp.models.ElasticPoolEncryptionKeySource - :ivar key_vault_private_endpoint_resource_id: The resource ID of private endpoint for KeyVault. - It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = - 'Microsoft.KeyVault'. Required. - :vartype key_vault_private_endpoint_resource_id: str - """ - - elastic_pool_encryption_key_source: Union[str, "_models.ElasticPoolEncryptionKeySource"] = rest_field( - name="elasticPoolEncryptionKeySource", visibility=["read", "create", "update", "delete", "query"] - ) - """Pool Encryption Key Source. Required. Known values are: \"NetApp\" and \"KeyVault\".""" - key_vault_private_endpoint_resource_id: str = rest_field( - name="keyVaultPrivateEndpointResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the - volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. Required.""" - - @overload - def __init__( - self, - *, - elastic_pool_encryption_key_source: Union[str, "_models.ElasticPoolEncryptionKeySource"], - key_vault_private_endpoint_resource_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticEncryptionIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identity used to authenticate with key vault. - - :ivar principal_id: The principal ID (object ID) of the identity used to authenticate with key - vault. Read-only. - :vartype principal_id: str - :ivar user_assigned_identity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match - key of identity.userAssignedIdentities. - :vartype user_assigned_identity: str - :ivar federated_client_id: ClientId of the multi-tenant Entra ID Application. Used to access - cross-tenant keyvaults. - :vartype federated_client_id: str - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID (object ID) of the identity used to authenticate with key vault. Read-only.""" - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """The ARM resource identifier of the user assigned identity used to authenticate with key vault. - Applicable if identity.type has 'UserAssigned'. It should match key of - identity.userAssignedIdentities.""" - federated_client_id: Optional[str] = rest_field( - name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" - - @overload - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - federated_client_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticExportPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Set of export policy rules. - - :ivar rules: Export policy rule. - :vartype rules: list[~azure.mgmt.netapp.models.ElasticExportPolicyRule] - """ - - rules: Optional[list["_models.ElasticExportPolicyRule"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Export policy rule.""" - - @overload - def __init__( - self, - *, - rules: Optional[list["_models.ElasticExportPolicyRule"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticExportPolicyRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Volume Export Policy Rule. - - :ivar rule_index: Controls the priority of the export policy rule. When connecting to the - volume the rule with the lowest index that applies to the connecting client is used. - :vartype rule_index: int - :ivar unix_access_rule: Specifies the Unix file access level for the volume. It encompasses - both read-only and read-write permissions. Additionally, NoAccess can be set to block all - access to the volume. Known values are: "ReadOnly", "ReadWrite", and "NoAccess". - :vartype unix_access_rule: str or ~azure.mgmt.netapp.models.ElasticUnixAccessRule - :ivar nfsv3: Allows clients to access the volume with the NFSv3 protocol. Enable only for NFSv3 - type volumes. Known values are: "Enabled" and "Disabled". - :vartype nfsv3: str or ~azure.mgmt.netapp.models.ElasticNfsv3Access - :ivar nfsv4: Allows clients to access the volume with at least NFSv4.1 protocol. Known values - are: "Enabled" and "Disabled". - :vartype nfsv4: str or ~azure.mgmt.netapp.models.ElasticNfsv4Access - :ivar allowed_clients: Client ingress specification for the export policy as list of IPv4 - CIDRs, IPv4 host addresses and host names. - :vartype allowed_clients: list[str] - :ivar root_access: Indicates whether root access to the volume is granted to clients affected - by this rule. Known values are: "Enabled" and "Disabled". - :vartype root_access: str or ~azure.mgmt.netapp.models.ElasticRootAccess - """ - - rule_index: Optional[int] = rest_field(name="ruleIndex", visibility=["read", "create", "update", "delete", "query"]) - """Controls the priority of the export policy rule. When connecting to the volume the rule with - the lowest index that applies to the connecting client is used.""" - unix_access_rule: Optional[Union[str, "_models.ElasticUnixAccessRule"]] = rest_field( - name="unixAccessRule", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the Unix file access level for the volume. It encompasses both read-only and - read-write permissions. Additionally, NoAccess can be set to block all access to the volume. - Known values are: \"ReadOnly\", \"ReadWrite\", and \"NoAccess\".""" - nfsv3: Optional[Union[str, "_models.ElasticNfsv3Access"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Allows clients to access the volume with the NFSv3 protocol. Enable only for NFSv3 type - volumes. Known values are: \"Enabled\" and \"Disabled\".""" - nfsv4: Optional[Union[str, "_models.ElasticNfsv4Access"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Allows clients to access the volume with at least NFSv4.1 protocol. Known values are: - \"Enabled\" and \"Disabled\".""" - allowed_clients: Optional[list[str]] = rest_field( - name="allowedClients", visibility=["read", "create", "update", "delete", "query"] - ) - """Client ingress specification for the export policy as list of IPv4 CIDRs, IPv4 host addresses - and host names.""" - root_access: Optional[Union[str, "_models.ElasticRootAccess"]] = rest_field( - name="rootAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether root access to the volume is granted to clients affected by this rule. Known - values are: \"Enabled\" and \"Disabled\".""" - - @overload - def __init__( - self, - *, - rule_index: Optional[int] = None, - unix_access_rule: Optional[Union[str, "_models.ElasticUnixAccessRule"]] = None, - nfsv3: Optional[Union[str, "_models.ElasticNfsv3Access"]] = None, - nfsv4: Optional[Union[str, "_models.ElasticNfsv4Access"]] = None, - allowed_clients: Optional[list[str]] = None, - root_access: Optional[Union[str, "_models.ElasticRootAccess"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticKeyVaultProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of key vault. - - :ivar key_vault_uri: The Uri of KeyVault. - :vartype key_vault_uri: str - :ivar key_name: The name of KeyVault key. - :vartype key_name: str - :ivar key_vault_resource_id: The resource ID of KeyVault. - :vartype key_vault_resource_id: str - :ivar status: Status of the KeyVault connection. Known values are: "Created", "InUse", - "Deleted", "Error", and "Updating". - :vartype status: str or ~azure.mgmt.netapp.models.ElasticKeyVaultStatus - """ - - key_vault_uri: Optional[str] = rest_field( - name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] - ) - """The Uri of KeyVault.""" - key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"]) - """The name of KeyVault key.""" - key_vault_resource_id: Optional[str] = rest_field( - name="keyVaultResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource ID of KeyVault.""" - status: Optional[Union[str, "_models.ElasticKeyVaultStatus"]] = rest_field(visibility=["read"]) - """Status of the KeyVault connection. Known values are: \"Created\", \"InUse\", \"Deleted\", - \"Error\", and \"Updating\".""" - - @overload - def __init__( - self, - *, - key_vault_uri: Optional[str] = None, - key_name: Optional[str] = None, - key_vault_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticMountTargetProperties(_Model): - """Contains all the information needed to mount an elastic volume. - - :ivar ip_address: The mount target's IPv4 address, used to mount the volume. - :vartype ip_address: str - :ivar smb_server_fqdn: The SMB server's Fully Qualified Domain Name, FQDN. - :vartype smb_server_fqdn: str - """ - - ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read"]) - """The mount target's IPv4 address, used to mount the volume.""" - smb_server_fqdn: Optional[str] = rest_field(name="smbServerFqdn", visibility=["read"]) - """The SMB server's Fully Qualified Domain Name, FQDN.""" - - -class ElasticSmbPatchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """SMB Patch Properties. - - :ivar smb_encryption: Used to enable or disable encryption for in-flight SMB data volume. This - flag can be modified during Elastic volume update operation as well. Only applicable for SMB - protocol Elastic volumes. Known values are: "Enabled" and "Disabled". - :vartype smb_encryption: str or ~azure.mgmt.netapp.models.ElasticSmbEncryption - """ - - smb_encryption: Optional[Union[str, "_models.ElasticSmbEncryption"]] = rest_field( - name="smbEncryption", visibility=["read", "create", "update", "delete", "query"] - ) - """Used to enable or disable encryption for in-flight SMB data volume. This flag can be modified - during Elastic volume update operation as well. Only applicable for SMB protocol Elastic - volumes. Known values are: \"Enabled\" and \"Disabled\".""" - - @overload - def __init__( - self, - *, - smb_encryption: Optional[Union[str, "_models.ElasticSmbEncryption"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSmbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """SMB Properties. - - :ivar smb_encryption: Used to enable or disable encryption for in-flight SMB data volume. This - flag can be modified during Elastic volume update operation as well. Only applicable for SMB - protocol Elastic volumes. Known values are: "Enabled" and "Disabled". - :vartype smb_encryption: str or ~azure.mgmt.netapp.models.ElasticSmbEncryption - """ - - smb_encryption: Optional[Union[str, "_models.ElasticSmbEncryption"]] = rest_field( - name="smbEncryption", visibility=["read", "create", "update", "delete", "query"] - ) - """Used to enable or disable encryption for in-flight SMB data volume. This flag can be modified - during Elastic volume update operation as well. Only applicable for SMB protocol Elastic - volumes. Known values are: \"Enabled\" and \"Disabled\".""" - - @overload - def __init__( - self, - *, - smb_encryption: Optional[Union[str, "_models.ElasticSmbEncryption"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshot(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp Elastic Snapshot under an Elastic Volume. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticSnapshotProperties - """ - - properties: Optional["_models.ElasticSnapshotProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ElasticSnapshotProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicy(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp Elastic Snapshot Policy under an Elastic Account. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyProperties - :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype e_tag: str - """ - - properties: Optional["_models.ElasticSnapshotPolicyProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticSnapshotPolicyProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyDailySchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Daily Schedule properties used to create NetApp snapshot policy. - - :ivar snapshots_to_keep: Daily snapshot count to keep. - :vartype snapshots_to_keep: int - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshots_to_keep: Optional[int] = rest_field( - name="snapshotsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Daily snapshot count to keep.""" - hour: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which minute snapshot should be taken.""" - - @overload - def __init__( - self, - *, - snapshots_to_keep: Optional[int] = None, - hour: Optional[int] = None, - minute: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyHourlySchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Hourly Schedule properties used to create NetApp snapshot policy. - - :ivar snapshots_to_keep: Hourly snapshot count to keep. - :vartype snapshots_to_keep: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshots_to_keep: Optional[int] = rest_field( - name="snapshotsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Hourly snapshot count to keep.""" - minute: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which minute snapshot should be taken.""" - - @overload - def __init__( - self, - *, - snapshots_to_keep: Optional[int] = None, - minute: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyMonthlySchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Monthly Schedule properties used to create NetApp snapshot policy. - - :ivar snapshots_to_keep: Monthly snapshot count to keep. - :vartype snapshots_to_keep: int - :ivar days_of_month: Indicates which days of the month snapshot (1-31) should be taken, accepts - a list of integers. - :vartype days_of_month: list[int] - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshots_to_keep: Optional[int] = rest_field( - name="snapshotsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Monthly snapshot count to keep.""" - days_of_month: Optional[list[int]] = rest_field( - name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates which days of the month snapshot (1-31) should be taken, accepts a list of integers.""" - hour: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which minute snapshot should be taken.""" - - @overload - def __init__( - self, - *, - snapshots_to_keep: Optional[int] = None, - days_of_month: Optional[list[int]] = None, - hour: Optional[int] = None, - minute: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Snapshot policy properties. - - :ivar hourly_schedule: Schedule for hourly snapshots. - :vartype hourly_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyHourlySchedule - :ivar daily_schedule: Schedule for daily snapshots. - :vartype daily_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyDailySchedule - :ivar weekly_schedule: Schedule for weekly snapshots. - :vartype weekly_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyWeeklySchedule - :ivar monthly_schedule: Schedule for monthly snapshots. - :vartype monthly_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyMonthlySchedule - :ivar policy_status: Configures if the snapshot policy is enabled on the volumes connected to - the policy. Known values are: "Enabled" and "Disabled". - :vartype policy_status: str or ~azure.mgmt.netapp.models.PolicyStatus - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - """ - - hourly_schedule: Optional["_models.ElasticSnapshotPolicyHourlySchedule"] = rest_field( - name="hourlySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for hourly snapshots.""" - daily_schedule: Optional["_models.ElasticSnapshotPolicyDailySchedule"] = rest_field( - name="dailySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for daily snapshots.""" - weekly_schedule: Optional["_models.ElasticSnapshotPolicyWeeklySchedule"] = rest_field( - name="weeklySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for weekly snapshots.""" - monthly_schedule: Optional["_models.ElasticSnapshotPolicyMonthlySchedule"] = rest_field( - name="monthlySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for monthly snapshots.""" - policy_status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field( - name="policyStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Configures if the snapshot policy is enabled on the volumes connected to the policy. Known - values are: \"Enabled\" and \"Disabled\".""" - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - - @overload - def __init__( - self, - *, - hourly_schedule: Optional["_models.ElasticSnapshotPolicyHourlySchedule"] = None, - daily_schedule: Optional["_models.ElasticSnapshotPolicyDailySchedule"] = None, - weekly_schedule: Optional["_models.ElasticSnapshotPolicyWeeklySchedule"] = None, - monthly_schedule: Optional["_models.ElasticSnapshotPolicyMonthlySchedule"] = None, - policy_status: Optional[Union[str, "_models.PolicyStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ElasticSnapshotPolicy. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdateProperties - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - properties: Optional["_models.ElasticSnapshotPolicyUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticSnapshotPolicyUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The updatable properties of the ElasticSnapshotPolicy. - - :ivar hourly_schedule: Schedule for hourly snapshots. - :vartype hourly_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyHourlySchedule - :ivar daily_schedule: Schedule for daily snapshots. - :vartype daily_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyDailySchedule - :ivar weekly_schedule: Schedule for weekly snapshots. - :vartype weekly_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyWeeklySchedule - :ivar monthly_schedule: Schedule for monthly snapshots. - :vartype monthly_schedule: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyMonthlySchedule - :ivar policy_status: Configures if the snapshot policy is enabled on the volumes connected to - the policy. Known values are: "Enabled" and "Disabled". - :vartype policy_status: str or ~azure.mgmt.netapp.models.PolicyStatus - """ - - hourly_schedule: Optional["_models.ElasticSnapshotPolicyHourlySchedule"] = rest_field( - name="hourlySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for hourly snapshots.""" - daily_schedule: Optional["_models.ElasticSnapshotPolicyDailySchedule"] = rest_field( - name="dailySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for daily snapshots.""" - weekly_schedule: Optional["_models.ElasticSnapshotPolicyWeeklySchedule"] = rest_field( - name="weeklySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for weekly snapshots.""" - monthly_schedule: Optional["_models.ElasticSnapshotPolicyMonthlySchedule"] = rest_field( - name="monthlySchedule", visibility=["read", "create", "update", "delete", "query"] - ) - """Schedule for monthly snapshots.""" - policy_status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field( - name="policyStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Configures if the snapshot policy is enabled on the volumes connected to the policy. Known - values are: \"Enabled\" and \"Disabled\".""" - - @overload - def __init__( - self, - *, - hourly_schedule: Optional["_models.ElasticSnapshotPolicyHourlySchedule"] = None, - daily_schedule: Optional["_models.ElasticSnapshotPolicyDailySchedule"] = None, - weekly_schedule: Optional["_models.ElasticSnapshotPolicyWeeklySchedule"] = None, - monthly_schedule: Optional["_models.ElasticSnapshotPolicyMonthlySchedule"] = None, - policy_status: Optional[Union[str, "_models.PolicyStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotPolicyWeeklySchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Weekly Schedule properties used to create NetApp snapshot policy. - - :ivar snapshots_to_keep: Weekly snapshot count to keep. - :vartype snapshots_to_keep: int - :ivar days: Indicates which weekday(s) snapshot(s) should be taken, accepts a list of week day - names in english. - :vartype days: list[str or ~azure.mgmt.netapp.models.DayOfWeek] - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshots_to_keep: Optional[int] = rest_field( - name="snapshotsToKeep", visibility=["read", "create", "update", "delete", "query"] - ) - """Weekly snapshot count to keep.""" - days: Optional[list[Union[str, "_models.DayOfWeek"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates which weekday(s) snapshot(s) should be taken, accepts a list of week day names in - english.""" - hour: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates which minute snapshot should be taken.""" - - @overload - def __init__( - self, - *, - snapshots_to_keep: Optional[int] = None, - days: Optional[list[Union[str, "_models.DayOfWeek"]]] = None, - hour: Optional[int] = None, - minute: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticSnapshotProperties(_Model): - """Elastic Snapshot properties. - - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - - -class ElasticVolume(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """NetApp Elastic Volume resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticVolumeProperties - :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype e_tag: str - :ivar zones: The availability zones. - :vartype zones: list[str] - """ - - properties: Optional["_models.ElasticVolumeProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - zones: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """The availability zones.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticVolumeProperties"] = None, - zones: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeBackupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Volume Backup Properties. - - :ivar elastic_backup_policy_resource_id: ResourceId used to identify Elastic Backup Policy. - :vartype elastic_backup_policy_resource_id: str - :ivar policy_enforcement: The property to decide policy is enforced or not on the volume. Known - values are: "Enforced" and "NotEnforced". - :vartype policy_enforcement: str or ~azure.mgmt.netapp.models.ElasticVolumePolicyEnforcement - :ivar elastic_backup_vault_resource_id: ResourceId used to identify Elastic Backup Vault. - :vartype elastic_backup_vault_resource_id: str - """ - - elastic_backup_policy_resource_id: Optional[str] = rest_field( - name="elasticBackupPolicyResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """ResourceId used to identify Elastic Backup Policy.""" - policy_enforcement: Optional[Union[str, "_models.ElasticVolumePolicyEnforcement"]] = rest_field( - name="policyEnforcement", visibility=["read", "create", "update", "delete", "query"] - ) - """The property to decide policy is enforced or not on the volume. Known values are: \"Enforced\" - and \"NotEnforced\".""" - elastic_backup_vault_resource_id: Optional[str] = rest_field( - name="elasticBackupVaultResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """ResourceId used to identify Elastic Backup Vault.""" - - @overload - def __init__( - self, - *, - elastic_backup_policy_resource_id: Optional[str] = None, - policy_enforcement: Optional[Union[str, "_models.ElasticVolumePolicyEnforcement"]] = None, - elastic_backup_vault_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeDataProtectionPatchProperties( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Data protection configuration option for updating the volume, including snapshot policies and - backup. - - :ivar snapshot: Used to apply a snapshot policy to a volume. - :vartype snapshot: ~azure.mgmt.netapp.models.ElasticVolumeSnapshotProperties - :ivar backup: Used to configure backups on an elastic volume. - :vartype backup: ~azure.mgmt.netapp.models.ElasticVolumeBackupProperties - """ - - snapshot: Optional["_models.ElasticVolumeSnapshotProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Used to apply a snapshot policy to a volume.""" - backup: Optional["_models.ElasticVolumeBackupProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Used to configure backups on an elastic volume.""" - - @overload - def __init__( - self, - *, - snapshot: Optional["_models.ElasticVolumeSnapshotProperties"] = None, - backup: Optional["_models.ElasticVolumeBackupProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeDataProtectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Data protection configuration option for the volume, including snapshot policies and backup. - - :ivar snapshot: Used to apply a snapshot policy to a volume. - :vartype snapshot: ~azure.mgmt.netapp.models.ElasticVolumeSnapshotProperties - :ivar backup: Used to configure backups on an elastic volume. - :vartype backup: ~azure.mgmt.netapp.models.ElasticVolumeBackupProperties - """ - - snapshot: Optional["_models.ElasticVolumeSnapshotProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Used to apply a snapshot policy to a volume.""" - backup: Optional["_models.ElasticVolumeBackupProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Used to configure backups on an elastic volume.""" - - @overload - def __init__( - self, - *, - snapshot: Optional["_models.ElasticVolumeSnapshotProperties"] = None, - backup: Optional["_models.ElasticVolumeBackupProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Volume properties. - - :ivar file_path: A unique file path for the volume. Used when creating mount targets. This - needs to be unique within the elastic capacity pool. Required. - :vartype file_path: str - :ivar size: Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to - 16TiB. Values expressed in bytes as multiples of 1 GiB. Required. - :vartype size: int - :ivar export_policy: Set of export policy rules. - :vartype export_policy: ~azure.mgmt.netapp.models.ElasticExportPolicy - :ivar protocol_types: Set of support protocol types for the elastic volume. Required. - :vartype protocol_types: list[str or ~azure.mgmt.netapp.models.ElasticProtocolType] - :ivar provisioning_state: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState - :ivar availability_status: Current availability status of the resource. Known values are: - "Online" and "Offline". - :vartype availability_status: str or - ~azure.mgmt.netapp.models.ElasticResourceAvailabilityStatus - :ivar snapshot_resource_id: Resource identifier used to identify the Elastic Snapshot. - :vartype snapshot_resource_id: str - :ivar mount_targets: List of mount targets that can be used to mount this volume. - :vartype mount_targets: list[~azure.mgmt.netapp.models.ElasticMountTargetProperties] - :ivar data_protection: Data protection configuration option for the volume, including snapshot - policies and backup. - :vartype data_protection: ~azure.mgmt.netapp.models.ElasticVolumeDataProtectionProperties - :ivar snapshot_directory_visibility: Controls the visibility of the volume's read-only snapshot - directory, which provides access to each of the volume's snapshots. Known values are: "Hidden" - and "Visible". - :vartype snapshot_directory_visibility: str or - ~azure.mgmt.netapp.models.SnapshotDirectoryVisibility - :ivar smb_properties: SMB Properties. - :vartype smb_properties: ~azure.mgmt.netapp.models.ElasticSmbProperties - :ivar backup_resource_id: Resource identifier used to identify the Elastic Backup. - :vartype backup_resource_id: str - :ivar restoration_state: The current state of the restoration process. Known values are: - "Restoring", "Restored", and "Failed". - :vartype restoration_state: str or ~azure.mgmt.netapp.models.ElasticVolumeRestorationState - """ - - file_path: str = rest_field(name="filePath", visibility=["read", "create"]) - """A unique file path for the volume. Used when creating mount targets. This needs to be unique - within the elastic capacity pool. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to 16TiB. Values - expressed in bytes as multiples of 1 GiB. Required.""" - export_policy: Optional["_models.ElasticExportPolicy"] = rest_field( - name="exportPolicy", visibility=["read", "create", "update", "delete", "query"] - ) - """Set of export policy rules.""" - protocol_types: list[Union[str, "_models.ElasticProtocolType"]] = rest_field( - name="protocolTypes", visibility=["read", "create", "update", "delete", "query"] - ) - """Set of support protocol types for the elastic volume. Required.""" - provisioning_state: Optional[Union[str, "_models.NetAppProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - availability_status: Optional[Union[str, "_models.ElasticResourceAvailabilityStatus"]] = rest_field( - name="availabilityStatus", visibility=["read"] - ) - """Current availability status of the resource. Known values are: \"Online\" and \"Offline\".""" - snapshot_resource_id: Optional[str] = rest_field(name="snapshotResourceId", visibility=["read", "create"]) - """Resource identifier used to identify the Elastic Snapshot.""" - mount_targets: Optional[list["_models.ElasticMountTargetProperties"]] = rest_field( - name="mountTargets", visibility=["read"] - ) - """List of mount targets that can be used to mount this volume.""" - data_protection: Optional["_models.ElasticVolumeDataProtectionProperties"] = rest_field( - name="dataProtection", visibility=["read", "create", "update", "delete", "query"] - ) - """Data protection configuration option for the volume, including snapshot policies and backup.""" - snapshot_directory_visibility: Optional[Union[str, "_models.SnapshotDirectoryVisibility"]] = rest_field( - name="snapshotDirectoryVisibility", visibility=["read", "create", "update", "delete", "query"] - ) - """Controls the visibility of the volume's read-only snapshot directory, which provides access to - each of the volume's snapshots. Known values are: \"Hidden\" and \"Visible\".""" - smb_properties: Optional["_models.ElasticSmbProperties"] = rest_field( - name="smbProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """SMB Properties.""" - backup_resource_id: Optional[str] = rest_field(name="backupResourceId", visibility=["read", "create"]) - """Resource identifier used to identify the Elastic Backup.""" - restoration_state: Optional[Union[str, "_models.ElasticVolumeRestorationState"]] = rest_field( - name="restorationState", visibility=["read"] - ) - """The current state of the restoration process. Known values are: \"Restoring\", \"Restored\", - and \"Failed\".""" - - @overload - def __init__( - self, - *, - file_path: str, - size: int, - protocol_types: list[Union[str, "_models.ElasticProtocolType"]], - export_policy: Optional["_models.ElasticExportPolicy"] = None, - snapshot_resource_id: Optional[str] = None, - data_protection: Optional["_models.ElasticVolumeDataProtectionProperties"] = None, - snapshot_directory_visibility: Optional[Union[str, "_models.SnapshotDirectoryVisibility"]] = None, - smb_properties: Optional["_models.ElasticSmbProperties"] = None, - backup_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeRevert(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reverts the elastic volume to the specified snapshot. - - :ivar snapshot_resource_id: Resource identifier used to identify the Elastic Snapshot. - :vartype snapshot_resource_id: str - """ - - snapshot_resource_id: Optional[str] = rest_field(name="snapshotResourceId", visibility=["read", "create"]) - """Resource identifier used to identify the Elastic Snapshot.""" - - @overload - def __init__( - self, - *, - snapshot_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeSnapshotProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Elastic Volume Snapshot Properties. - - :ivar snapshot_policy_resource_id: Snapshot Policy ResourceId. - :vartype snapshot_policy_resource_id: str - """ - - snapshot_policy_resource_id: Optional[str] = rest_field( - name="snapshotPolicyResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Snapshot Policy ResourceId.""" - - @overload - def __init__( - self, - *, - snapshot_policy_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The type used for update operations of the ElasticVolume. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.netapp.models.ElasticVolumeUpdateProperties - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - properties: Optional["_models.ElasticVolumeUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.ElasticVolumeUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ElasticVolumeUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The updatable properties of the ElasticVolume. - - :ivar size: Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to - 16TiB. Values expressed in bytes as multiples of 1 GiB. - :vartype size: int - :ivar export_policy: Set of export policy rules. - :vartype export_policy: ~azure.mgmt.netapp.models.ElasticExportPolicy - :ivar data_protection: Data protection configuration option for the volume, including snapshot - policies and backup. - :vartype data_protection: ~azure.mgmt.netapp.models.ElasticVolumeDataProtectionPatchProperties - :ivar snapshot_directory_visibility: Controls the visibility of the volume's read-only snapshot - directory, which provides access to each of the volume's snapshots. Known values are: "Hidden" - and "Visible". - :vartype snapshot_directory_visibility: str or - ~azure.mgmt.netapp.models.SnapshotDirectoryVisibility - :ivar smb_properties: SMB Properties. - :vartype smb_properties: ~azure.mgmt.netapp.models.ElasticSmbPatchProperties - """ - - size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to 16TiB. Values - expressed in bytes as multiples of 1 GiB.""" - export_policy: Optional["_models.ElasticExportPolicy"] = rest_field( - name="exportPolicy", visibility=["read", "create", "update", "delete", "query"] - ) - """Set of export policy rules.""" - data_protection: Optional["_models.ElasticVolumeDataProtectionPatchProperties"] = rest_field( - name="dataProtection", visibility=["read", "create", "update", "delete", "query"] - ) - """Data protection configuration option for the volume, including snapshot policies and backup.""" - snapshot_directory_visibility: Optional[Union[str, "_models.SnapshotDirectoryVisibility"]] = rest_field( - name="snapshotDirectoryVisibility", visibility=["read", "create", "update", "delete", "query"] - ) - """Controls the visibility of the volume's read-only snapshot directory, which provides access to - each of the volume's snapshots. Known values are: \"Hidden\" and \"Visible\".""" - smb_properties: Optional["_models.ElasticSmbPatchProperties"] = rest_field( - name="smbProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """SMB Properties.""" - - @overload - def __init__( - self, - *, - size: Optional[int] = None, - export_policy: Optional["_models.ElasticExportPolicy"] = None, - data_protection: Optional["_models.ElasticVolumeDataProtectionPatchProperties"] = None, - snapshot_directory_visibility: Optional[Union[str, "_models.SnapshotDirectoryVisibility"]] = None, - smb_properties: Optional["_models.ElasticSmbPatchProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EncryptionIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identity used to authenticate with key vault. - - :ivar principal_id: The principal ID (object ID) of the identity used to authenticate with key - vault. Read-only. - :vartype principal_id: str - :ivar user_assigned_identity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match - key of identity.userAssignedIdentities. - :vartype user_assigned_identity: str - :ivar federated_client_id: ClientId of the multi-tenant Entra ID Application. Used to access - cross-tenant keyvaults. - :vartype federated_client_id: str - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID (object ID) of the identity used to authenticate with key vault. Read-only.""" - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """The ARM resource identifier of the user assigned identity used to authenticate with key vault. - Applicable if identity.type has 'UserAssigned'. It should match key of - identity.userAssignedIdentities.""" - federated_client_id: Optional[str] = rest_field( - name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" - - @overload - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - federated_client_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EncryptionTransitionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Encryption transition request. - - :ivar virtual_network_id: Identifier for the virtual network. Required. - :vartype virtual_network_id: str - :ivar private_endpoint_id: Identifier of the private endpoint to reach the Azure Key Vault. - Required. - :vartype private_endpoint_id: str - """ - - virtual_network_id: str = rest_field( - name="virtualNetworkId", visibility=["read", "create", "update", "delete", "query"] - ) - """Identifier for the virtual network. Required.""" - private_endpoint_id: str = rest_field( - name="privateEndpointId", visibility=["read", "create", "update", "delete", "query"] - ) - """Identifier of the private endpoint to reach the Azure Key Vault. Required.""" - - @overload - def __init__( - self, - *, - virtual_network_id: str, - private_endpoint_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EntraIdAkvConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Using AKV config, certificate will be fetched, which will contain private key & public - certificate, that correspond to the public certificate which is uploaded on the application - created by customer. This will be used further for authentication. - - :ivar azure_key_vault_uri: The Azure Key Vault URI where the Entra ID credentials are stored. - Required. - :vartype azure_key_vault_uri: str - :ivar certificate_name: The name of the certificate in Azure Key Vault. Required. - :vartype certificate_name: str - :ivar user_assigned_identity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. - :vartype user_assigned_identity: str - """ - - azure_key_vault_uri: str = rest_field( - name="azureKeyVaultUri", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure Key Vault URI where the Entra ID credentials are stored. Required.""" - certificate_name: str = rest_field( - name="certificateName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the certificate in Azure Key Vault. Required.""" - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display name of dimension.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] ) - """The ARM resource identifier of the user assigned identity used to authenticate with key vault.""" + """Display name of dimension.""" @overload def __init__( self, *, - azure_key_vault_uri: str, - certificate_name: str, - user_assigned_identity: Optional[str] = None, + name: Optional[str] = None, + display_name: Optional[str] = None, ) -> None: ... @overload @@ -5694,38 +3179,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EntraIdAkvConfigPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Entra ID Patch configuration for the account. +class EncryptionIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identity used to authenticate with key vault. - :ivar azure_key_vault_uri: The Azure Key Vault URI where the Entra ID credentials are stored. - :vartype azure_key_vault_uri: str - :ivar certificate_name: The name of the certificate in Azure Key Vault. - :vartype certificate_name: str + :ivar principal_id: The principal ID (object ID) of the identity used to authenticate with key + vault. Read-only. + :vartype principal_id: str :ivar user_assigned_identity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. + authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match + key of identity.userAssignedIdentities. :vartype user_assigned_identity: str + :ivar federated_client_id: ClientId of the multi-tenant Entra ID Application. Used to access + cross-tenant keyvaults. + :vartype federated_client_id: str """ - azure_key_vault_uri: Optional[str] = rest_field( - name="azureKeyVaultUri", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure Key Vault URI where the Entra ID credentials are stored.""" - certificate_name: Optional[str] = rest_field( - name="certificateName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the certificate in Azure Key Vault.""" + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID (object ID) of the identity used to authenticate with key vault. Read-only.""" user_assigned_identity: Optional[str] = rest_field( name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] ) - """The ARM resource identifier of the user assigned identity used to authenticate with key vault.""" + """The ARM resource identifier of the user assigned identity used to authenticate with key vault. + Applicable if identity.type has 'UserAssigned'. It should match key of + identity.userAssignedIdentities.""" + federated_client_id: Optional[str] = rest_field( + name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" @overload def __init__( self, *, - azure_key_vault_uri: Optional[str] = None, - certificate_name: Optional[str] = None, user_assigned_identity: Optional[str] = None, + federated_client_id: Optional[str] = None, ) -> None: ... @overload @@ -5739,50 +3226,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EntraIdConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Entra ID configuration for the account. +class EncryptionIdentityPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identity used to authenticate with key vault for PATCH operations. - :ivar application_id: ApplicationId of the app created by customer to provide authentication - and required API permissions for Microsoft Graph endpoint. Required. - :vartype application_id: str - :ivar domain: Domain of the Active directory synced to Entra ID for hybrid identities. - Required. - :vartype domain: str - :ivar server_name_prefix: Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be - generated for SMB share, using this FQDN, SMB Share will be mounted on Entra Joined VM. - Required. - :vartype server_name_prefix: str - :ivar entra_id_akv_config: Using AKV config, certificate will be fetched, which will contain - private key & public certificate, that correspond to the public certificate which is uploaded - on the application created by customer. This will be used further for authentication. - :vartype entra_id_akv_config: ~azure.mgmt.netapp.models.EntraIdAkvConfig + :ivar user_assigned_identity: The ARM resource identifier of the user assigned identity used to + authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match + key of identity.userAssignedIdentities. + :vartype user_assigned_identity: str + :ivar federated_client_id: ClientId of the multi-tenant Entra ID Application. Used to access + cross-tenant keyvaults. + :vartype federated_client_id: str """ - application_id: str = rest_field(name="applicationId", visibility=["read", "create", "update", "delete", "query"]) - """ApplicationId of the app created by customer to provide authentication and required API - permissions for Microsoft Graph endpoint. Required.""" - domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Domain of the Active directory synced to Entra ID for hybrid identities. Required.""" - server_name_prefix: str = rest_field( - name="serverNamePrefix", visibility=["read", "create", "update", "delete", "query"] + user_assigned_identity: Optional[str] = rest_field( + name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] ) - """Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be generated for SMB share, - using this FQDN, SMB Share will be mounted on Entra Joined VM. Required.""" - entra_id_akv_config: Optional["_models.EntraIdAkvConfig"] = rest_field( - name="entraIdAkvConfig", visibility=["read", "create", "update", "delete", "query"] + """The ARM resource identifier of the user assigned identity used to authenticate with key vault. + Applicable if identity.type has 'UserAssigned'. It should match key of + identity.userAssignedIdentities.""" + federated_client_id: Optional[str] = rest_field( + name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] ) - """Using AKV config, certificate will be fetched, which will contain private key & public - certificate, that correspond to the public certificate which is uploaded on the application - created by customer. This will be used further for authentication.""" + """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" @overload def __init__( self, *, - application_id: str, - domain: str, - server_name_prefix: str, - entra_id_akv_config: Optional["_models.EntraIdAkvConfig"] = None, + user_assigned_identity: Optional[str] = None, + federated_client_id: Optional[str] = None, ) -> None: ... @overload @@ -5796,50 +3268,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EntraIdConfigPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Entra ID Patch configuration for the account. +class EncryptionTransitionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Encryption transition request. - :ivar application_id: ApplicationId of the app created by customer to provide authentication - and required API permissions for Microsoft Graph endpoint. - :vartype application_id: str - :ivar domain: Domain of the Active directory synced to Entra ID for hybrid identities. - :vartype domain: str - :ivar server_name_prefix: Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be - generated for SMB share, using this FQDN, SMB Share will be mounted on Entra Joined VM. - :vartype server_name_prefix: str - :ivar entra_id_akv_config: Using AKV config, certificate will be fetched, which will contain - private key & public certificate, that correspond to the public certificate which is uploaded - on the application created by customer. This will be used further for authentication. - :vartype entra_id_akv_config: ~azure.mgmt.netapp.models.EntraIdAkvConfigPatch + :ivar virtual_network_id: Identifier for the virtual network. Required. + :vartype virtual_network_id: str + :ivar private_endpoint_id: Identifier of the private endpoint to reach the Azure Key Vault. + Required. + :vartype private_endpoint_id: str """ - application_id: Optional[str] = rest_field( - name="applicationId", visibility=["read", "create", "update", "delete", "query"] - ) - """ApplicationId of the app created by customer to provide authentication and required API - permissions for Microsoft Graph endpoint.""" - domain: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Domain of the Active directory synced to Entra ID for hybrid identities.""" - server_name_prefix: Optional[str] = rest_field( - name="serverNamePrefix", visibility=["read", "create", "update", "delete", "query"] + virtual_network_id: str = rest_field( + name="virtualNetworkId", visibility=["read", "create", "update", "delete", "query"] ) - """Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be generated for SMB share, - using this FQDN, SMB Share will be mounted on Entra Joined VM.""" - entra_id_akv_config: Optional["_models.EntraIdAkvConfigPatch"] = rest_field( - name="entraIdAkvConfig", visibility=["read", "create", "update", "delete", "query"] + """Identifier for the virtual network. Required.""" + private_endpoint_id: str = rest_field( + name="privateEndpointId", visibility=["read", "create", "update", "delete", "query"] ) - """Using AKV config, certificate will be fetched, which will contain private key & public - certificate, that correspond to the public certificate which is uploaded on the application - created by customer. This will be used further for authentication.""" + """Identifier of the private endpoint to reach the Azure Key Vault. Required.""" @overload def __init__( self, *, - application_id: Optional[str] = None, - domain: Optional[str] = None, - server_name_prefix: Optional[str] = None, - entra_id_akv_config: Optional["_models.EntraIdAkvConfigPatch"] = None, + virtual_network_id: str, + private_endpoint_id: str, ) -> None: ... @overload @@ -6431,6 +3884,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class KeyVaultPropertiesPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of key vault for PATCH operations (no required properties). + + :ivar key_vault_uri: The Uri of KeyVault. + :vartype key_vault_uri: str + :ivar key_name: The name of KeyVault key. + :vartype key_name: str + :ivar key_vault_resource_id: The resource ID of KeyVault. + :vartype key_vault_resource_id: str + """ + + key_vault_uri: Optional[str] = rest_field( + name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] + ) + """The Uri of KeyVault.""" + key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"]) + """The name of KeyVault key.""" + key_vault_resource_id: Optional[str] = rest_field( + name="keyVaultResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of KeyVault.""" + + @overload + def __init__( + self, + *, + key_vault_uri: Optional[str] = None, + key_name: Optional[str] = None, + key_vault_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class LdapConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """LDAP configuration. @@ -7168,7 +4663,6 @@ class NetAppAccount(TrackedResource): # pylint: disable=docstring-keyword-shoul __flattened_items = [ "provisioning_state", "active_directories", - "entra_id_config", "encryption", "disable_showmount", "nfs_v4_id_domain", @@ -7237,13 +4731,7 @@ class NetAppAccountPatch(_Model): # pylint: disable=docstring-keyword-should-ma ) """NetApp Account properties.""" - __flattened_items = [ - "active_directories", - "encryption", - "nfs_v4_id_domain", - "entra_id_config", - "ldap_configuration", - ] + __flattened_items = ["active_directories", "encryption", "nfs_v4_id_domain", "ldap_configuration"] @overload def __init__( @@ -7768,8 +5256,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class PoolPatchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Patchable pool properties. - :ivar size: Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 - bytes) or in 1TiB chunks (value must be multiple of 1099511627776). + :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value + must be multiple of 1099511627776). :vartype size: int :ivar qos_type: The qos type of the pool. Known values are: "Auto" and "Manual". :vartype qos_type: str or ~azure.mgmt.netapp.models.QosType @@ -7781,8 +5269,8 @@ class PoolPatchProperties(_Model): # pylint: disable=docstring-keyword-should-m """ size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 bytes) or in - 1TiB chunks (value must be multiple of 1099511627776).""" + """Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be + multiple of 1099511627776).""" qos_type: Optional[Union[str, "_models.QosType"]] = rest_field( name="qosType", visibility=["read", "create", "update", "delete", "query"] ) @@ -7823,8 +5311,8 @@ class PoolProperties(_Model): # pylint: disable=docstring-keyword-should-match- :ivar pool_id: UUID v4 used to identify the Pool. :vartype pool_id: str - :ivar size: Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 - bytes) or in 1TiB chunks (value must be multiple of 1099511627776). Required. + :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value + must be multiple of 1099511627776). Required. :vartype size: int :ivar service_level: The service level of the file system. Required. Known values are: "Standard", "Premium", "Ultra", "StandardZRS", and "Flexible". @@ -7851,8 +5339,8 @@ class PoolProperties(_Model): # pylint: disable=docstring-keyword-should-match- pool_id: Optional[str] = rest_field(name="poolId", visibility=["read"]) """UUID v4 used to identify the Pool.""" size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 bytes) or in - 1TiB chunks (value must be multiple of 1099511627776). Required.""" + """Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be + multiple of 1099511627776). Required.""" service_level: Union[str, "_models.ServiceLevel"] = rest_field( name="serviceLevel", visibility=["read", "create", "update", "delete", "query"] ) @@ -9021,116 +6509,6 @@ class RestoreStatus(_Model): """Displays the total bytes transferred.""" -class SecretPassword(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Access password from Azure KeyVault Secrets to connect Active Directory. - - :ivar key_vault_properties: Properties provided by KeyVault. - :vartype key_vault_properties: ~azure.mgmt.netapp.models.SecretPasswordKeyVaultProperties - :ivar identity: Identity used to authenticate to KeyVault. Applicable if keySource is - 'Microsoft.KeyVault'. - :vartype identity: ~azure.mgmt.netapp.models.SecretPasswordIdentity - """ - - key_vault_properties: Optional["_models.SecretPasswordKeyVaultProperties"] = rest_field( - name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Properties provided by KeyVault.""" - identity: Optional["_models.SecretPasswordIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" - - @overload - def __init__( - self, - *, - key_vault_properties: Optional["_models.SecretPasswordKeyVaultProperties"] = None, - identity: Optional["_models.SecretPasswordIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SecretPasswordIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identity used to authenticate with key vault. - - :ivar principal_id: The principal ID (object ID) of the identity used to authenticate with key - vault. Read-only. - :vartype principal_id: str - :ivar user_assigned_identity: The Azure resource identifier of the user assigned identity used - to authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match - key of identity.userAssignedIdentities. - :vartype user_assigned_identity: str - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID (object ID) of the identity used to authenticate with key vault. Read-only.""" - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure resource identifier of the user assigned identity used to authenticate with key - vault. Applicable if identity.type has 'UserAssigned'. It should match key of - identity.userAssignedIdentities.""" - - @overload - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SecretPasswordKeyVaultProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of key vault to get the secrets for password. - - :ivar key_vault_uri: The Uri of KeyVault. Required. - :vartype key_vault_uri: str - :ivar secret_name: The name of KeyVault password secret. Required. - :vartype secret_name: str - """ - - key_vault_uri: str = rest_field(name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"]) - """The Uri of KeyVault. Required.""" - secret_name: str = rest_field(name="secretName", visibility=["read", "create", "update", "delete", "query"]) - """The name of KeyVault password secret. Required.""" - - @overload - def __init__( - self, - *, - key_vault_uri: str, - secret_name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class ServiceSpecification(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """One property of operation, include metric specifications. @@ -9175,12 +6553,11 @@ class SmbSettings(_Model): # pylint: disable=docstring-keyword-should-match-key SMB/DualProtocol cache. Known values are: "Disabled" and "Enabled". :vartype smb_encryption: str or ~azure.mgmt.netapp.models.SmbEncryptionState :ivar smb_access_based_enumeration: Enables access-based enumeration share property for SMB - Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and - "Enabled". + Shares. Only applicable for SMB/DualProtocol cache. Known values are: "Disabled" and "Enabled". :vartype smb_access_based_enumeration: str or ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration :ivar smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for - SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". + SMB/DualProtocol cache. Known values are: "Disabled" and "Enabled". :vartype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable """ @@ -9193,11 +6570,11 @@ class SmbSettings(_Model): # pylint: disable=docstring-keyword-should-match-key name="smbAccessBasedEnumeration", visibility=["read", "create", "update", "delete", "query"] ) """Enables access-based enumeration share property for SMB Shares. Only applicable for - SMB/DualProtocol volume. Known values are: \"Disabled\" and \"Enabled\".""" + SMB/DualProtocol cache. Known values are: \"Disabled\" and \"Enabled\".""" smb_non_browsable: Optional[Union[str, "_models.SmbNonBrowsable"]] = rest_field( name="smbNonBrowsable", visibility=["read", "create", "update", "delete", "query"] ) - """Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. + """Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol cache. Known values are: \"Disabled\" and \"Enabled\".""" @overload @@ -10353,7 +7730,6 @@ class Volume(TrackedResource): # pylint: disable=docstring-keyword-should-match "encryption_key_source", "key_vault_private_endpoint_resource_id", "ldap_enabled", - "ldap_server_type", "cool_access", "coolness_period", "cool_access_retrieval_policy", @@ -10377,10 +7753,8 @@ class Volume(TrackedResource): # pylint: disable=docstring-keyword-should-match "enable_subvolumes", "provisioned_availability_zone", "is_large_volume", - "large_volume_type", "originating_resource_id", "inherited_size_in_bytes", - "language", "breakthrough_mode", ] @@ -10845,7 +8219,6 @@ class VolumeGroupVolumeProperties(_Model): # pylint: disable=docstring-keyword- "encryption_key_source", "key_vault_private_endpoint_resource_id", "ldap_enabled", - "ldap_server_type", "cool_access", "coolness_period", "cool_access_retrieval_policy", @@ -10869,10 +8242,8 @@ class VolumeGroupVolumeProperties(_Model): # pylint: disable=docstring-keyword- "enable_subvolumes", "provisioned_availability_zone", "is_large_volume", - "large_volume_type", "originating_resource_id", "inherited_size_in_bytes", - "language", "breakthrough_mode", ] @@ -11014,8 +8385,7 @@ class VolumePatchProperties(_Model): # pylint: disable=docstring-keyword-should :ivar usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an - exceptional basis, from to 2400GiB to 2400TiB. For extra large volumes, valid values are in the - range 2400GiB to 7200TiB. Values expressed in bytes as multiples of 1 GiB. + exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. :vartype usage_threshold: int :ivar export_policy: Set of export policy rules. :vartype export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy @@ -11089,8 +8459,7 @@ class VolumePatchProperties(_Model): # pylint: disable=docstring-keyword-should """Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to - 2400GiB to 2400TiB. For extra large volumes, valid values are in the range 2400GiB to 7200TiB. - Values expressed in bytes as multiples of 1 GiB.""" + 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB.""" export_policy: Optional["_models.VolumePatchPropertiesExportPolicy"] = rest_field( name="exportPolicy", visibility=["read", "create", "update", "delete", "query"] ) @@ -11295,8 +8664,8 @@ class VolumeProperties(_Model): # pylint: disable=docstring-keyword-should-matc :ivar usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an - exceptional basis, from to 2400GiB to 2400TiB. For extra large volumes, valid values are in the - range 2400GiB to 7200TiB. Values expressed in bytes as multiples of 1 GiB. Required. + exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. + Required. :vartype usage_threshold: int :ivar export_policy: Set of export policy rules. :vartype export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy @@ -11390,9 +8759,6 @@ class VolumeProperties(_Model): # pylint: disable=docstring-keyword-should-matc :vartype key_vault_private_endpoint_resource_id: str :ivar ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume. :vartype ldap_enabled: bool - :ivar ldap_server_type: Specifies the type of LDAP server for a given NFS volume. Known values - are: "ActiveDirectory" and "OpenLDAP". - :vartype ldap_server_type: str or ~azure.mgmt.netapp.models.LdapServerType :ivar cool_access: Specifies whether Cool Access(tiering) is enabled for the volume. :vartype cool_access: bool :ivar coolness_period: Specifies the number of days after which data that is not accessed by @@ -11472,27 +8838,11 @@ class VolumeProperties(_Model): # pylint: disable=docstring-keyword-should-matc :vartype provisioned_availability_zone: str :ivar is_large_volume: Specifies whether volume is a Large Volume or Regular Volume. :vartype is_large_volume: bool - :ivar large_volume_type: Specifies the type of the Large Volume. When set to 'LargeVolume', the - large volume is created with standard configuration. If it is set to - 'ExtraLargeVolume7Dot2PiB', the extra large volume is created with higher capacity limit 7.2PiB - with cool access enabled, delivering higher capacity limit with lower costs. Known values are: - "LargeVolume" and "PremExtraLargeVolume7Dot2PiB". - :vartype large_volume_type: str or ~azure.mgmt.netapp.models.LargeVolumeType :ivar originating_resource_id: Id of the snapshot or backup that the volume is restored from. :vartype originating_resource_id: str :ivar inherited_size_in_bytes: Space shared by short term clone volume with parent volume in bytes. :vartype inherited_size_in_bytes: int - :ivar language: Language supported for volume. Known values are: "c.utf-8", "utf8mb4", "ar", - "ar.utf-8", "hr", "hr.utf-8", "cs", "cs.utf-8", "da", "da.utf-8", "nl", "nl.utf-8", "en", - "en.utf-8", "fi", "fi.utf-8", "fr", "fr.utf-8", "de", "de.utf-8", "he", "he.utf-8", "hu", - "hu.utf-8", "it", "it.utf-8", "ja", "ja.utf-8", "ja-v1", "ja-v1.utf-8", "ja-jp.pck", - "ja-jp.pck.utf-8", "ja-jp.932", "ja-jp.932.utf-8", "ja-jp.pck-v2", "ja-jp.pck-v2.utf-8", "ko", - "ko.utf-8", "no", "no.utf-8", "pl", "pl.utf-8", "pt", "pt.utf-8", "c", "ro", "ro.utf-8", "ru", - "ru.utf-8", "zh", "zh.utf-8", "zh.gbk", "zh.gbk.utf-8", "zh-tw.big5", "zh-tw.big5.utf-8", - "zh-tw", "zh-tw.utf-8", "sk", "sk.utf-8", "sl", "sl.utf-8", "es", "es.utf-8", "sv", "sv.utf-8", - "tr", "tr.utf-8", "en-us", and "en-us.utf-8". - :vartype language: str or ~azure.mgmt.netapp.models.VolumeLanguage :ivar breakthrough_mode: Specifies whether the volume operates in Breakthrough Mode. Known values are: "Enabled" and "Disabled". :vartype breakthrough_mode: str or ~azure.mgmt.netapp.models.BreakthroughMode @@ -11511,8 +8861,7 @@ class VolumeProperties(_Model): # pylint: disable=docstring-keyword-should-matc """Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to - 2400GiB to 2400TiB. For extra large volumes, valid values are in the range 2400GiB to 7200TiB. - Values expressed in bytes as multiples of 1 GiB. Required.""" + 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. Required.""" export_policy: Optional["_models.VolumePropertiesExportPolicy"] = rest_field( name="exportPolicy", visibility=["read", "create", "update", "delete", "query"] ) @@ -11629,11 +8978,6 @@ class VolumeProperties(_Model): # pylint: disable=docstring-keyword-should-matc volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'.""" ldap_enabled: Optional[bool] = rest_field(name="ldapEnabled", visibility=["read", "create"]) """Specifies whether LDAP is enabled or not for a given NFS volume.""" - ldap_server_type: Optional[Union[str, "_models.LdapServerType"]] = rest_field( - name="ldapServerType", visibility=["read", "create"] - ) - """Specifies the type of LDAP server for a given NFS volume. Known values are: \"ActiveDirectory\" - and \"OpenLDAP\".""" cool_access: Optional[bool] = rest_field( name="coolAccess", visibility=["read", "create", "update", "delete", "query"] ) @@ -11735,32 +9079,10 @@ class VolumeProperties(_Model): # pylint: disable=docstring-keyword-should-matc zone where the volume resides.""" is_large_volume: Optional[bool] = rest_field(name="isLargeVolume", visibility=["read", "create"]) """Specifies whether volume is a Large Volume or Regular Volume.""" - large_volume_type: Optional[Union[str, "_models.LargeVolumeType"]] = rest_field( - name="largeVolumeType", visibility=["read", "create"] - ) - """Specifies the type of the Large Volume. When set to 'LargeVolume', the large volume is created - with standard configuration. If it is set to 'ExtraLargeVolume7Dot2PiB', the extra large volume - is created with higher capacity limit 7.2PiB with cool access enabled, delivering higher - capacity limit with lower costs. Known values are: \"LargeVolume\" and - \"PremExtraLargeVolume7Dot2PiB\".""" originating_resource_id: Optional[str] = rest_field(name="originatingResourceId", visibility=["read"]) """Id of the snapshot or backup that the volume is restored from.""" inherited_size_in_bytes: Optional[int] = rest_field(name="inheritedSizeInBytes", visibility=["read"]) """Space shared by short term clone volume with parent volume in bytes.""" - language: Optional[Union[str, "_models.VolumeLanguage"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Language supported for volume. Known values are: \"c.utf-8\", \"utf8mb4\", \"ar\", - \"ar.utf-8\", \"hr\", \"hr.utf-8\", \"cs\", \"cs.utf-8\", \"da\", \"da.utf-8\", \"nl\", - \"nl.utf-8\", \"en\", \"en.utf-8\", \"fi\", \"fi.utf-8\", \"fr\", \"fr.utf-8\", \"de\", - \"de.utf-8\", \"he\", \"he.utf-8\", \"hu\", \"hu.utf-8\", \"it\", \"it.utf-8\", \"ja\", - \"ja.utf-8\", \"ja-v1\", \"ja-v1.utf-8\", \"ja-jp.pck\", \"ja-jp.pck.utf-8\", \"ja-jp.932\", - \"ja-jp.932.utf-8\", \"ja-jp.pck-v2\", \"ja-jp.pck-v2.utf-8\", \"ko\", \"ko.utf-8\", \"no\", - \"no.utf-8\", \"pl\", \"pl.utf-8\", \"pt\", \"pt.utf-8\", \"c\", \"ro\", \"ro.utf-8\", \"ru\", - \"ru.utf-8\", \"zh\", \"zh.utf-8\", \"zh.gbk\", \"zh.gbk.utf-8\", \"zh-tw.big5\", - \"zh-tw.big5.utf-8\", \"zh-tw\", \"zh-tw.utf-8\", \"sk\", \"sk.utf-8\", \"sl\", \"sl.utf-8\", - \"es\", \"es.utf-8\", \"sv\", \"sv.utf-8\", \"tr\", \"tr.utf-8\", \"en-us\", and - \"en-us.utf-8\".""" breakthrough_mode: Optional[Union[str, "_models.BreakthroughMode"]] = rest_field( name="breakthroughMode", visibility=["read", "create"] ) @@ -11797,7 +9119,6 @@ def __init__( # pylint: disable=too-many-locals encryption_key_source: Optional[Union[str, "_models.EncryptionKeySource"]] = None, key_vault_private_endpoint_resource_id: Optional[str] = None, ldap_enabled: Optional[bool] = None, - ldap_server_type: Optional[Union[str, "_models.LdapServerType"]] = None, cool_access: Optional[bool] = None, coolness_period: Optional[int] = None, cool_access_retrieval_policy: Optional[Union[str, "_models.CoolAccessRetrievalPolicy"]] = None, @@ -11813,8 +9134,6 @@ def __init__( # pylint: disable=too-many-locals placement_rules: Optional[list["_models.PlacementKeyValuePairs"]] = None, enable_subvolumes: Optional[Union[str, "_models.EnableSubvolumes"]] = None, is_large_volume: Optional[bool] = None, - large_volume_type: Optional[Union[str, "_models.LargeVolumeType"]] = None, - language: Optional[Union[str, "_models.VolumeLanguage"]] = None, breakthrough_mode: Optional[Union[str, "_models.BreakthroughMode"]] = None, ) -> None: ... @@ -12043,8 +9362,8 @@ class VolumeQuotaRulesProperties(_Model): # pylint: disable=docstring-keyword-s """Volume Quota Rule properties. :ivar provisioning_state: Gets the status of the VolumeQuotaRule at the time the operation was - called. Known values are: "Accepted", "Creating", "Patching", "Updating", "Deleting", "Moving", - "Failed", and "Succeeded". + called. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", "Creating", + "Patching", "Updating", "Deleting", and "Moving". :vartype provisioning_state: str or ~azure.mgmt.netapp.models.NetAppProvisioningState :ivar quota_size_in_ki_bs: Size of quota. :vartype quota_size_in_ki_bs: int @@ -12061,8 +9380,8 @@ class VolumeQuotaRulesProperties(_Model): # pylint: disable=docstring-keyword-s name="provisioningState", visibility=["read"] ) """Gets the status of the VolumeQuotaRule at the time the operation was called. Known values are: - \"Accepted\", \"Creating\", \"Patching\", \"Updating\", \"Deleting\", \"Moving\", \"Failed\", - and \"Succeeded\".""" + \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", \"Creating\", \"Patching\", + \"Updating\", \"Deleting\", and \"Moving\".""" quota_size_in_ki_bs: Optional[int] = rest_field( name="quotaSizeInKiBs", visibility=["read", "create", "update", "delete", "query"] ) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py index dc8916780c55..4edfa8469e9a 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py @@ -25,15 +25,6 @@ from ._operations import BackupVaultsOperations # type: ignore from ._operations import BucketsOperations # type: ignore from ._operations import CachesOperations # type: ignore -from ._operations import ElasticAccountsOperations # type: ignore -from ._operations import ElasticCapacityPoolsOperations # type: ignore -from ._operations import ElasticVolumesOperations # type: ignore -from ._operations import ElasticSnapshotsOperations # type: ignore -from ._operations import ElasticSnapshotPoliciesOperations # type: ignore -from ._operations import ElasticBackupVaultsOperations # type: ignore -from ._operations import ElasticBackupPoliciesOperations # type: ignore -from ._operations import ElasticBackupsOperations # type: ignore -from ._operations import ActiveDirectoryConfigsOperations # type: ignore from ._operations import NetAppResourceQuotaLimitsOperations # type: ignore from ._operations import NetAppResourceRegionInfosOperations # type: ignore from ._operations import AccountsOperations # type: ignore @@ -63,15 +54,6 @@ "BackupVaultsOperations", "BucketsOperations", "CachesOperations", - "ElasticAccountsOperations", - "ElasticCapacityPoolsOperations", - "ElasticVolumesOperations", - "ElasticSnapshotsOperations", - "ElasticSnapshotPoliciesOperations", - "ElasticBackupVaultsOperations", - "ElasticBackupPoliciesOperations", - "ElasticBackupsOperations", - "ActiveDirectoryConfigsOperations", "NetAppResourceQuotaLimitsOperations", "NetAppResourceRegionInfosOperations", "AccountsOperations", diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py index dc4930f26b6d..68ae8c5ea2a3 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py @@ -50,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_net_app_resource_quota_limits_account_get_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_net_app_resource_quota_limits_account_list_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +128,7 @@ def build_volume_groups_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_volume_groups_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +188,7 @@ def build_volume_groups_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}" path_format_arguments = { @@ -212,7 +212,7 @@ def build_volume_groups_list_by_net_app_account_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +245,7 @@ def build_backups_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +281,7 @@ def build_backups_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +319,7 @@ def build_backups_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -355,7 +355,7 @@ def build_backups_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}" path_format_arguments = { @@ -386,7 +386,7 @@ def build_backups_list_by_vault_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_backups_get_latest_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -447,7 +447,7 @@ def build_backups_get_volume_latest_restore_status_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -477,7 +477,7 @@ def build_volumes_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -508,7 +508,7 @@ def build_volumes_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -541,7 +541,7 @@ def build_volumes_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -579,7 +579,7 @@ def build_volumes_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}" path_format_arguments = { @@ -606,7 +606,7 @@ def build_volumes_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -635,7 +635,7 @@ def build_volumes_populate_availability_zone_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -666,7 +666,7 @@ def build_volumes_revert_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert" path_format_arguments = { @@ -694,7 +694,7 @@ def build_volumes_reset_cifs_password_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resetCifsPassword" path_format_arguments = { @@ -719,7 +719,7 @@ def build_volumes_split_clone_from_parent_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -750,7 +750,7 @@ def build_volumes_break_file_locks_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakFileLocks" path_format_arguments = { @@ -780,7 +780,7 @@ def build_volumes_list_get_group_id_list_for_ldap_user_request( # pylint: disab _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -813,7 +813,7 @@ def build_volumes_break_replication_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication" path_format_arguments = { @@ -843,7 +843,7 @@ def build_volumes_reestablish_replication_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication" path_format_arguments = { @@ -872,7 +872,7 @@ def build_volumes_replication_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -903,7 +903,7 @@ def build_volumes_list_replications_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -934,7 +934,7 @@ def build_volumes_resync_replication_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication" path_format_arguments = { @@ -958,7 +958,7 @@ def build_volumes_delete_replication_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication" path_format_arguments = { @@ -984,7 +984,7 @@ def build_volumes_authorize_replication_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication" path_format_arguments = { @@ -1012,7 +1012,7 @@ def build_volumes_re_initialize_replication_request( # pylint: disable=name-too ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication" path_format_arguments = { @@ -1038,7 +1038,7 @@ def build_volumes_peer_external_cluster_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1070,7 +1070,7 @@ def build_volumes_authorize_external_replication_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1099,7 +1099,7 @@ def build_volumes_finalize_external_replication_request( # pylint: disable=name ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/finalizeExternalReplication" path_format_arguments = { @@ -1123,7 +1123,7 @@ def build_volumes_perform_replication_transfer_request( # pylint: disable=name- ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/performReplicationTransfer" path_format_arguments = { @@ -1149,7 +1149,7 @@ def build_volumes_pool_change_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange" path_format_arguments = { @@ -1179,7 +1179,7 @@ def build_volumes_relocate_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/relocate" path_format_arguments = { @@ -1207,7 +1207,7 @@ def build_volumes_finalize_relocation_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/finalizeRelocation" path_format_arguments = { @@ -1231,7 +1231,7 @@ def build_volumes_revert_relocation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revertRelocation" path_format_arguments = { @@ -1257,7 +1257,7 @@ def build_volumes_list_quota_report_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1295,7 +1295,7 @@ def build_snapshots_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1333,7 +1333,7 @@ def build_snapshots_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1373,7 +1373,7 @@ def build_snapshots_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1411,7 +1411,7 @@ def build_snapshots_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}" path_format_arguments = { @@ -1437,7 +1437,7 @@ def build_snapshots_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1474,7 +1474,7 @@ def build_snapshots_restore_files_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles" path_format_arguments = { @@ -1504,7 +1504,7 @@ def build_snapshot_policies_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1534,7 +1534,7 @@ def build_snapshot_policies_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1566,7 +1566,7 @@ def build_snapshot_policies_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1596,7 +1596,7 @@ def build_snapshot_policies_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}" path_format_arguments = { @@ -1620,7 +1620,7 @@ def build_snapshot_policies_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1648,7 +1648,7 @@ def build_snapshot_policies_list_volumes_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1677,7 +1677,7 @@ def build_backup_policies_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1707,7 +1707,7 @@ def build_backup_policies_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1739,7 +1739,7 @@ def build_backup_policies_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1769,7 +1769,7 @@ def build_backup_policies_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}" path_format_arguments = { @@ -1793,7 +1793,7 @@ def build_backup_policies_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1827,7 +1827,7 @@ def build_volume_quota_rules_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1865,7 +1865,7 @@ def build_volume_quota_rules_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1905,7 +1905,7 @@ def build_volume_quota_rules_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1943,7 +1943,7 @@ def build_volume_quota_rules_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}" path_format_arguments = { @@ -1969,7 +1969,7 @@ def build_volume_quota_rules_list_by_volume_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2005,7 +2005,7 @@ def build_ransomware_reports_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2036,7 +2036,7 @@ def build_ransomware_reports_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2073,7 +2073,7 @@ def build_ransomware_reports_clear_suspects_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/ransomwareReports/{ransomwareReportName}/clearSuspects" path_format_arguments = { @@ -2103,7 +2103,7 @@ def build_backup_vaults_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2133,7 +2133,7 @@ def build_backup_vaults_create_or_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2165,7 +2165,7 @@ def build_backup_vaults_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2195,7 +2195,7 @@ def build_backup_vaults_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}" path_format_arguments = { @@ -2219,7 +2219,7 @@ def build_backup_vaults_list_by_net_app_account_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2253,7 +2253,7 @@ def build_buckets_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2291,7 +2291,7 @@ def build_buckets_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2331,7 +2331,7 @@ def build_buckets_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2369,7 +2369,7 @@ def build_buckets_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/buckets/{bucketName}" path_format_arguments = { @@ -2395,7 +2395,7 @@ def build_buckets_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2432,7 +2432,7 @@ def build_buckets_generate_credentials_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2472,7 +2472,7 @@ def build_buckets_generate_akv_credentials_request( # pylint: disable=name-too- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/buckets/{bucketName}/generateAkvCredentials" path_format_arguments = { @@ -2507,7 +2507,7 @@ def build_buckets_refresh_certificate_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/buckets/{bucketName}/refreshCertificate" path_format_arguments = { @@ -2533,7 +2533,7 @@ def build_caches_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2564,7 +2564,7 @@ def build_caches_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2597,7 +2597,7 @@ def build_caches_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2628,7 +2628,7 @@ def build_caches_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/caches/{cacheName}" path_format_arguments = { @@ -2653,7 +2653,7 @@ def build_caches_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2682,7 +2682,7 @@ def build_caches_list_peering_passphrases_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2713,7 +2713,7 @@ def build_caches_pool_change_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2745,7 +2745,7 @@ def build_caches_reset_smb_password_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2769,21 +2769,23 @@ def build_caches_reset_smb_password_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_accounts_get_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_quota_limits_get_request( # pylint: disable=name-too-long + location: str, quota_limit_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}" + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}" + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "quotaLimitName": _SERIALIZER.url("quota_limit_name", quota_limit_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2797,53 +2799,20 @@ def build_elastic_accounts_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_accounts_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_elastic_accounts_update_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_quota_limits_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2852,51 +2821,25 @@ def build_elastic_accounts_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_elastic_accounts_delete_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_accounts_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_region_infos_get_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = ( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts" - ) + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos/default" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2910,19 +2853,20 @@ def build_elastic_accounts_list_by_resource_group_request( # pylint: disable=na return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_accounts_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any +def build_net_app_resource_region_infos_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/elasticAccounts" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2936,22 +2880,21 @@ def build_elastic_accounts_list_by_subscription_request( # pylint: disable=name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_capacity_pools_get_request( - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_accounts_get_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2965,23 +2908,22 @@ def build_elastic_capacity_pools_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_capacity_pools_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_accounts_create_or_update_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2997,23 +2939,22 @@ def build_elastic_capacity_pools_create_or_update_request( # pylint: disable=na return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_capacity_pools_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_accounts_update_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3029,19 +2970,18 @@ def build_elastic_capacity_pools_update_request( # pylint: disable=name-too-lon return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_capacity_pools_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_accounts_delete_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3052,21 +2992,20 @@ def build_elastic_capacity_pools_delete_request( # pylint: disable=name-too-lon return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_elastic_capacity_pools_list_by_elastic_account_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: +def build_accounts_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools" + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts" + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3080,23 +3019,19 @@ def build_elastic_capacity_pools_list_by_elastic_account_request( # pylint: dis return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_capacity_pools_change_zone_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_accounts_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/changeZone" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3105,30 +3040,23 @@ def build_elastic_capacity_pools_change_zone_request( # pylint: disable=name-to _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_capacity_pools_check_volume_file_path_availability_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_accounts_renew_credentials_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/checkVolumeFilePathAvailability" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/renewCredentials" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3136,31 +3064,23 @@ def build_elastic_capacity_pools_check_volume_file_path_availability_request( # # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_elastic_volumes_get_request( - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any +def build_accounts_transition_to_cmk_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/transitiontocmk" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3169,29 +3089,27 @@ def build_elastic_volumes_get_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_volumes_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any +def build_accounts_get_change_key_vault_information_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/getKeyVaultStatus" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3200,31 +3118,25 @@ def build_elastic_volumes_create_or_update_request( # pylint: disable=name-too- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_volumes_update_request( - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any +def build_accounts_change_key_vault_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/changeKeyVault" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3235,25 +3147,22 @@ def build_elastic_volumes_update_request( # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_volumes_delete_request( - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any +def build_accounts_refresh_ldap_bind_password_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/refreshLdapBindPassword" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3261,25 +3170,23 @@ def build_elastic_volumes_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_elastic_volumes_list_by_elastic_pool_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any +def build_backups_under_account_migrate_backups_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateBackups" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3288,29 +3195,28 @@ def build_elastic_volumes_list_by_elastic_pool_request( # pylint: disable=name- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_volumes_revert_request( - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any +def build_pools_get_request( + resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}/revert" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3319,37 +3225,28 @@ def build_elastic_volumes_revert_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshots_get_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - subscription_id: str, - **kwargs: Any +def build_pools_create_or_update_request( + resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}/elasticSnapshots/{snapshotName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3358,36 +3255,30 @@ def build_elastic_snapshots_get_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshots_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - subscription_id: str, - **kwargs: Any +def build_pools_update_request( + resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}/elasticSnapshots/{snapshotName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3400,30 +3291,22 @@ def build_elastic_snapshots_create_or_update_request( # pylint: disable=name-to _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshots_delete_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - subscription_id: str, - **kwargs: Any +def build_pools_delete_request( + resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}/elasticSnapshots/{snapshotName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3434,23 +3317,21 @@ def build_elastic_snapshots_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_elastic_snapshots_list_by_elastic_volume_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any +def build_pools_list_request( + resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticCapacityPools/{poolName}/elasticVolumes/{volumeName}/elasticSnapshots" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3464,22 +3345,27 @@ def build_elastic_snapshots_list_by_elastic_volume_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshot_policies_get_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, snapshot_policy_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") +def build_backups_under_backup_vault_restore_files_request( # pylint: disable=name-too-long + resource_group_name: str, + account_name: str, + backup_vault_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticSnapshotPolicies/{snapshotPolicyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}/restoreFiles" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), + "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3488,28 +3374,28 @@ def build_elastic_snapshot_policies_get_request( # pylint: disable=name-too-lon _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshot_policies_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, snapshot_policy_name: str, subscription_id: str, **kwargs: Any +def build_backups_under_volume_migrate_backups_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticSnapshotPolicies/{snapshotPolicyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/migrateBackups" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3520,28 +3406,34 @@ def build_elastic_snapshot_policies_create_or_update_request( # pylint: disable # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshot_policies_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, snapshot_policy_name: str, subscription_id: str, **kwargs: Any +def build_subvolumes_get_request( + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticSnapshotPolicies/{snapshotPolicyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3550,26 +3442,36 @@ def build_elastic_snapshot_policies_update_request( # pylint: disable=name-too- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshot_policies_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, snapshot_policy_name: str, subscription_id: str, **kwargs: Any +def build_subvolumes_create_request( + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticSnapshotPolicies/{snapshotPolicyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3577,24 +3479,39 @@ def build_elastic_snapshot_policies_delete_request( # pylint: disable=name-too- # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshot_policies_list_by_elastic_account_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any + +def build_subvolumes_update_request( + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticSnapshotPolicies" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3603,27 +3520,34 @@ def build_elastic_snapshot_policies_list_by_elastic_account_request( # pylint: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_snapshot_policies_list_elastic_volumes_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, snapshot_policy_name: str, subscription_id: str, **kwargs: Any +def build_subvolumes_delete_request( + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticSnapshotPolicies/{snapshotPolicyName}/elasticvolumes" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3631,28 +3555,26 @@ def build_elastic_snapshot_policies_list_elastic_volumes_request( # pylint: dis # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_elastic_backup_vaults_get_request( - resource_group_name: str, account_name: str, backup_vault_name: str, subscription_id: str, **kwargs: Any +def build_subvolumes_list_by_volume_request( + resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3666,23 +3588,30 @@ def build_elastic_backup_vaults_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_vaults_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_vault_name: str, subscription_id: str, **kwargs: Any +def build_subvolumes_get_metadata_request( + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3691,30 +3620,26 @@ def build_elastic_backup_vaults_create_or_update_request( # pylint: disable=nam _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_vaults_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_vault_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_check_name_availability_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3727,22 +3652,24 @@ def build_elastic_backup_vaults_update_request( # pylint: disable=name-too-long _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_vaults_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_vault_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_check_file_path_availability_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3750,24 +3677,29 @@ def build_elastic_backup_vaults_delete_request( # pylint: disable=name-too-long # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_vaults_list_by_elastic_account_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_check_quota_availability_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3776,27 +3708,27 @@ def build_elastic_backup_vaults_list_by_elastic_account_request( # pylint: disa _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_policies_get_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_policy_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_query_region_info_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupPolicies/{backupPolicyName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3810,23 +3742,21 @@ def build_elastic_backup_policies_get_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_policies_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_policy_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_query_network_sibling_set_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupPolicies/{backupPolicyName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/queryNetworkSiblingSet" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3839,26 +3769,24 @@ def build_elastic_backup_policies_create_or_update_request( # pylint: disable=n _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_policies_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_policy_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_update_network_sibling_set_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupPolicies/{backupPolicyName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3871,47 +3799,23 @@ def build_elastic_backup_policies_update_request( # pylint: disable=name-too-lo _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_elastic_backup_policies_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_policy_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupPolicies/{backupPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backup_policies_list_by_elastic_account_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_net_app_resource_usages_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupPolicies" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/usages" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3925,28 +3829,21 @@ def build_elastic_backup_policies_list_by_elastic_account_request( # pylint: di return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backups_get_request( - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - subscription_id: str, - **kwargs: Any +def build_net_app_resource_usages_get_request( # pylint: disable=name-too-long + location: str, usage_type: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}/elasticBackups/{backupName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/usages/{usageType}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "usageType": _SERIALIZER.url("usage_type", usage_type, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3960,9712 +3857,36 @@ def build_elastic_backups_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_elastic_backups_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}/elasticBackups/{backupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_elastic_backups_update_request( - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}/elasticBackups/{backupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_elastic_backups_delete_request( - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}/elasticBackups/{backupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_elastic_backups_list_by_vault_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, backup_vault_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/elasticAccounts/{accountName}/elasticBackupVaults/{backupVaultName}/elasticBackups" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_active_directory_configs_get_request( # pylint: disable=name-too-long - resource_group_name: str, active_directory_config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/activeDirectoryConfigs/{activeDirectoryConfigName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "activeDirectoryConfigName": _SERIALIZER.url( - "active_directory_config_name", active_directory_config_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_active_directory_configs_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, active_directory_config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/activeDirectoryConfigs/{activeDirectoryConfigName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "activeDirectoryConfigName": _SERIALIZER.url( - "active_directory_config_name", active_directory_config_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_active_directory_configs_update_request( # pylint: disable=name-too-long - resource_group_name: str, active_directory_config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/activeDirectoryConfigs/{activeDirectoryConfigName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "activeDirectoryConfigName": _SERIALIZER.url( - "active_directory_config_name", active_directory_config_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_active_directory_configs_delete_request( # pylint: disable=name-too-long - resource_group_name: str, active_directory_config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/activeDirectoryConfigs/{activeDirectoryConfigName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "activeDirectoryConfigName": _SERIALIZER.url( - "active_directory_config_name", active_directory_config_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_active_directory_configs_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/activeDirectoryConfigs" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_active_directory_configs_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/activeDirectoryConfigs" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_quota_limits_get_request( # pylint: disable=name-too-long - location: str, quota_limit_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = ( - "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "quotaLimitName": _SERIALIZER.url("quota_limit_name", quota_limit_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_quota_limits_list_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_region_infos_get_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos/default" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_region_infos_list_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_get_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_create_or_update_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_update_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_delete_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_accounts_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = ( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_renew_credentials_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/renewCredentials" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_accounts_transition_to_cmk_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/transitiontocmk" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_get_change_key_vault_information_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/getKeyVaultStatus" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_change_key_vault_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/changeKeyVault" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_accounts_refresh_ldap_bind_password_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/refreshLdapBindPassword" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_backups_under_account_migrate_backups_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateBackups" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pools_get_request( - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pools_create_or_update_request( - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pools_update_request( - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pools_delete_request( - resource_group_name: str, account_name: str, pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_pools_list_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_backups_under_backup_vault_restore_files_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}/restoreFiles" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "backupVaultName": _SERIALIZER.url("backup_vault_name", backup_vault_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_backups_under_volume_migrate_backups_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/migrateBackups" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_subvolumes_get_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_subvolumes_create_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_subvolumes_update_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_subvolumes_delete_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_subvolumes_list_by_volume_request( - resource_group_name: str, account_name: str, pool_name: str, volume_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_subvolumes_get_metadata_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - subvolume_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "volumeName": _SERIALIZER.url("volume_name", volume_name, "str"), - "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_check_name_availability_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_check_file_path_availability_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_check_quota_availability_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_query_region_info_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_query_network_sibling_set_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/queryNetworkSiblingSet" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_update_network_sibling_set_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_usages_list_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/usages" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_net_app_resource_usages_get_request( # pylint: disable=name-too-long - location: str, usage_type: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/usages/{usageType}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "usageType": _SERIALIZER.url("usage_type", usage_type, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """List the operations for the provider. - - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class NetAppResourceQuotaLimitsAccountOperations: # pylint: disable=docstring-missing-param,name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`net_app_resource_quota_limits_account` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2025-08-01", - params_added_on={ - "2025-08-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "quota_limit_name", - "accept", - ] - }, - api_versions_list=[ - "2025-08-01", - "2025-09-01", - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def get( - self, resource_group_name: str, account_name: str, quota_limit_name: str, **kwargs: Any - ) -> _models.QuotaItem: - """Get the default, current and usages account quota limit. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param quota_limit_name: The name of the Quota Limit. Required. - :type quota_limit_name: str - :return: QuotaItem. The QuotaItem is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.QuotaItem - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.QuotaItem] = kwargs.pop("cls", None) - - _request = build_net_app_resource_quota_limits_account_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - quota_limit_name=quota_limit_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.QuotaItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-08-01", - params_added_on={ - "2025-08-01": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-08-01", - "2025-09-01", - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.QuotaItem"]: - """Gets a list of quota limits for all quotas that are under account. Currently PoolsPerAccount is - the only one. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :return: An iterator like instance of QuotaItem - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.QuotaItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.QuotaItem]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_net_app_resource_quota_limits_account_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.QuotaItem], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class VolumeGroupsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`volume_groups` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any - ) -> _models.VolumeGroupDetails: - """Get details of the specified volume group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param volume_group_name: The name of the volumeGroup. Required. - :type volume_group_name: str - :return: VolumeGroupDetails. The VolumeGroupDetails is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.VolumeGroupDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.VolumeGroupDetails] = kwargs.pop("cls", None) - - _request = build_volume_groups_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - volume_group_name=volume_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VolumeGroupDetails, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: Union[_models.VolumeGroupDetails, _types.VolumeGroupDetails, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volume_groups_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - volume_group_name=volume_group_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: _models.VolumeGroupDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VolumeGroupDetails]: - """Create a volume group along with specified volumes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param volume_group_name: The name of the volumeGroup. Required. - :type volume_group_name: str - :param body: Volume Group object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.VolumeGroupDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: _types.VolumeGroupDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VolumeGroupDetails]: - """Create a volume group along with specified volumes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param volume_group_name: The name of the volumeGroup. Required. - :type volume_group_name: str - :param body: Volume Group object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.VolumeGroupDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VolumeGroupDetails]: - """Create a volume group along with specified volumes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param volume_group_name: The name of the volumeGroup. Required. - :type volume_group_name: str - :param body: Volume Group object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - account_name: str, - volume_group_name: str, - body: Union[_models.VolumeGroupDetails, _types.VolumeGroupDetails, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.VolumeGroupDetails]: - """Create a volume group along with specified volumes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param volume_group_name: The name of the volumeGroup. Required. - :type volume_group_name: str - :param body: Volume Group object supplied in the body of the operation. Is either a - VolumeGroupDetails type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.VolumeGroupDetails or - ~azure.mgmt.netapp.types.VolumeGroupDetails or IO[bytes] - :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VolumeGroupDetails] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - volume_group_name=volume_group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.VolumeGroupDetails, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.VolumeGroupDetails].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.VolumeGroupDetails]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volume_groups_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - volume_group_name=volume_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete the specified volume group only if there are no volumes under volume group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param volume_group_name: The name of the volumeGroup. Required. - :type volume_group_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - volume_group_name=volume_group_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_net_app_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.VolumeGroup"]: - """List all volume groups for given account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :return: An iterator like instance of VolumeGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.VolumeGroup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_volume_groups_list_by_net_app_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VolumeGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class BackupsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`backups` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> _models.Backup: - """Get the specified Backup under Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :return: Backup. The Backup is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.Backup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - - _request = build_backups_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Backup, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.Backup, _types.Backup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_backups_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: _models.Backup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.Backup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: _types.Backup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.Backup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.Backup, _types.Backup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Is either a Backup type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.Backup or ~azure.mgmt.netapp.types.Backup or IO[bytes] - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Backup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Backup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Backup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[Union[_models.BackupPatch, _types.BackupPatch, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_backups_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[_models.BackupPatch] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a Backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: ~azure.mgmt.netapp.models.BackupPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[_types.BackupPatch] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a Backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: ~azure.mgmt.netapp.types.BackupPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a Backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - backup_name: str, - body: Optional[Union[_models.BackupPatch, _types.BackupPatch, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a Backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Is either a BackupPatch type - or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.netapp.models.BackupPatch or ~azure.mgmt.netapp.types.BackupPatch or - IO[bytes] - :return: An instance of LROPoller that returns Backup. The Backup is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Backup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Backup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Backup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_backups_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Backup under the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param backup_name: The name of the backup. Required. - :type backup_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_vault( - self, - resource_group_name: str, - account_name: str, - backup_vault_name: str, - *, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.Backup"]: - """List all backups Under a Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :keyword filter: An option to specify the VolumeResourceId. If present, then only returns the - backups under the specified volume. Default value is None. - :paramtype filter: str - :return: An iterator like instance of Backup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Backup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_backups_list_by_vault_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Backup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_latest_status( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.BackupStatus: - """Get the latest status of the backup for a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: BackupStatus. The BackupStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.BackupStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.BackupStatus] = kwargs.pop("cls", None) - - _request = build_backups_get_latest_status_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BackupStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_volume_latest_restore_status( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.RestoreStatus: - """Get the latest status of the restore for a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: RestoreStatus. The RestoreStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.RestoreStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RestoreStatus] = kwargs.pop("cls", None) - - _request = build_backups_get_volume_latest_restore_status_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RestoreStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class VolumesOperations: # pylint: disable=docstring-missing-param,too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`volumes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.Volume: - """Get the details of the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: Volume. The Volume is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.Volume - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Volume] = kwargs.pop("cls", None) - - _request = build_volumes_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Volume, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.Volume, _types.Volume, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.Volume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.Volume - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.Volume, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.Volume - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.Volume, _types.Volume, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Create or update the specified volume within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Is either a Volume type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.Volume or ~azure.mgmt.netapp.types.Volume or IO[bytes] - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Volume] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Volume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Volume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Volume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.VolumePatch, _types.VolumePatch, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.VolumePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Patch the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.VolumePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.VolumePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Patch the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.VolumePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Patch the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.VolumePatch, _types.VolumePatch, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Patch the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Volume object supplied in the body of the operation. Is either a VolumePatch type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.VolumePatch or ~azure.mgmt.netapp.types.VolumePatch or - IO[bytes] - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Volume] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Volume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Volume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Volume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - *, - force_delete: Optional[bool] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - force_delete=force_delete, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - *, - force_delete: Optional[bool] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Delete the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :keyword force_delete: An option to force delete the volume. Will cleanup resources connected - to the particular volume. Default value is None. - :paramtype force_delete: bool - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - force_delete=force_delete, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.Volume"]: - """List all volumes within the capacity pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :return: An iterator like instance of Volume - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Volume]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_volumes_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Volume], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _populate_availability_zone_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_populate_availability_zone_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_populate_availability_zone( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[_models.Volume]: - """This operation will populate availability zone information for a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Volume] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._populate_availability_zone_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Volume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Volume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Volume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _revert_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.VolumeRevert, _types.VolumeRevert, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_revert_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.VolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Revert a volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Object for snapshot to revert supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.VolumeRevert - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.VolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Revert a volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Object for snapshot to revert supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.VolumeRevert - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Revert a volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Object for snapshot to revert supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.VolumeRevert, _types.VolumeRevert, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Revert a volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Object for snapshot to revert supplied in the body of the operation. Is either a - VolumeRevert type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.VolumeRevert or ~azure.mgmt.netapp.types.VolumeRevert or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._revert_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _reset_cifs_password_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_reset_cifs_password_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_reset_cifs_password( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Reset cifs password from volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._reset_cifs_password_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _split_clone_from_parent_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_split_clone_from_parent_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_split_clone_from_parent( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[_models.Volume]: - """Split operation to convert clone volume to an independent volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns Volume. The Volume is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Volume] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._split_clone_from_parent_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Volume, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Volume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Volume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _break_file_locks_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.BreakFileLocksRequest, _types.BreakFileLocksRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_volumes_break_file_locks_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_models.BreakFileLocksRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Break all the file locks on a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to provide the ability to clear file locks with selected options. - Default value is None. - :type body: ~azure.mgmt.netapp.models.BreakFileLocksRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_types.BreakFileLocksRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Break all the file locks on a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to provide the ability to clear file locks with selected options. - Default value is None. - :type body: ~azure.mgmt.netapp.types.BreakFileLocksRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Break all the file locks on a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to provide the ability to clear file locks with selected options. - Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.BreakFileLocksRequest, _types.BreakFileLocksRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Break all the file locks on a volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to provide the ability to clear file locks with selected options. Is - either a BreakFileLocksRequest type or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.netapp.models.BreakFileLocksRequest or - ~azure.mgmt.netapp.types.BreakFileLocksRequest or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._break_file_locks_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2025-08-01", - params_added_on={ - "2025-08-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-08-01", - "2025-09-01", - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _list_get_group_id_list_for_ldap_user_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.GetGroupIdListForLDAPUserRequest, _types.GetGroupIdListForLDAPUserRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_list_get_group_id_list_for_ldap_user_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.GetGroupIdListForLDAPUserRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: - """Returns the list of group Ids for a specific LDAP User. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Returns group Id list for a specific LDAP user. Required. - :type body: ~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The - GetGroupIdListForLDAPUserResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.GetGroupIdListForLDAPUserRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: - """Returns the list of group Ids for a specific LDAP User. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Returns group Id list for a specific LDAP user. Required. - :type body: ~azure.mgmt.netapp.types.GetGroupIdListForLDAPUserRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The - GetGroupIdListForLDAPUserResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: - """Returns the list of group Ids for a specific LDAP User. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Returns group Id list for a specific LDAP user. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The - GetGroupIdListForLDAPUserResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2025-08-01", - params_added_on={ - "2025-08-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-08-01", - "2025-09-01", - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.GetGroupIdListForLDAPUserRequest, _types.GetGroupIdListForLDAPUserRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: - """Returns the list of group Ids for a specific LDAP User. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Returns group Id list for a specific LDAP user. Is either a - GetGroupIdListForLDAPUserRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserRequest or - ~azure.mgmt.netapp.types.GetGroupIdListForLDAPUserRequest or IO[bytes] - :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The - GetGroupIdListForLDAPUserResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GetGroupIdListForLDAPUserResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._list_get_group_id_list_for_ldap_user_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.GetGroupIdListForLDAPUserResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.GetGroupIdListForLDAPUserResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.GetGroupIdListForLDAPUserResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _break_replication_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.BreakReplicationRequest, _types.BreakReplicationRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_volumes_break_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_models.BreakReplicationRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Break the replication connection on the destination volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to force break the replication. Default value is None. - :type body: ~azure.mgmt.netapp.models.BreakReplicationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_types.BreakReplicationRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Break the replication connection on the destination volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to force break the replication. Default value is None. - :type body: ~azure.mgmt.netapp.types.BreakReplicationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Break the replication connection on the destination volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to force break the replication. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_break_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.BreakReplicationRequest, _types.BreakReplicationRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Break the replication connection on the destination volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Optional body to force break the replication. Is either a BreakReplicationRequest - type or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.netapp.models.BreakReplicationRequest or - ~azure.mgmt.netapp.types.BreakReplicationRequest or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._break_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _reestablish_replication_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ReestablishReplicationRequest, _types.ReestablishReplicationRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_reestablish_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.ReestablishReplicationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or - policy-based snapshots. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: body for the id of the source volume. Required. - :type body: ~azure.mgmt.netapp.models.ReestablishReplicationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.ReestablishReplicationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or - policy-based snapshots. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: body for the id of the source volume. Required. - :type body: ~azure.mgmt.netapp.types.ReestablishReplicationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or - policy-based snapshots. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: body for the id of the source volume. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_reestablish_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ReestablishReplicationRequest, _types.ReestablishReplicationRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or - policy-based snapshots. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: body for the id of the source volume. Is either a ReestablishReplicationRequest - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ReestablishReplicationRequest or - ~azure.mgmt.netapp.types.ReestablishReplicationRequest or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._reestablish_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def replication_status( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.ReplicationStatus: - """Get the status of the replication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: ReplicationStatus. The ReplicationStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ReplicationStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ReplicationStatus] = kwargs.pop("cls", None) - - _request = build_volumes_replication_status_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ReplicationStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_models.ListReplicationsRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged["_models.Replication"]: - """List all replications for a specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Default value is None. - :type body: ~azure.mgmt.netapp.models.ListReplicationsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of Replication - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_types.ListReplicationsRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged["_models.Replication"]: - """List all replications for a specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Default value is None. - :type body: ~azure.mgmt.netapp.types.ListReplicationsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of Replication - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged["_models.Replication"]: - """List all replications for a specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of Replication - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2025-08-01", - params_added_on={ - "2025-08-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-08-01", - "2025-09-01", - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def list_replications( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.ListReplicationsRequest, _types.ListReplicationsRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> ItemPaged["_models.Replication"]: - """List all replications for a specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Is either a ListReplicationsRequest type or a - IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.netapp.models.ListReplicationsRequest or - ~azure.mgmt.netapp.types.ListReplicationsRequest or IO[bytes] - :return: An iterator like instance of Replication - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[List[_models.Replication]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - def prepare_request(next_link=None): - if not next_link: - - _request = build_volumes_list_replications_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Replication], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _resync_replication_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_resync_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_resync_replication( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Resync the connection on the destination volume. If the operation is ran on the source volume - it will reverse-resync the connection and sync from destination to source. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._resync_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _delete_replication_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_delete_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_replication( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete the replication connection on the destination volume, and send release to the source - replication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _authorize_replication_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.AuthorizeRequest, _types.AuthorizeRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_authorize_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.AuthorizeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Authorize the replication connection on the source volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Authorize request object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.AuthorizeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.AuthorizeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Authorize the replication connection on the source volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Authorize request object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.AuthorizeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Authorize the replication connection on the source volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Authorize request object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_authorize_replication( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.AuthorizeRequest, _types.AuthorizeRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Authorize the replication connection on the source volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Authorize request object supplied in the body of the operation. Is either a - AuthorizeRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.AuthorizeRequest or - ~azure.mgmt.netapp.types.AuthorizeRequest or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._authorize_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _re_initialize_replication_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_re_initialize_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_re_initialize_replication( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Re-Initializes the replication connection on the destination volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._re_initialize_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _peer_external_cluster_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[ - _models.PeerClusterForVolumeMigrationRequest, _types.PeerClusterForVolumeMigrationRequest, IO[bytes] - ], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_peer_external_cluster_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.PeerClusterForVolumeMigrationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPeerCommandResponse]: - """Starts peering the external cluster for this migration volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Cluster peer request object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The - ClusterPeerCommandResponse is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.PeerClusterForVolumeMigrationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPeerCommandResponse]: - """Starts peering the external cluster for this migration volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Cluster peer request object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.PeerClusterForVolumeMigrationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The - ClusterPeerCommandResponse is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPeerCommandResponse]: - """Starts peering the external cluster for this migration volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Cluster peer request object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The - ClusterPeerCommandResponse is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_peer_external_cluster( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[ - _models.PeerClusterForVolumeMigrationRequest, _types.PeerClusterForVolumeMigrationRequest, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.ClusterPeerCommandResponse]: - """Starts peering the external cluster for this migration volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Cluster peer request object supplied in the body of the operation. Is either a - PeerClusterForVolumeMigrationRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest or - ~azure.mgmt.netapp.types.PeerClusterForVolumeMigrationRequest or IO[bytes] - :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The - ClusterPeerCommandResponse is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ClusterPeerCommandResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._peer_external_cluster_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ClusterPeerCommandResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClusterPeerCommandResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterPeerCommandResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _authorize_external_replication_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_authorize_external_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_authorize_external_replication( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[_models.SvmPeerCommandResponse]: - """Starts SVM peering and returns a command to be run on the external ONTAP to accept it. Once - the SVM have been peered a SnapMirror will be created. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns SvmPeerCommandResponse. The - SvmPeerCommandResponse is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SvmPeerCommandResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SvmPeerCommandResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._authorize_external_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.SvmPeerCommandResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SvmPeerCommandResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SvmPeerCommandResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _finalize_external_replication_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_finalize_external_replication_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_finalize_external_replication( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Finalizes the migration of an external volume by releasing the replication and breaking the - external cluster peering if no other migration is active. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._finalize_external_replication_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _perform_replication_transfer_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_perform_replication_transfer_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_perform_replication_transfer( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Performs an adhoc replication transfer on a volume with volumeType Migration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._perform_replication_transfer_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _pool_change_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_volumes_pool_change_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Moves volume to another pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Move volume to the pool supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.PoolChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Moves volume to another pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Move volume to the pool supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.PoolChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Moves volume to another pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Move volume to the pool supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Moves volume to another pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Move volume to the pool supplied in the body of the operation. Is either a - PoolChangeRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.PoolChangeRequest or - ~azure.mgmt.netapp.types.PoolChangeRequest or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._pool_change_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _relocate_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.RelocateVolumeRequest, _types.RelocateVolumeRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_volumes_relocate_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_models.RelocateVolumeRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Relocates volume to a new stamp. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Relocate volume request. Default value is None. - :type body: ~azure.mgmt.netapp.models.RelocateVolumeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_types.RelocateVolumeRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Relocates volume to a new stamp. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Relocate volume request. Default value is None. - :type body: ~azure.mgmt.netapp.types.RelocateVolumeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Relocates volume to a new stamp. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Relocate volume request. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_relocate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.RelocateVolumeRequest, _types.RelocateVolumeRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Relocates volume to a new stamp. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: Relocate volume request. Is either a RelocateVolumeRequest type or a IO[bytes] - type. Default value is None. - :type body: ~azure.mgmt.netapp.models.RelocateVolumeRequest or - ~azure.mgmt.netapp.types.RelocateVolumeRequest or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._relocate_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _finalize_relocation_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_finalize_relocation_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_finalize_relocation( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Finalizes the relocation of the volume and cleans up the old volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._finalize_relocation_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _revert_relocation_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_volumes_revert_relocation_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_revert_relocation( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Reverts the volume relocation process, cleans up the new volume and starts using the - former-existing volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._revert_relocation_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2025-12-01", - params_added_on={ - "2025-12-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _list_quota_report_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.QuotaReportFilterRequest, _types.QuotaReportFilterRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_volumes_list_quota_report_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_models.QuotaReportFilterRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ListQuotaReportResult]: - """Get quota report for volume (with filter support). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Default value is None. - :type body: ~azure.mgmt.netapp.models.QuotaReportFilterRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_types.QuotaReportFilterRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ListQuotaReportResult]: - """Get quota report for volume (with filter support). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Default value is None. - :type body: ~azure.mgmt.netapp.types.QuotaReportFilterRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ListQuotaReportResult]: - """Get quota report for volume (with filter support). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-01", - params_added_on={ - "2025-12-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_list_quota_report( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.QuotaReportFilterRequest, _types.QuotaReportFilterRequest, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.ListQuotaReportResult]: - """Get quota report for volume (with filter support). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param body: The content of the action request. Is either a QuotaReportFilterRequest type or a - IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.netapp.models.QuotaReportFilterRequest or - ~azure.mgmt.netapp.types.QuotaReportFilterRequest or IO[bytes] - :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.ListQuotaReportResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._list_quota_report_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ListQuotaReportResult, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ListQuotaReportResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ListQuotaReportResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class SnapshotsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`snapshots` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> _models.Snapshot: - """Get details of the specified snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :return: Snapshot. The Snapshot is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - _request = build_snapshots_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Snapshot, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.Snapshot, _types.Snapshot, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_snapshots_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Create the specified snapshot within the given volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _types.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Create the specified snapshot within the given volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Create the specified snapshot within the given volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.Snapshot, _types.Snapshot, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Create the specified snapshot within the given volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Is either a Snapshot type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.Snapshot or ~azure.mgmt.netapp.types.Snapshot or - IO[bytes] - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Snapshot, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Snapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Snapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.SnapshotPatch, _types.SnapshotPatch, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_snapshots_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _models.SnapshotPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Patch a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _types.SnapshotPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Patch a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.SnapshotPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Patch a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.SnapshotPatch, _types.SnapshotPatch, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Patch a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Snapshot object supplied in the body of the operation. Is either a SnapshotPatch - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotPatch or ~azure.mgmt.netapp.types.SnapshotPatch - or IO[bytes] - :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Snapshot, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Snapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Snapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_snapshots_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Delete snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + Instead, you should access the following operations through + :class:`~azure.mgmt.netapp.NetAppManagementClient`'s + :attr:`operations` attribute. + """ - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> ItemPaged["_models.Snapshot"]: - """List all snapshots associated with the volume. + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An iterator like instance of Snapshot - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Snapshot] + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Snapshot]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_snapshots_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Snapshot], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - def _restore_files_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.SnapshotRestoreFiles, _types.SnapshotRestoreFiles, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13674,268 +3895,86 @@ def _restore_files_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_snapshots_restore_files_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _models.SnapshotRestoreFiles, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Restore the specified files from the specified snapshot to the active filesystem. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _types.SnapshotRestoreFiles, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Restore the specified files from the specified snapshot to the active filesystem. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.SnapshotRestoreFiles - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Restore the specified files from the specified snapshot to the active filesystem. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.SnapshotRestoreFiles, _types.SnapshotRestoreFiles, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Restore the specified files from the specified snapshot to the active filesystem. + def prepare_request(next_link=None): + if not next_link: - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param snapshot_name: The name of the snapshot. Required. - :type snapshot_name: str - :param body: Restore payload supplied in the body of the operation. Is either a - SnapshotRestoreFiles type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles or - ~azure.mgmt.netapp.types.SnapshotRestoreFiles or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._restore_files_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + def get_next(next_link=None): + _request = prepare_request(next_link) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + return pipeline_response -class SnapshotPoliciesOperations: # pylint: disable=docstring-missing-param + return ItemPaged(get_next, extract_data) + + +class NetAppResourceQuotaLimitsAccountOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`snapshot_policies` attribute. + :attr:`net_app_resource_quota_limits_account` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -13946,20 +3985,52 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace + @api_version_validation( + method_added_on="2025-08-01", + params_added_on={ + "2025-08-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "quota_limit_name", + "accept", + ] + }, + api_versions_list=[ + "2025-08-01", + "2025-09-01", + "2025-12-01", + "2025-12-15-preview", + "2026-01-01", + "2026-01-15-preview", + "2026-03-01", + "2026-03-15-preview", + "2026-04-01", + "2026-04-15-preview", + "2026-05-01", + "2026-05-15-preview", + "2026-06-01", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], + ) def get( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> _models.SnapshotPolicy: - """Get a snapshot Policy. + self, resource_group_name: str, account_name: str, quota_limit_name: str, **kwargs: Any + ) -> _models.QuotaItem: + """Get the default, current and usages account quota limit. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy + :param quota_limit_name: The name of the Quota Limit. Required. + :type quota_limit_name: str + :return: QuotaItem. The QuotaItem is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.QuotaItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13973,12 +4044,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SnapshotPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.QuotaItem] = kwargs.pop("cls", None) - _request = build_snapshot_policies_get_request( + _request = build_net_app_resource_quota_limits_account_get_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + quota_limit_name=quota_limit_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14013,127 +4084,172 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.SnapshotPolicy, response.json()) + deserialized = _deserialize(_models.QuotaItem, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: _models.SnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SnapshotPolicy: - """Create a snapshot policy. + @distributed_trace + @api_version_validation( + method_added_on="2025-08-01", + params_added_on={ + "2025-08-01": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] + }, + api_versions_list=[ + "2025-08-01", + "2025-09-01", + "2025-12-01", + "2025-12-15-preview", + "2026-01-01", + "2026-01-15-preview", + "2026-03-01", + "2026-03-15-preview", + "2026-04-01", + "2026-04-15-preview", + "2026-05-01", + "2026-05-15-preview", + "2026-06-01", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], + ) + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.QuotaItem"]: + """Gets a list of quota limits for all quotas that are under account. Currently PoolsPerAccount is + the only one. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy + :return: An iterator like instance of QuotaItem + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.QuotaItem] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: _types.SnapshotPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SnapshotPolicy: - """Create a snapshot policy. + cls: ClsType[List[_models.QuotaItem]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_net_app_resource_quota_limits_account_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QuotaItem], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.SnapshotPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ + return pipeline_response - @overload - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SnapshotPolicy: - """Create a snapshot policy. + return ItemPaged(get_next, extract_data) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ + +class VolumeGroupsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.netapp.NetAppManagementClient`'s + :attr:`volume_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def create( - self, - resource_group_name: str, - account_name: str, - snapshot_policy_name: str, - body: Union[_models.SnapshotPolicy, _types.SnapshotPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.SnapshotPolicy: - """Create a snapshot policy. + def get( + self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any + ) -> _models.VolumeGroupDetails: + """Get details of the specified volume group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Is either a - SnapshotPolicy type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotPolicy or ~azure.mgmt.netapp.types.SnapshotPolicy - or IO[bytes] - :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy + :param volume_group_name: The name of the volumeGroup. Required. + :type volume_group_name: str + :return: VolumeGroupDetails. The VolumeGroupDetails is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.VolumeGroupDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14144,27 +4260,17 @@ def create( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SnapshotPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.VolumeGroupDetails] = kwargs.pop("cls", None) - _request = build_snapshot_policies_create_request( + _request = build_volume_groups_get_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + volume_group_name=volume_group_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -14181,7 +4287,7 @@ def create( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -14197,19 +4303,19 @@ def create( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.SnapshotPolicy, response.json()) + deserialized = _deserialize(_models.VolumeGroupDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _update_initial( + def _create_initial( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: Union[_models.SnapshotPolicyPatch, _types.SnapshotPolicyPatch, IO[bytes]], + volume_group_name: str, + body: Union[_models.VolumeGroupDetails, _types.VolumeGroupDetails, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -14233,10 +4339,10 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_snapshot_policies_update_request( + _request = build_volume_groups_create_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + volume_group_name=volume_group_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -14257,7 +4363,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -14270,9 +4376,8 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -14282,138 +4387,138 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: _models.SnapshotPolicyPatch, + volume_group_name: str, + body: _models.VolumeGroupDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SnapshotPolicy]: - """Patch a snapshot policy. + ) -> LROPoller[_models.VolumeGroupDetails]: + """Create a volume group along with specified volumes. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotPolicyPatch + :param volume_group_name: The name of the volumeGroup. Required. + :type volume_group_name: str + :param body: Volume Group object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.VolumeGroupDetails :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] + :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: _types.SnapshotPolicyPatch, + volume_group_name: str, + body: _types.VolumeGroupDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SnapshotPolicy]: - """Patch a snapshot policy. + ) -> LROPoller[_models.VolumeGroupDetails]: + """Create a volume group along with specified volumes. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.SnapshotPolicyPatch + :param volume_group_name: The name of the volumeGroup. Required. + :type volume_group_name: str + :param body: Volume Group object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.VolumeGroupDetails :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] + :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + volume_group_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SnapshotPolicy]: - """Patch a snapshot policy. + ) -> LROPoller[_models.VolumeGroupDetails]: + """Create a volume group along with specified volumes. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Required. + :param volume_group_name: The name of the volumeGroup. Required. + :type volume_group_name: str + :param body: Volume Group object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] + :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: Union[_models.SnapshotPolicyPatch, _types.SnapshotPolicyPatch, IO[bytes]], + volume_group_name: str, + body: Union[_models.VolumeGroupDetails, _types.VolumeGroupDetails, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.SnapshotPolicy]: - """Patch a snapshot policy. + ) -> LROPoller[_models.VolumeGroupDetails]: + """Create a volume group along with specified volumes. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :param body: Snapshot policy object supplied in the body of the operation. Is either a - SnapshotPolicyPatch type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.SnapshotPolicyPatch or - ~azure.mgmt.netapp.types.SnapshotPolicyPatch or IO[bytes] - :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] + :param volume_group_name: The name of the volumeGroup. Required. + :type volume_group_name: str + :param body: Volume Group object supplied in the body of the operation. Is either a + VolumeGroupDetails type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.VolumeGroupDetails or + ~azure.mgmt.netapp.types.VolumeGroupDetails or IO[bytes] + :return: An instance of LROPoller that returns VolumeGroupDetails. The VolumeGroupDetails is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SnapshotPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.VolumeGroupDetails] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + volume_group_name=volume_group_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -14425,10 +4530,14 @@ def begin_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.SnapshotPolicy, response.json()) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.VolumeGroupDetails, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized path_format_arguments = { @@ -14444,18 +4553,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SnapshotPolicy].from_continuation_token( + return LROPoller[_models.VolumeGroupDetails].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.SnapshotPolicy]( + return LROPoller[_models.VolumeGroupDetails]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14470,10 +4579,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_snapshot_policies_delete_request( + _request = build_volume_groups_delete_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + volume_group_name=volume_group_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14518,17 +4627,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete snapshot policy. + """Delete the specified volume group only if there are no volumes under volume group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str + :param volume_group_name: The name of the volumeGroup. Required. + :type volume_group_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -14544,7 +4653,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + volume_group_name=volume_group_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -14579,22 +4688,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.SnapshotPolicy"]: - """List snapshot policy. + def list_by_net_app_account( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> ItemPaged["_models.VolumeGroup"]: + """List all volume groups for given account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :return: An iterator like instance of SnapshotPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SnapshotPolicy] + :return: An iterator like instance of VolumeGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SnapshotPolicy]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VolumeGroup]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14607,7 +4718,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_snapshot_policies_list_request( + _request = build_volume_groups_list_by_net_app_account_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -14650,7 +4761,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SnapshotPolicy], + List[_models.VolumeGroup], deserialized.get("value", []), ) if cls: @@ -14678,91 +4789,15 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - def list_volumes( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> _models.SnapshotPolicyVolumeList: - """Get volumes associated with snapshot policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy. Required. - :type snapshot_policy_name: str - :return: SnapshotPolicyVolumeList. The SnapshotPolicyVolumeList is compatible with - MutableMapping - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicyVolumeList - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SnapshotPolicyVolumeList] = kwargs.pop("cls", None) - - _request = build_snapshot_policies_list_volumes_request( - resource_group_name=resource_group_name, - account_name=account_name, - snapshot_policy_name=snapshot_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.SnapshotPolicyVolumeList, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - -class BackupPoliciesOperations: # pylint: disable=docstring-missing-param +class BackupsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`backup_policies` attribute. + :attr:`backups` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -14774,19 +4809,21 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any - ) -> _models.BackupPolicy: - """Get a particular backup Policy. + self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any + ) -> _models.Backup: + """Get the specified Backup under Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :return: BackupPolicy. The BackupPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.BackupPolicy + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :return: Backup. The Backup is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.Backup :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14800,12 +4837,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.BackupPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - _request = build_backup_policies_get_request( + _request = build_backups_get_request( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14840,7 +4878,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.BackupPolicy, response.json()) + deserialized = _deserialize(_models.Backup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -14851,8 +4889,9 @@ def _create_initial( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: Union[_models.BackupPolicy, _types.BackupPolicy, IO[bytes]], + backup_vault_name: str, + backup_name: str, + body: Union[_models.Backup, _types.Backup, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -14876,10 +4915,11 @@ def _create_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_backup_policies_create_request( + _request = build_backups_create_request( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -14900,7 +4940,7 @@ def _create_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -14919,10 +4959,6 @@ def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: @@ -14935,29 +4971,32 @@ def begin_create( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _models.BackupPolicy, + backup_vault_name: str, + backup_name: str, + body: _models.Backup, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Create a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Create a backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.BackupPolicy + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.Backup :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -14966,29 +5005,32 @@ def begin_create( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _types.BackupPolicy, + backup_vault_name: str, + backup_name: str, + body: _types.Backup, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Create a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Create a backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.BackupPolicy + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.Backup :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -14997,29 +5039,32 @@ def begin_create( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + backup_vault_name: str, + backup_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Create a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Create a backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Required. + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15028,33 +5073,35 @@ def begin_create( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: Union[_models.BackupPolicy, _types.BackupPolicy, IO[bytes]], + backup_vault_name: str, + backup_name: str, + body: Union[_models.Backup, _types.Backup, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Create a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Create a backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Is either a - BackupPolicy type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BackupPolicy or ~azure.mgmt.netapp.types.BackupPolicy or - IO[bytes] - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Is either a Backup type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.Backup or ~azure.mgmt.netapp.types.Backup or IO[bytes] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.Backup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -15062,7 +5109,8 @@ def begin_create( raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -15075,7 +5123,7 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BackupPolicy, response.json()) + deserialized = _deserialize(_models.Backup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -15093,22 +5141,23 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.BackupPolicy].from_continuation_token( + return LROPoller[_models.Backup].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.BackupPolicy]( + return LROPoller[_models.Backup]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _update_initial( self, resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: Union[_models.BackupPolicyPatch, _types.BackupPolicyPatch, IO[bytes]], + account_name: str, + backup_vault_name: str, + backup_name: str, + body: Optional[Union[_models.BackupPatch, _types.BackupPatch, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -15123,19 +5172,24 @@ def _update_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_backup_policies_update_request( + _request = build_backups_update_request( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -15170,9 +5224,7 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -15187,29 +5239,32 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _models.BackupPolicyPatch, + backup_vault_name: str, + backup_name: str, + body: Optional[_models.BackupPatch] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Patch a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Patch a Backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.BackupPolicyPatch + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Default value is None. + :type body: ~azure.mgmt.netapp.models.BackupPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15218,29 +5273,32 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _types.BackupPolicyPatch, + backup_vault_name: str, + backup_name: str, + body: Optional[_types.BackupPatch] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Patch a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Patch a Backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.BackupPolicyPatch + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Default value is None. + :type body: ~azure.mgmt.netapp.types.BackupPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15249,29 +5307,32 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: IO[bytes], + backup_vault_name: str, + backup_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Patch a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Patch a Backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Required. + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15280,33 +5341,37 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: Union[_models.BackupPolicyPatch, _types.BackupPolicyPatch, IO[bytes]], + backup_vault_name: str, + backup_name: str, + body: Optional[Union[_models.BackupPatch, _types.BackupPatch, IO[bytes]]] = None, **kwargs: Any - ) -> LROPoller[_models.BackupPolicy]: - """Patch a backup policy for Netapp Account. + ) -> LROPoller[_models.Backup]: + """Patch a Backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str - :param body: Backup policy object supplied in the body of the operation. Is either a - BackupPolicyPatch type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BackupPolicyPatch or - ~azure.mgmt.netapp.types.BackupPolicyPatch or IO[bytes] - :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. Is either a BackupPatch type + or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.BackupPatch or ~azure.mgmt.netapp.types.BackupPatch or + IO[bytes] + :return: An instance of LROPoller that returns Backup. The Backup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupPolicy] = kwargs.pop("cls", None) + content_type = content_type if body else None + cls: ClsType[_models.Backup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -15314,7 +5379,8 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -15327,7 +5393,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BackupPolicy, response.json()) + deserialized = _deserialize(_models.Backup, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -15345,18 +5411,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.BackupPolicy].from_continuation_token( + return LROPoller[_models.Backup].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.BackupPolicy]( + return LROPoller[_models.Backup]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15371,10 +5437,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_backup_policies_delete_request( + _request = build_backups_delete_request( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15393,7 +5460,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -15419,17 +5486,19 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete backup policy. + """Delete a Backup under the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. - :type backup_policy_name: str + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param backup_name: The name of the backup. Required. + :type backup_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -15445,7 +5514,8 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + backup_vault_name=backup_vault_name, + backup_name=backup_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -15480,22 +5550,35 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.BackupPolicy"]: - """List backup policies for Netapp Account. + def list_by_vault( + self, + resource_group_name: str, + account_name: str, + backup_vault_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.Backup"]: + """List all backups Under a Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :return: An iterator like instance of BackupPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupPolicy] + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :keyword filter: An option to specify the VolumeResourceId. If present, then only returns the + backups under the specified volume. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Backup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Backup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.BackupPolicy]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Backup]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15508,10 +5591,12 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_backup_policies_list_request( + _request = build_backups_list_by_vault_request( resource_group_name=resource_group_name, account_name=account_name, + backup_vault_name=backup_vault_name, subscription_id=self._config.subscription_id, + filter=filter, api_version=self._config.api_version, headers=_headers, params=_params, @@ -15551,7 +5636,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.BackupPolicy], + List[_models.Backup], deserialized.get("value", []), ) if cls: @@ -15579,35 +5664,11 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class VolumeQuotaRulesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`volume_quota_rules` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - **kwargs: Any - ) -> _models.VolumeQuotaRule: - """Get details of the specified quota rule. + def get_latest_status( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> _models.BackupStatus: + """Get the latest status of the backup for a volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -15618,10 +5679,8 @@ def get( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :return: VolumeQuotaRule. The VolumeQuotaRule is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.VolumeQuotaRule + :return: BackupStatus. The BackupStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.BackupStatus :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -15635,14 +5694,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VolumeQuotaRule] = kwargs.pop("cls", None) + cls: ClsType[_models.BackupStatus] = kwargs.pop("cls", None) - _request = build_volume_quota_rules_get_request( + _request = build_backups_get_latest_status_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15677,23 +5735,32 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VolumeQuotaRule, response.json()) + deserialized = _deserialize(_models.BackupStatus, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: Union[_models.VolumeQuotaRule, _types.VolumeQuotaRule, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + def get_volume_latest_restore_status( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> _models.RestoreStatus: + """Get the latest status of the restore for a volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: RestoreStatus. The RestoreStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.RestoreStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -15702,29 +5769,18 @@ def _create_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RestoreStatus] = kwargs.pop("cls", None) - _request = build_volume_quota_rules_create_request( + _request = build_backups_get_volume_latest_restore_status_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -15734,18 +5790,19 @@ def _create_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -15753,141 +5810,39 @@ def _create_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestoreStatus, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: _models.VolumeQuotaRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Create the specified quota rule within the given volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.VolumeQuotaRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: _types.VolumeQuotaRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Create the specified quota rule within the given volume. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.VolumeQuotaRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ +class VolumesOperations: # pylint: disable=docstring-missing-param,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Create the specified quota rule within the given volume. + Instead, you should access the following operations through + :class:`~azure.mgmt.netapp.NetAppManagementClient`'s + :attr:`volumes` attribute. + """ - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - volume_quota_rule_name: str, - body: Union[_models.VolumeQuotaRule, _types.VolumeQuotaRule, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Create the specified quota rule within the given volume. + def get( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> _models.Volume: + """Get the details of the specified volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -15898,80 +5853,76 @@ def begin_create( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Is either a - VolumeQuotaRule type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.VolumeQuotaRule or - ~azure.mgmt.netapp.types.VolumeQuotaRule or IO[bytes] - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :return: Volume. The Volume is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.Volume :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VolumeQuotaRule] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + cls: ClsType[_models.Volume] = kwargs.pop("cls", None) + + _request = build_volumes_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.VolumeQuotaRule, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Volume, response.json()) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.VolumeQuotaRule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.VolumeQuotaRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return deserialized # type: ignore - def _update_initial( + def _create_or_update_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, - body: Union[_models.VolumeQuotaRulePatch, _types.VolumeQuotaRulePatch, IO[bytes]], + body: Union[_models.Volume, _types.Volume, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -15995,12 +5946,11 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_volume_quota_rules_update_request( + _request = build_volumes_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -16021,7 +5971,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -16034,6 +5984,12 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -16046,19 +6002,18 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, - body: _models.VolumeQuotaRulePatch, + body: _models.Volume, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Patch a quota rule. + ) -> LROPoller[_models.Volume]: + """Create or update the specified volume within the capacity pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16069,33 +6024,30 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.VolumeQuotaRulePatch + :param body: Volume object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.Volume :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, - body: _types.VolumeQuotaRulePatch, + body: _types.Volume, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Patch a quota rule. + ) -> LROPoller[_models.Volume]: + """Create or update the specified volume within the capacity pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16106,33 +6058,30 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.VolumeQuotaRulePatch + :param body: Volume object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.Volume :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Patch a quota rule. + ) -> LROPoller[_models.Volume]: + """Create or update the specified volume within the capacity pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16143,31 +6092,28 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Required. + :param body: Volume object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, - body: Union[_models.VolumeQuotaRulePatch, _types.VolumeQuotaRulePatch, IO[bytes]], + body: Union[_models.Volume, _types.Volume, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.VolumeQuotaRule]: - """Patch a quota rule. + ) -> LROPoller[_models.Volume]: + """Create or update the specified volume within the capacity pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16178,32 +6124,28 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :param body: Quota rule object supplied in the body of the operation. Is either a - VolumeQuotaRulePatch type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.VolumeQuotaRulePatch or - ~azure.mgmt.netapp.types.VolumeQuotaRulePatch or IO[bytes] - :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :param body: Volume object supplied in the body of the operation. Is either a Volume type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.Volume or ~azure.mgmt.netapp.types.Volume or IO[bytes] + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VolumeQuotaRule] = kwargs.pop("cls", None) + cls: ClsType[_models.Volume] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -16216,7 +6158,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.VolumeQuotaRule, response.json()) + deserialized = _deserialize(_models.Volume, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -16234,23 +6176,23 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.VolumeQuotaRule].from_continuation_token( + return LROPoller[_models.Volume].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.VolumeQuotaRule]( + return LROPoller[_models.Volume]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( + def _update_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, + body: Union[_models.VolumePatch, _types.VolumePatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -16261,19 +6203,28 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_volume_quota_rules_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_volumes_update_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -16290,7 +6241,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -16314,17 +6265,119 @@ def _delete_initial( return deserialized # type: ignore + @overload + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: _models.VolumePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Volume]: + """Patch the specified volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Volume object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.VolumePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: _types.VolumePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Volume]: + """Patch the specified volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Volume object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.VolumePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Volume]: + """Patch the specified volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Volume object supplied in the body of the operation. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def begin_delete( + def begin_update( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - volume_quota_rule_name: str, + body: Union[_models.VolumePatch, _types.VolumePatch, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Delete quota rule. + ) -> LROPoller[_models.Volume]: + """Patch the specified volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16335,26 +6388,31 @@ def begin_delete( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param volume_quota_rule_name: The name of volume quota rule. Required. - :type volume_quota_rule_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param body: Volume object supplied in the body of the operation. Is either a VolumePatch type + or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.VolumePatch or ~azure.mgmt.netapp.types.VolumePatch or + IO[bytes] + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Volume] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - volume_quota_rule_name=volume_quota_rule_name, + body=body, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -16363,9 +6421,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Volume, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -16380,200 +6441,26 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.Volume].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_volume( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> ItemPaged["_models.VolumeQuotaRule"]: - """List all quota rules associated with the volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An iterator like instance of VolumeQuotaRule - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeQuotaRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.VolumeQuotaRule]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_volume_quota_rules_list_by_volume_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VolumeQuotaRule], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RansomwareReportsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`ransomware_reports` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return LROPoller[_models.Volume]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @distributed_trace - @api_version_validation( - method_added_on="2025-12-01", - params_added_on={ - "2025-12-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "ransomware_report_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def get( + def _delete_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, + *, + force_delete: Optional[bool] = None, **kwargs: Any - ) -> _models.RansomwareReport: - """Get details of the specified ransomware report (ARP) ARP reports are created with a list of - suspected files when it detects any combination of high data entropy, abnormal volume activity - with data encryption, and unusual file extensions. ARP creates snapshots named - Anti_ransomware_backup when it detects a potential ransomware threat. You can use one of these - ARP snapshots or another snapshot of your volume to restore data. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param ransomware_report_name: The name of the ransomware report. Required. - :type ransomware_report_name: str - :return: RansomwareReport. The RansomwareReport is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.RansomwareReport - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -16585,15 +6472,15 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RansomwareReport] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_ransomware_reports_get_request( + _request = build_volumes_delete_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - ransomware_report_name=ransomware_report_name, subscription_id=self._config.subscription_id, + force_delete=force_delete, api_version=self._config.api_version, headers=_headers, params=_params, @@ -16604,19 +6491,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -16624,54 +6510,30 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RansomwareReport, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-01", - params_added_on={ - "2025-12-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def list( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> ItemPaged["_models.RansomwareReport"]: - """List all ransomware reports for the volume Returns a list of the Advanced Ransomware Protection - (ARP) reports for the volume. ARP reports are created with a list of suspected files when it - detects any combination of high data entropy, abnormal volume activity with data encryption, - and unusual file extensions. ARP creates snapshots named Anti_ransomware_backup when it detects - a potential ransomware threat. You can use one of these ARP snapshots or another snapshot of - your volume to restore data". + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete the specified volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16682,14 +6544,81 @@ def list( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :return: An iterator like instance of RansomwareReport - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.RansomwareReport] + :keyword force_delete: An option to force delete the volume. Will cleanup resources connected + to the particular volume. Default value is None. + :paramtype force_delete: bool + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RansomwareReport]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + force_delete=force_delete, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.Volume"]: + """List all volumes within the capacity pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :return: An iterator like instance of Volume + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Volume] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Volume]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16702,11 +6631,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_ransomware_reports_list_request( + _request = build_volumes_list_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - volume_name=volume_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16747,7 +6675,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RansomwareReport], + List[_models.Volume], deserialized.get("value", []), ) if cls: @@ -16773,45 +6701,149 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged(get_next, extract_data) + return ItemPaged(get_next, extract_data) + + def _populate_availability_zone_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_volumes_populate_availability_zone_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_populate_availability_zone( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[_models.Volume]: + """This operation will populate availability zone information for a volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Volume] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._populate_availability_zone_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Volume, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Volume].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Volume]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2025-12-01", - params_added_on={ - "2025-12-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "ransomware_report_name", - "content_type", - ] - }, - api_versions_list=[ - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _clear_suspects_initial( + def _revert_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, - body: Union[_models.RansomwareSuspectsClearRequest, _types.RansomwareSuspectsClearRequest, IO[bytes]], + body: Union[_models.VolumeRevert, _types.VolumeRevert, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -16835,12 +6867,11 @@ def _clear_suspects_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_ransomware_reports_clear_suspects_request( + _request = build_volumes_revert_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - ransomware_report_name=ransomware_report_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -16861,7 +6892,7 @@ def _clear_suspects_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -16874,8 +6905,9 @@ def _clear_suspects_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -16885,23 +6917,18 @@ def _clear_suspects_initial( return deserialized # type: ignore @overload - def begin_clear_suspects( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, - body: _models.RansomwareSuspectsClearRequest, + body: _models.VolumeRevert, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should - evaluate the report to determine whether the activity is acceptable (false positive) or whether - an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a - potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your - volume to restore data",. + """Revert a volume to the snapshot specified in the body. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16912,10 +6939,8 @@ def begin_clear_suspects( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param ransomware_report_name: The name of the ransomware report. Required. - :type ransomware_report_name: str - :param body: Clear suspects request object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.RansomwareSuspectsClearRequest + :param body: Object for snapshot to revert supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.VolumeRevert :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16925,23 +6950,18 @@ def begin_clear_suspects( """ @overload - def begin_clear_suspects( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, - body: _types.RansomwareSuspectsClearRequest, + body: _types.VolumeRevert, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should - evaluate the report to determine whether the activity is acceptable (false positive) or whether - an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a - potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your - volume to restore data",. + """Revert a volume to the snapshot specified in the body. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16952,10 +6972,8 @@ def begin_clear_suspects( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param ransomware_report_name: The name of the ransomware report. Required. - :type ransomware_report_name: str - :param body: Clear suspects request object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.RansomwareSuspectsClearRequest + :param body: Object for snapshot to revert supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.VolumeRevert :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16965,23 +6983,18 @@ def begin_clear_suspects( """ @overload - def begin_clear_suspects( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should - evaluate the report to determine whether the activity is acceptable (false positive) or whether - an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a - potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your - volume to restore data",. + """Revert a volume to the snapshot specified in the body. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -16992,9 +7005,7 @@ def begin_clear_suspects( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param ransomware_report_name: The name of the ransomware report. Required. - :type ransomware_report_name: str - :param body: Clear suspects request object supplied in the body of the operation. Required. + :param body: Object for snapshot to revert supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -17005,50 +7016,150 @@ def begin_clear_suspects( """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-01", - params_added_on={ - "2025-12-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "ransomware_report_name", - "content_type", - ] - }, - api_versions_list=[ - "2025-12-01", - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_clear_suspects( + def begin_revert( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - ransomware_report_name: str, - body: Union[_models.RansomwareSuspectsClearRequest, _types.RansomwareSuspectsClearRequest, IO[bytes]], + body: Union[_models.VolumeRevert, _types.VolumeRevert, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: - """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should - evaluate the report to determine whether the activity is acceptable (false positive) or whether - an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a - potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your - volume to restore data",. + """Revert a volume to the snapshot specified in the body. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Object for snapshot to revert supplied in the body of the operation. Is either a + VolumeRevert type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.VolumeRevert or ~azure.mgmt.netapp.types.VolumeRevert or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._revert_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_cifs_password_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_volumes_reset_cifs_password_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reset_cifs_password( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Reset cifs password from volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -17059,33 +7170,23 @@ def begin_clear_suspects( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param ransomware_report_name: The name of the ransomware report. Required. - :type ransomware_report_name: str - :param body: Clear suspects request object supplied in the body of the operation. Is either a - RansomwareSuspectsClearRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.RansomwareSuspectsClearRequest or - ~azure.mgmt.netapp.types.RansomwareSuspectsClearRequest or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._clear_suspects_initial( + raw_result = self._reset_cifs_password_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - ransomware_report_name=ransomware_report_name, - body=body, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -17119,41 +7220,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class BackupVaultsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`backup_vaults` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> _models.BackupVault: - """Get the Backup Vault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :return: BackupVault. The BackupVault is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.BackupVault - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _split_clone_from_parent_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -17165,12 +7234,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.BackupVault] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_backup_vaults_get_request( + _request = build_volumes_split_clone_from_parent_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -17182,19 +7252,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -17202,22 +7271,96 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BackupVault, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( + @distributed_trace + def begin_split_clone_from_parent( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[_models.Volume]: + """Split operation to convert clone volume to an independent volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns Volume. The Volume is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Volume] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._split_clone_from_parent_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Volume, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Volume].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Volume]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _break_file_locks_initial( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.BackupVault, _types.BackupVault, IO[bytes]], + pool_name: str, + volume_name: str, + body: Optional[Union[_models.BreakFileLocksRequest, _types.BreakFileLocksRequest, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -17232,19 +7375,24 @@ def _create_or_update_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_backup_vaults_create_or_update_request( + _request = build_volumes_break_file_locks_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -17265,7 +7413,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -17278,10 +7426,8 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -17292,138 +7438,151 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _models.BackupVault, + pool_name: str, + volume_name: str, + body: Optional[_models.BreakFileLocksRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Create or update the specified Backup Vault in the NetApp account. + ) -> LROPoller[None]: + """Break all the file locks on a volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: BackupVault object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.BackupVault + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to provide the ability to clear file locks with selected options. + Default value is None. + :type body: ~azure.mgmt.netapp.models.BreakFileLocksRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _types.BackupVault, + pool_name: str, + volume_name: str, + body: Optional[_types.BreakFileLocksRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Create or update the specified Backup Vault in the NetApp account. + ) -> LROPoller[None]: + """Break all the file locks on a volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: BackupVault object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.BackupVault + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to provide the ability to clear file locks with selected options. + Default value is None. + :type body: ~azure.mgmt.netapp.types.BreakFileLocksRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: IO[bytes], + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Create or update the specified Backup Vault in the NetApp account. + ) -> LROPoller[None]: + """Break all the file locks on a volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: BackupVault object supplied in the body of the operation. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to provide the ability to clear file locks with selected options. + Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_break_file_locks( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.BackupVault, _types.BackupVault, IO[bytes]], + pool_name: str, + volume_name: str, + body: Optional[Union[_models.BreakFileLocksRequest, _types.BreakFileLocksRequest, IO[bytes]]] = None, **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Create or update the specified Backup Vault in the NetApp account. + ) -> LROPoller[None]: + """Break all the file locks on a volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: BackupVault object supplied in the body of the operation. Is either a BackupVault - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BackupVault or ~azure.mgmt.netapp.types.BackupVault or - IO[bytes] - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to provide the ability to clear file locks with selected options. Is + either a BreakFileLocksRequest type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.BreakFileLocksRequest or + ~azure.mgmt.netapp.types.BreakFileLocksRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupVault] = kwargs.pop("cls", None) + content_type = content_type if body else None + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._break_file_locks_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -17434,12 +7593,9 @@ def begin_create_or_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BackupVault, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -17454,22 +7610,55 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.BackupVault].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.BackupVault]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _update_initial( + @api_version_validation( + method_added_on="2025-08-01", + params_added_on={ + "2025-08-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "pool_name", + "volume_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-08-01", + "2025-09-01", + "2025-12-01", + "2025-12-15-preview", + "2026-01-01", + "2026-01-15-preview", + "2026-03-01", + "2026-03-15-preview", + "2026-04-01", + "2026-04-15-preview", + "2026-05-01", + "2026-05-15-preview", + "2026-06-01", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], + ) + def _list_get_group_id_list_for_ldap_user_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.BackupVaultPatch, _types.BackupVaultPatch, IO[bytes]], + pool_name: str, + volume_name: str, + body: Union[_models.GetGroupIdListForLDAPUserRequest, _types.GetGroupIdListForLDAPUserRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -17493,10 +7682,11 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_backup_vaults_update_request( + _request = build_volumes_list_get_group_id_list_for_ldap_user_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -17531,6 +7721,9 @@ def _update_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -17542,138 +7735,189 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _models.BackupVaultPatch, + pool_name: str, + volume_name: str, + body: _models.GetGroupIdListForLDAPUserRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Patch the specified NetApp Backup Vault. + ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: + """Returns the list of group Ids for a specific LDAP User. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: Backup Vault object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.BackupVaultPatch + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Returns group Id list for a specific LDAP user. Required. + :type body: ~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The + GetGroupIdListForLDAPUserResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _types.BackupVaultPatch, + pool_name: str, + volume_name: str, + body: _types.GetGroupIdListForLDAPUserRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Patch the specified NetApp Backup Vault. + ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: + """Returns the list of group Ids for a specific LDAP User. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: Backup Vault object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.BackupVaultPatch + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Returns group Id list for a specific LDAP user. Required. + :type body: ~azure.mgmt.netapp.types.GetGroupIdListForLDAPUserRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The + GetGroupIdListForLDAPUserResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, - backup_vault_name: str, + pool_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Patch the specified NetApp Backup Vault. + ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: + """Returns the list of group Ids for a specific LDAP User. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: Backup Vault object supplied in the body of the operation. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Returns group Id list for a specific LDAP user. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The + GetGroupIdListForLDAPUserResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + @api_version_validation( + method_added_on="2025-08-01", + params_added_on={ + "2025-08-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "pool_name", + "volume_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-08-01", + "2025-09-01", + "2025-12-01", + "2025-12-15-preview", + "2026-01-01", + "2026-01-15-preview", + "2026-03-01", + "2026-03-15-preview", + "2026-04-01", + "2026-04-15-preview", + "2026-05-01", + "2026-05-15-preview", + "2026-06-01", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], + ) + def begin_list_get_group_id_list_for_ldap_user( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.BackupVaultPatch, _types.BackupVaultPatch, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BackupVault]: - """Patch the specified NetApp Backup Vault. + pool_name: str, + volume_name: str, + body: Union[_models.GetGroupIdListForLDAPUserRequest, _types.GetGroupIdListForLDAPUserRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GetGroupIdListForLDAPUserResponse]: + """Returns the list of group Ids for a specific LDAP User. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str - :param body: Backup Vault object supplied in the body of the operation. Is either a - BackupVaultPatch type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BackupVaultPatch or - ~azure.mgmt.netapp.types.BackupVaultPatch or IO[bytes] - :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Returns group Id list for a specific LDAP user. Is either a + GetGroupIdListForLDAPUserRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserRequest or + ~azure.mgmt.netapp.types.GetGroupIdListForLDAPUserRequest or IO[bytes] + :return: An instance of LROPoller that returns GetGroupIdListForLDAPUserResponse. The + GetGroupIdListForLDAPUserResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.GetGroupIdListForLDAPUserResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupVault] = kwargs.pop("cls", None) + cls: ClsType[_models.GetGroupIdListForLDAPUserResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._list_get_group_id_list_for_ldap_user_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -17686,7 +7930,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BackupVault, response.json()) + deserialized = _deserialize(_models.GetGroupIdListForLDAPUserResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -17704,18 +7948,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.BackupVault].from_continuation_token( + return LROPoller[_models.GetGroupIdListForLDAPUserResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.BackupVault]( + return LROPoller[_models.GetGroupIdListForLDAPUserResponse]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any + def _break_replication_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[Union[_models.BreakReplicationRequest, _types.BreakReplicationRequest, IO[bytes]]] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17725,17 +7975,32 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_backup_vaults_delete_request( + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_volumes_break_replication_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -17752,7 +8017,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -17776,228 +8041,116 @@ def _delete_initial( return deserialized # type: ignore - @distributed_trace - def begin_delete( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any + @overload + def begin_break_replication( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_models.BreakReplicationRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[None]: - """Delete the specified Backup Vault. + """Break the replication connection on the destination volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the Backup Vault. Required. - :type backup_vault_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to force break the replication. Default value is None. + :type body: ~azure.mgmt.netapp.models.BreakReplicationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_vault_name=backup_vault_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace - def list_by_net_app_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.BackupVault"]: - """List and describe all Backup Vaults in the NetApp account. + @overload + def begin_break_replication( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_types.BreakReplicationRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Break the replication connection on the destination volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of the NetApp account. Required. - :type account_name: str - :return: An iterator like instance of BackupVault - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.BackupVault]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_backup_vaults_list_by_net_app_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.BackupVault], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class BucketsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to force break the replication. Default value is None. + :type body: ~azure.mgmt.netapp.types.BreakReplicationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`buckets` attribute. - """ + @overload + def begin_break_replication( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Break the replication connection on the destination volume. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to force break the replication. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def get( + def begin_break_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, + body: Optional[Union[_models.BreakReplicationRequest, _types.BreakReplicationRequest, IO[bytes]]] = None, **kwargs: Any - ) -> _models.Bucket: - """Get the details of the specified volume's bucket. A bucket allows additional services, such as - AI services, connect to the volume data contained in those buckets. + ) -> LROPoller[None]: + """Break the replication connection on the destination volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18008,109 +8161,71 @@ def get( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :return: Bucket. The Bucket is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.Bucket + :param body: Optional body to force break the replication. Is either a BreakReplicationRequest + type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.BreakReplicationRequest or + ~azure.mgmt.netapp.types.BreakReplicationRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Bucket] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._break_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - _request = build_buckets_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - bucket_name=bucket_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.Bucket, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( + def _reestablish_replication_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Union[_models.Bucket, _types.Bucket, IO[bytes]], + body: Union[_models.ReestablishReplicationRequest, _types.ReestablishReplicationRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -18134,12 +8249,11 @@ def _create_or_update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_buckets_create_or_update_request( + _request = build_volumes_reestablish_replication_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -18160,7 +8274,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -18173,11 +8287,8 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -18187,20 +8298,19 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _models.Bucket, + body: _models.ReestablishReplicationRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI - services, connect to the volume data contained in those buckets. + ) -> LROPoller[None]: + """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or + policy-based snapshots. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18209,37 +8319,32 @@ def begin_create_or_update( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Required. - :type body: ~azure.mgmt.netapp.models.Bucket + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: body for the id of the source volume. Required. + :type body: ~azure.mgmt.netapp.models.ReestablishReplicationRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _types.Bucket, + body: _types.ReestablishReplicationRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI - services, connect to the volume data contained in those buckets. + ) -> LROPoller[None]: + """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or + policy-based snapshots. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18250,35 +8355,30 @@ def begin_create_or_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Required. - :type body: ~azure.mgmt.netapp.types.Bucket + :param body: body for the id of the source volume. Required. + :type body: ~azure.mgmt.netapp.types.ReestablishReplicationRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI - services, connect to the volume data contained in those buckets. + ) -> LROPoller[None]: + """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or + policy-based snapshots. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18289,62 +8389,28 @@ def begin_create_or_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Required. + :param body: body for the id of the source volume. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_create_or_update( + def begin_reestablish_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Union[_models.Bucket, _types.Bucket, IO[bytes]], + body: Union[_models.ReestablishReplicationRequest, _types.ReestablishReplicationRequest, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI - services, connect to the volume data contained in those buckets. + ) -> LROPoller[None]: + """Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or + policy-based snapshots. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18355,31 +8421,28 @@ def begin_create_or_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Is either a Bucket type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.Bucket or ~azure.mgmt.netapp.types.Bucket or IO[bytes] - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :param body: body for the id of the source volume. Is either a ReestablishReplicationRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.ReestablishReplicationRequest or + ~azure.mgmt.netapp.types.ReestablishReplicationRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Bucket] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._reestablish_replication_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -18390,12 +8453,9 @@ def begin_create_or_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Bucket, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -18410,55 +8470,33 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Bucket].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Bucket]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - body: Union[_models.BucketPatch, _types.BucketPatch, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + def replication_status( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> _models.ReplicationStatus: + """Get the status of the replication. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: ReplicationStatus. The ReplicationStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.ReplicationStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -18467,29 +8505,18 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.ReplicationStatus] = kwargs.pop("cls", None) - _request = build_buckets_update_request( + _request = build_volumes_replication_status_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -18499,18 +8526,19 @@ def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -18518,35 +8546,62 @@ def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ReplicationStatus, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_update( + def list_replications( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_models.ListReplicationsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.Replication"]: + """List all replications for a specified volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.netapp.models.ListReplicationsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of Replication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _models.BucketPatch, + body: Optional[_types.ListReplicationsRequest] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Updates the details of a volume bucket. + ) -> ItemPaged["_models.Replication"]: + """List all replications for a specified volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18557,34 +8612,29 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Required. - :type body: ~azure.mgmt.netapp.models.BucketPatch + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.netapp.types.ListReplicationsRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :return: An iterator like instance of Replication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _types.BucketPatch, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Updates the details of a volume bucket. + ) -> ItemPaged["_models.Replication"]: + """List all replications for a specified volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18595,34 +8645,61 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Required. - :type body: ~azure.mgmt.netapp.types.BucketPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :return: An iterator like instance of Replication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ - @overload - def begin_update( + @distributed_trace + @api_version_validation( + method_added_on="2025-08-01", + params_added_on={ + "2025-08-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "pool_name", + "volume_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-08-01", + "2025-09-01", + "2025-12-01", + "2025-12-15-preview", + "2026-01-01", + "2026-01-15-preview", + "2026-03-01", + "2026-03-15-preview", + "2026-04-01", + "2026-04-15-preview", + "2026-05-01", + "2026-05-15-preview", + "2026-06-01", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], + ) + def list_replications( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", + body: Optional[Union[_models.ListReplicationsRequest, _types.ListReplicationsRequest, IO[bytes]]] = None, **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Updates the details of a volume bucket. + ) -> ItemPaged["_models.Replication"]: + """List all replications for a specified volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18633,61 +8710,185 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :param body: The content of the action request. Is either a ListReplicationsRequest type or a + IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.ListReplicationsRequest or + ~azure.mgmt.netapp.types.ListReplicationsRequest or IO[bytes] + :return: An iterator like instance of Replication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[List[_models.Replication]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + def prepare_request(next_link=None): + if not next_link: + + _request = build_volumes_list_replications_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Replication], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _resync_replication_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_volumes_resync_replication_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - body: Union[_models.BucketPatch, _types.BucketPatch, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Bucket]: - """Updates the details of a volume bucket. + def begin_resync_replication( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Resync the connection on the destination volume. If the operation is ran on the source volume + it will reverse-resync the connection and sync from destination to source. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18698,34 +8899,23 @@ def begin_update( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket details including user details, and the volume path that should be - mounted inside the bucket. Is either a BucketPatch type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BucketPatch or ~azure.mgmt.netapp.types.BucketPatch or - IO[bytes] - :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Bucket] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._resync_replication_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, - body=body, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -18734,12 +8924,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Bucket, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -18754,51 +8941,16 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Bucket].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Bucket]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _delete_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - **kwargs: Any + def _delete_replication_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -18813,12 +8965,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_buckets_delete_request( + _request = build_volumes_delete_replication_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -18837,7 +8988,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -18851,9 +9002,6 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -18865,43 +9013,11 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - **kwargs: Any + def begin_delete_replication( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a volume's bucket. + """Delete the replication connection on the destination volume, and send release to the source + replication. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -18912,8 +9028,6 @@ def begin_delete( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -18926,12 +9040,11 @@ def begin_delete( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._delete_replication_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -18944,79 +9057,36 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) # type: ignore - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def list( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> ItemPaged["_models.Bucket"]: - """Describes all buckets belonging to a volume. Buckets allow additional services, such as AI - services, connect to the volume data contained in those buckets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param volume_name: The name of the volume. Required. - :type volume_name: str - :return: An iterator like instance of Bucket - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Bucket] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Bucket]] = kwargs.pop("cls", None) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + def _authorize_replication_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Union[_models.AuthorizeRequest, _types.AuthorizeRequest, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -19025,97 +9095,81 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_buckets_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_volumes_authorize_replication_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Bucket], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @overload - def generate_credentials( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _models.BucketCredentialsExpiry, + body: _models.AuthorizeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.BucketGenerateCredentials: - """Generate the access key and secret key used for accessing the specified volume bucket. Also - return expiry date and time of key pair (in UTC). + ) -> LROPoller[None]: + """Authorize the replication connection on the source volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19126,35 +9180,29 @@ def generate_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket's Access and Secret key pair expiry time expressed as the number of - days from now. Required. - :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry + :param body: Authorize request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.AuthorizeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with - MutableMapping - :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def generate_credentials( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _types.BucketCredentialsExpiry, + body: _types.AuthorizeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.BucketGenerateCredentials: - """Generate the access key and secret key used for accessing the specified volume bucket. Also - return expiry date and time of key pair (in UTC). + ) -> LROPoller[None]: + """Authorize the replication connection on the source volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19165,35 +9213,29 @@ def generate_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket's Access and Secret key pair expiry time expressed as the number of - days from now. Required. - :type body: ~azure.mgmt.netapp.types.BucketCredentialsExpiry + :param body: Authorize request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.AuthorizeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with - MutableMapping - :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def generate_credentials( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.BucketGenerateCredentials: - """Generate the access key and secret key used for accessing the specified volume bucket. Also - return expiry date and time of key pair (in UTC). + ) -> LROPoller[None]: + """Authorize the replication connection on the source volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19204,62 +9246,27 @@ def generate_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket's Access and Secret key pair expiry time expressed as the number of - days from now. Required. + :param body: Authorize request object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with - MutableMapping - :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def generate_credentials( + def begin_authorize_replication( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Union[_models.BucketCredentialsExpiry, _types.BucketCredentialsExpiry, IO[bytes]], + body: Union[_models.AuthorizeRequest, _types.AuthorizeRequest, IO[bytes]], **kwargs: Any - ) -> _models.BucketGenerateCredentials: - """Generate the access key and secret key used for accessing the specified volume bucket. Also - return expiry date and time of key pair (in UTC). + ) -> LROPoller[None]: + """Authorize the replication connection on the source volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19270,17 +9277,66 @@ def generate_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The bucket's Access and Secret key pair expiry time expressed as the number of - days from now. Is either a BucketCredentialsExpiry type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry or - ~azure.mgmt.netapp.types.BucketCredentialsExpiry or IO[bytes] - :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with - MutableMapping - :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials + :param body: Authorize request object supplied in the body of the operation. Is either a + AuthorizeRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.AuthorizeRequest or + ~azure.mgmt.netapp.types.AuthorizeRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._authorize_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _re_initialize_replication_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -19289,29 +9345,18 @@ def generate_credentials( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BucketGenerateCredentials] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_buckets_generate_credentials_request( + _request = build_volumes_re_initialize_replication_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -19321,19 +9366,18 @@ def generate_credentials( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -19341,52 +9385,92 @@ def generate_credentials( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BucketGenerateCredentials, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _generate_akv_credentials_initial( + @distributed_trace + def begin_re_initialize_replication( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Re-Initializes the replication connection on the destination volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._re_initialize_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _peer_external_cluster_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Union[_models.BucketCredentialsExpiry, _types.BucketCredentialsExpiry, IO[bytes]], + body: Union[ + _models.PeerClusterForVolumeMigrationRequest, _types.PeerClusterForVolumeMigrationRequest, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -19410,12 +9494,11 @@ def _generate_akv_credentials_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_buckets_generate_akv_credentials_request( + _request = build_volumes_peer_external_cluster_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -19436,7 +9519,7 @@ def _generate_akv_credentials_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -19449,11 +9532,12 @@ def _generate_akv_credentials_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -19463,20 +9547,18 @@ def _generate_akv_credentials_initial( return deserialized # type: ignore @overload - def begin_generate_akv_credentials( + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _models.BucketCredentialsExpiry, + body: _models.PeerClusterForVolumeMigrationRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Generate the access key and secret key used for accessing the specified volume bucket and store - in Azure Key Vault. + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Starts peering the external cluster for this migration volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19487,33 +9569,30 @@ def begin_generate_akv_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry + :param body: Cluster peer request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The + ClusterPeerCommandResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_generate_akv_credentials( + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: _types.BucketCredentialsExpiry, + body: _types.PeerClusterForVolumeMigrationRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Generate the access key and secret key used for accessing the specified volume bucket and store - in Azure Key Vault. + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Starts peering the external cluster for this migration volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19524,33 +9603,30 @@ def begin_generate_akv_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.BucketCredentialsExpiry + :param body: Cluster peer request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.PeerClusterForVolumeMigrationRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :paramtype content_type: str + :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The + ClusterPeerCommandResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_generate_akv_credentials( + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Generate the access key and secret key used for accessing the specified volume bucket and store - in Azure Key Vault. + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Starts peering the external cluster for this migration volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19561,59 +9637,30 @@ def begin_generate_akv_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The content of the action request. Required. + :param body: Cluster peer request object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The + ClusterPeerCommandResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - "content_type", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_generate_akv_credentials( + def begin_peer_external_cluster( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - bucket_name: str, - body: Union[_models.BucketCredentialsExpiry, _types.BucketCredentialsExpiry, IO[bytes]], + body: Union[ + _models.PeerClusterForVolumeMigrationRequest, _types.PeerClusterForVolumeMigrationRequest, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[None]: - """Generate the access key and secret key used for accessing the specified volume bucket and store - in Azure Key Vault. + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Starts peering the external cluster for this migration volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19624,31 +9671,29 @@ def begin_generate_akv_credentials( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str - :param body: The content of the action request. Is either a BucketCredentialsExpiry type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry or - ~azure.mgmt.netapp.types.BucketCredentialsExpiry or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param body: Cluster peer request object supplied in the body of the operation. Is either a + PeerClusterForVolumeMigrationRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest or + ~azure.mgmt.netapp.types.PeerClusterForVolumeMigrationRequest or IO[bytes] + :return: An instance of LROPoller that returns ClusterPeerCommandResponse. The + ClusterPeerCommandResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterPeerCommandResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._generate_akv_credentials_initial( + raw_result = self._peer_external_cluster_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -19659,9 +9704,19 @@ def begin_generate_akv_credentials( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ClusterPeerCommandResponse, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -19676,49 +9731,163 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.ClusterPeerCommandResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.ClusterPeerCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _refresh_certificate_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - **kwargs: Any + def _authorize_external_replication_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_volumes_authorize_external_replication_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_authorize_external_replication( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[_models.SvmPeerCommandResponse]: + """Starts SVM peering and returns a command to be run on the external ONTAP to accept it. Once + the SVM have been peered a SnapMirror will be created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns SvmPeerCommandResponse. The + SvmPeerCommandResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SvmPeerCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SvmPeerCommandResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._authorize_external_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.SvmPeerCommandResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SvmPeerCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SvmPeerCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _finalize_external_replication_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -19733,12 +9902,11 @@ def _refresh_certificate_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_buckets_refresh_certificate_request( + _request = build_volumes_finalize_external_replication_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -19770,9 +9938,6 @@ def _refresh_certificate_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -19784,44 +9949,11 @@ def _refresh_certificate_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "bucket_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_refresh_certificate( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - bucket_name: str, - **kwargs: Any + def begin_finalize_external_replication( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> LROPoller[None]: - """This operation will fetch the certificate from Azure Key Vault and install it on the bucket - server. + """Finalizes the migration of an external volume by releasing the replication and breaking the + external cluster peering if no other migration is active. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -19832,8 +9964,6 @@ def begin_refresh_certificate( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param bucket_name: The name of the bucket. Required. - :type bucket_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -19846,12 +9976,11 @@ def begin_refresh_certificate( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._refresh_certificate_initial( + raw_result = self._finalize_external_replication_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - bucket_name=bucket_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -19885,165 +10014,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class CachesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`caches` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def get( - self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any - ) -> _models.Cache: - """Get the details of the specified Cache. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :return: Cache. The Cache is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.Cache - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Cache] = kwargs.pop("cls", None) - - _request = build_caches_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - cache_name=cache_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cache, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: Union[_models.Cache, _types.Cache, IO[bytes]], - **kwargs: Any + def _perform_replication_transfer_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20053,28 +10025,18 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_caches_create_or_update_request( + _request = build_volumes_perform_replication_transfer_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -20091,7 +10053,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -20104,11 +10066,8 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -20117,147 +10076,11 @@ def _create_or_update_initial( return deserialized # type: ignore - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: _models.Cache, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Create or update the specified Cache within the Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.Cache - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: _types.Cache, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Create or update the specified Cache within the Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.Cache - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Create or update the specified Cache within the Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: Union[_models.Cache, _types.Cache, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Create or update the specified Cache within the Capacity Pool. + def begin_perform_replication_transfer( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Performs an adhoc replication transfer on a volume with volumeType Migration. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20266,31 +10089,25 @@ def begin_create_or_update( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Resource create parameters. Is either a Cache type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.Cache or ~azure.mgmt.netapp.types.Cache or IO[bytes] - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cache] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._perform_replication_transfer_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, - body=body, - content_type=content_type, + volume_name=volume_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -20299,12 +10116,9 @@ def begin_create_or_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Cache, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -20319,51 +10133,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Cache].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Cache]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _update_initial( + def _pool_change_initial( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: Union[_models.CacheUpdate, _types.CacheUpdate, IO[bytes]], + volume_name: str, + body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -20387,11 +10171,11 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_caches_update_request( + _request = build_volumes_pool_change_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -20426,9 +10210,6 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -20440,18 +10221,18 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: _models.CacheUpdate, + volume_name: str, + body: _models.PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Patch the specified Cache. + ) -> LROPoller[None]: + """Moves volume to another pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20460,32 +10241,31 @@ def begin_update( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.CacheUpdate + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Move volume to the pool supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.PoolChangeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: _types.CacheUpdate, + volume_name: str, + body: _types.PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Patch the specified Cache. + ) -> LROPoller[None]: + """Moves volume to another pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20494,32 +10274,31 @@ def begin_update( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.CacheUpdate + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Move volume to the pool supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.PoolChangeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, + volume_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Patch the specified Cache. + ) -> LROPoller[None]: + """Moves volume to another pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20528,58 +10307,29 @@ def begin_update( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: The resource properties to be updated. Required. + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Move volume to the pool supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_update( + def begin_pool_change( self, resource_group_name: str, account_name: str, pool_name: str, - cache_name: str, - body: Union[_models.CacheUpdate, _types.CacheUpdate, IO[bytes]], + volume_name: str, + body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Patch the specified Cache. + ) -> LROPoller[None]: + """Moves volume to another pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20588,31 +10338,30 @@ def begin_update( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: The resource properties to be updated. Is either a CacheUpdate type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.CacheUpdate or ~azure.mgmt.netapp.types.CacheUpdate or - IO[bytes] - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Move volume to the pool supplied in the body of the operation. Is either a + PoolChangeRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.PoolChangeRequest or + ~azure.mgmt.netapp.types.PoolChangeRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cache] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._pool_change_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -20623,12 +10372,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Cache, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -20643,44 +10389,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Cache].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Cache]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _delete_initial( - self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any + def _relocate_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[Union[_models.RelocateVolumeRequest, _types.RelocateVolumeRequest, IO[bytes]]] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20690,18 +10414,32 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_caches_delete_request( + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_volumes_relocate_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -20718,7 +10456,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -20742,37 +10480,85 @@ def _delete_initial( return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_delete( - self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any + @overload + def begin_relocate( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_models.RelocateVolumeRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Relocates volume to a new stamp. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Relocate volume request. Default value is None. + :type body: ~azure.mgmt.netapp.models.RelocateVolumeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_relocate( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_types.RelocateVolumeRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Relocates volume to a new stamp. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Relocate volume request. Default value is None. + :type body: ~azure.mgmt.netapp.types.RelocateVolumeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_relocate( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[None]: - """Delete the specified cache. + """Relocates volume to a new stamp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20781,88 +10567,29 @@ def begin_delete( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Relocate volume request. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - cache_name=cache_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-01-01", - params_added_on={ - "2026-01-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "accept", - ] - }, - api_versions_list=[ - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def list( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.Cache"]: - """List all Caches within the Capacity Pool. + def begin_relocate( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[Union[_models.RelocateVolumeRequest, _types.RelocateVolumeRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Relocates volume to a new stamp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20871,145 +10598,69 @@ def list( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :return: An iterator like instance of Cache - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Cache] + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Relocate volume request. Is either a RelocateVolumeRequest type or a IO[bytes] + type. Default value is None. + :type body: ~azure.mgmt.netapp.models.RelocateVolumeRequest or + ~azure.mgmt.netapp.types.RelocateVolumeRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Cache]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_caches_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Cache], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def list_peering_passphrases( - self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any - ) -> _models.PeeringPassphrases: - """This operation will list the cluster peering command, cluster peering passphrase and the - vserver peering command. + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._relocate_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :return: PeeringPassphrases. The PeeringPassphrases is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.PeeringPassphrases - :raises ~azure.core.exceptions.HttpResponseError: - """ + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _finalize_relocation_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -21021,13 +10672,13 @@ def list_peering_passphrases( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PeeringPassphrases] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_caches_list_peering_passphrases_request( + _request = build_volumes_finalize_relocation_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -21039,19 +10690,18 @@ def list_peering_passphrases( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -21059,52 +10709,85 @@ def list_peering_passphrases( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PeeringPassphrases, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def _pool_change_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], - **kwargs: Any + @distributed_trace + def begin_finalize_relocation( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Finalizes the relocation of the volume and cleans up the old volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._finalize_relocation_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _revert_relocation_initial( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -21114,28 +10797,18 @@ def _pool_change_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_caches_pool_change_request( + _request = build_volumes_revert_relocation_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -21169,154 +10842,19 @@ def _pool_change_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: _models.PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Moves Cache to another Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Move cache to the pool supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.PoolChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: _types.PoolChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Moves Cache to another Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Move cache to the pool supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.types.PoolChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] - :raises ~azure.core.exceptions.HttpResponseError: - """ + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - @overload - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Moves Cache to another Capacity Pool. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the NetApp account. Required. - :type account_name: str - :param pool_name: The name of the capacity pool. Required. - :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Move cache to the pool supplied in the body of the operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "cache_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-01", - "2026-01-15-preview", - "2026-03-01", - "2026-03-15-preview", - "2026-04-01", - "2026-04-15-preview", - "2026-05-01", - "2026-05-15-preview", - "2026-06-01", - "2026-06-15-preview", - ], - ) - def begin_pool_change( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - cache_name: str, - body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Moves Cache to another Capacity Pool. + def begin_revert_relocation( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Reverts the volume relocation process, cleans up the new volume and starts using the + former-existing volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -21325,33 +10863,25 @@ def begin_pool_change( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :param body: Move cache to the pool supplied in the body of the operation. Is either a - PoolChangeRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.PoolChangeRequest or - ~azure.mgmt.netapp.types.PoolChangeRequest or IO[bytes] - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cache] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._pool_change_initial( + raw_result = self._revert_relocation_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, - body=body, - content_type=content_type, + volume_name=volume_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -21360,12 +10890,9 @@ def begin_pool_change( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Cache, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -21380,30 +10907,30 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Cache].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Cache]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2025-12-01", params_added_on={ - "2025-12-15-preview": [ + "2025-12-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", "pool_name", - "cache_name", + "volume_name", + "content_type", "accept", ] }, api_versions_list=[ + "2025-12-01", "2025-12-15-preview", "2026-01-01", "2026-01-15-preview", @@ -21415,10 +10942,19 @@ def get_long_running_output(pipeline_response): "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _reset_smb_password_initial( - self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any + def _list_quota_report_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[Union[_models.QuotaReportFilterRequest, _types.QuotaReportFilterRequest, IO[bytes]]] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -21428,18 +10964,32 @@ def _reset_smb_password_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_caches_reset_smb_password_request( + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_volumes_list_quota_report_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -21470,6 +11020,9 @@ def _reset_smb_password_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -21478,23 +11031,127 @@ def _reset_smb_password_initial( if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized # type: ignore + return deserialized # type: ignore + + @overload + def begin_list_quota_report( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_models.QuotaReportFilterRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ListQuotaReportResult]: + """Get quota report for volume (with filter support). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.netapp.models.QuotaReportFilterRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_list_quota_report( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_types.QuotaReportFilterRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ListQuotaReportResult]: + """Get quota report for volume (with filter support). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.netapp.types.QuotaReportFilterRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_list_quota_report( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ListQuotaReportResult]: + """Get quota report for volume (with filter support). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2025-12-01", params_added_on={ - "2025-12-15-preview": [ + "2025-12-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", "pool_name", - "cache_name", + "volume_name", + "content_type", "accept", ] }, api_versions_list=[ + "2025-12-01", "2025-12-15-preview", "2026-01-01", "2026-01-15-preview", @@ -21506,12 +11163,21 @@ def _reset_smb_password_initial( "2026-05-15-preview", "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_reset_smb_password( - self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any - ) -> LROPoller[_models.Cache]: - """Resets the SMB password for the cache. + def begin_list_quota_report( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[Union[_models.QuotaReportFilterRequest, _types.QuotaReportFilterRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.ListQuotaReportResult]: + """Get quota report for volume (with filter support). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -21520,26 +11186,34 @@ def begin_reset_smb_password( :type account_name: str :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param cache_name: The name of the cache resource. Required. - :type cache_name: str - :return: An instance of LROPoller that returns Cache. The Cache is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: The content of the action request. Is either a QuotaReportFilterRequest type or a + IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.QuotaReportFilterRequest or + ~azure.mgmt.netapp.types.QuotaReportFilterRequest or IO[bytes] + :return: An instance of LROPoller that returns ListQuotaReportResult. The ListQuotaReportResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ListQuotaReportResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Cache] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.ListQuotaReportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._reset_smb_password_initial( + raw_result = self._list_quota_report_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, - cache_name=cache_name, + volume_name=volume_name, + body=body, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -21549,10 +11223,17 @@ def begin_reset_smb_password( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.Cache, response.json()) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ListQuotaReportResult, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized path_format_arguments = { @@ -21568,25 +11249,25 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Cache].from_continuation_token( + return LROPoller[_models.ListQuotaReportResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Cache]( + return LROPoller[_models.ListQuotaReportResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) -class ElasticAccountsOperations: # pylint: disable=docstring-missing-param +class SnapshotsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_accounts` attribute. + :attr:`snapshots` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -21597,30 +11278,30 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.ElasticAccount: - """Get the NetApp Elastic Account. + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + **kwargs: Any + ) -> _models.Snapshot: + """Get details of the specified snapshot. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :return: ElasticAccount. The ElasticAccount is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticAccount + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -21634,11 +11315,14 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ElasticAccount] = kwargs.pop("cls", None) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - _request = build_elastic_accounts_get_request( + _request = build_snapshots_get_request( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -21673,39 +11357,21 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ElasticAccount, response.json()) + deserialized = _deserialize(_models.Snapshot, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( + def _create_initial( self, resource_group_name: str, account_name: str, - body: Union[_models.ElasticAccount, _types.ElasticAccount, IO[bytes]], + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Union[_models.Snapshot, _types.Snapshot, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -21729,9 +11395,12 @@ def _create_or_update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_accounts_create_or_update_request( + _request = build_snapshots_create_request( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -21752,7 +11421,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [201, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -21765,11 +11434,8 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -21779,146 +11445,164 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, account_name: str, - body: _models.ElasticAccount, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: _models.Snapshot, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. + ) -> LROPoller[_models.Snapshot]: + """Create the specified snapshot within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccount + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.Snapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, account_name: str, - body: _types.ElasticAccount, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: _types.Snapshot, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. + ) -> LROPoller[_models.Snapshot]: + """Create the specified snapshot within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticAccount + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.Snapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. + ) -> LROPoller[_models.Snapshot]: + """Create the specified snapshot within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: Resource create parameters. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_create_or_update( + """ + + @distributed_trace + def begin_create( self, resource_group_name: str, account_name: str, - body: Union[_models.ElasticAccount, _types.ElasticAccount, IO[bytes]], + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Union[_models.Snapshot, _types.Snapshot, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Create or update the specified NetApp Elastic Account within the resource group. + ) -> LROPoller[_models.Snapshot]: + """Create the specified snapshot within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: Resource create parameters. Is either a ElasticAccount type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccount or ~azure.mgmt.netapp.types.ElasticAccount - or IO[bytes] - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Is either a Snapshot type + or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.Snapshot or ~azure.mgmt.netapp.types.Snapshot or + IO[bytes] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticAccount] = kwargs.pop("cls", None) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -21930,10 +11614,14 @@ def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticAccount, response.json()) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Snapshot, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized path_format_arguments = { @@ -21949,42 +11637,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticAccount].from_continuation_token( + return LROPoller[_models.Snapshot].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticAccount]( + return LROPoller[_models.Snapshot]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def _update_initial( self, resource_group_name: str, account_name: str, - body: Union[_models.ElasticAccountUpdate, _types.ElasticAccountUpdate, IO[bytes]], + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Union[_models.SnapshotPatch, _types.SnapshotPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -22008,9 +11678,12 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_accounts_update_request( + _request = build_snapshots_update_request( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -22045,9 +11718,6 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -22063,26 +11733,35 @@ def begin_update( self, resource_group_name: str, account_name: str, - body: _models.ElasticAccountUpdate, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: _models.SnapshotPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. + ) -> LROPoller[_models.Snapshot]: + """Patch a snapshot. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccountUpdate + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -22091,26 +11770,35 @@ def begin_update( self, resource_group_name: str, account_name: str, - body: _types.ElasticAccountUpdate, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: _types.SnapshotPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. + ) -> LROPoller[_models.Snapshot]: + """Patch a snapshot. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticAccountUpdate + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.SnapshotPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -22119,79 +11807,76 @@ def begin_update( self, resource_group_name: str, account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. + ) -> LROPoller[_models.Snapshot]: + """Patch a snapshot. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: The resource properties to be updated. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def begin_update( self, resource_group_name: str, account_name: str, - body: Union[_models.ElasticAccountUpdate, _types.ElasticAccountUpdate, IO[bytes]], + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Union[_models.SnapshotPatch, _types.SnapshotPatch, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticAccount]: - """Patch the specified NetApp Elastic Account. + ) -> LROPoller[_models.Snapshot]: + """Patch a snapshot. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param body: The resource properties to be updated. Is either a ElasticAccountUpdate type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticAccountUpdate or - ~azure.mgmt.netapp.types.ElasticAccountUpdate or IO[bytes] - :return: An instance of LROPoller that returns ElasticAccount. The ElasticAccount is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticAccount] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Snapshot object supplied in the body of the operation. Is either a SnapshotPatch + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotPatch or ~azure.mgmt.netapp.types.SnapshotPatch + or IO[bytes] + :return: An instance of LROPoller that returns Snapshot. The Snapshot is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticAccount] = kwargs.pop("cls", None) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -22199,6 +11884,9 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -22211,7 +11899,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticAccount, response.json()) + deserialized = _deserialize(_models.Snapshot, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -22229,31 +11917,25 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticAccount].from_continuation_token( + return LROPoller[_models.Snapshot].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticAccount]( + return LROPoller[_models.Snapshot]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: Any) -> Iterator[bytes]: + def _delete_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -22267,9 +11949,12 @@ def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_accounts_delete_request( + _request = build_snapshots_delete_request( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -22288,7 +11973,7 @@ def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -22313,28 +11998,28 @@ def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete the specified NetApp elastic account. + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete snapshot. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -22350,6 +12035,9 @@ def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: An raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -22384,32 +12072,28 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.ElasticAccount"]: - """List and describe all NetApp elastic accounts in the resource group. + def list( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> ItemPaged["_models.Snapshot"]: + """List all snapshots associated with the volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of ElasticAccount - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticAccount] + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An iterator like instance of Snapshot + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ElasticAccount]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Snapshot]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -22422,8 +12106,11 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite def prepare_request(next_link=None): if not next_link: - _request = build_elastic_accounts_list_by_resource_group_request( + _request = build_snapshots_list_request( resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -22464,7 +12151,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ElasticAccount], + List[_models.Snapshot], deserialized.get("value", []), ) if cls: @@ -22492,31 +12179,16 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ElasticAccount"]: - """List and describe all NetApp elastic accounts in the subscription. - - :return: An iterator like instance of ElasticAccount - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticAccount]] = kwargs.pop("cls", None) - + def _restore_files_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Union[_models.SnapshotRestoreFiles, _types.SnapshotRestoreFiles, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -22525,87 +12197,268 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ElasticAccou } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_elastic_accounts_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_snapshots_restore_files_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: _models.SnapshotRestoreFiles, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Restore the specified files from the specified snapshot to the active filesystem. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Restore payload supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: _types.SnapshotRestoreFiles, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Restore the specified files from the specified snapshot to the active filesystem. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Restore payload supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.SnapshotRestoreFiles + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Restore the specified files from the specified snapshot to the active filesystem. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Restore payload supplied in the body of the operation. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: Union[_models.SnapshotRestoreFiles, _types.SnapshotRestoreFiles, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Restore the specified files from the specified snapshot to the active filesystem. - return _request + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param snapshot_name: The name of the snapshot. Required. + :type snapshot_name: str + :param body: Restore payload supplied in the body of the operation. Is either a + SnapshotRestoreFiles type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles or + ~azure.mgmt.netapp.types.SnapshotRestoreFiles or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticAccount], - deserialized.get("value", []), + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._restore_files_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class ElasticCapacityPoolsOperations: # pylint: disable=docstring-missing-param +class SnapshotPoliciesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_capacity_pools` attribute. + :attr:`snapshot_policies` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -22616,41 +12469,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def get( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> _models.ElasticCapacityPool: - """Get the NetApp Elastic Capacity Pool. + self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any + ) -> _models.SnapshotPolicy: + """Get a snapshot Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :return: ElasticCapacityPool. The ElasticCapacityPool is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticCapacityPool + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -22664,12 +12496,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) + cls: ClsType[_models.SnapshotPolicy] = kwargs.pop("cls", None) - _request = build_elastic_capacity_pools_get_request( + _request = build_snapshot_policies_get_request( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, + snapshot_policy_name=snapshot_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -22704,341 +12536,203 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) + deserialized = _deserialize(_models.SnapshotPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPool, _types.ElasticCapacityPool, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_capacity_pools_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @overload - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: _models.ElasticCapacityPool, + snapshot_policy_name: str, + body: _models.SnapshotPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. + ) -> _models.SnapshotPolicy: + """Create a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPool + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: _types.ElasticCapacityPool, + snapshot_policy_name: str, + body: _types.SnapshotPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. + ) -> _models.SnapshotPolicy: + """Create a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticCapacityPool + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.SnapshotPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - pool_name: str, + snapshot_policy_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. + ) -> _models.SnapshotPolicy: + """Create a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Required. + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPool, _types.ElasticCapacityPool, IO[bytes]], + snapshot_policy_name: str, + body: Union[_models.SnapshotPolicy, _types.SnapshotPolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Create or update the specified NetApp Elastic Capacity Pool within the resource group and - NetApp Elastic Account. + ) -> _models.SnapshotPolicy: + """Create a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: Resource create parameters. Is either a ElasticCapacityPool type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPool or - ~azure.mgmt.netapp.types.ElasticCapacityPool or IO[bytes] - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Is either a + SnapshotPolicy type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotPolicy or ~azure.mgmt.netapp.types.SnapshotPolicy + or IO[bytes] + :return: SnapshotPolicy. The SnapshotPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.SnapshotPolicy] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_snapshot_policies_create_request( + resource_group_name=resource_group_name, + account_name=account_name, + snapshot_policy_name=snapshot_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.ElasticCapacityPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ElasticCapacityPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.SnapshotPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def _update_initial( self, resource_group_name: str, account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPoolUpdate, _types.ElasticCapacityPoolUpdate, IO[bytes]], + snapshot_policy_name: str, + body: Union[_models.SnapshotPolicyPatch, _types.SnapshotPolicyPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -23062,10 +12756,10 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_capacity_pools_update_request( + _request = build_snapshot_policies_update_request( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, + snapshot_policy_name=snapshot_policy_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -23100,9 +12794,6 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -23118,29 +12809,29 @@ def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - body: _models.ElasticCapacityPoolUpdate, + snapshot_policy_name: str, + body: _models.SnapshotPolicyPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. + ) -> LROPoller[_models.SnapshotPolicy]: + """Patch a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPoolUpdate + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotPolicyPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -23149,29 +12840,29 @@ def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - body: _types.ElasticCapacityPoolUpdate, + snapshot_policy_name: str, + body: _types.SnapshotPolicyPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. + ) -> LROPoller[_models.SnapshotPolicy]: + """Patch a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticCapacityPoolUpdate + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.SnapshotPolicyPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -23180,86 +12871,64 @@ def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, + snapshot_policy_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. + ) -> LROPoller[_models.SnapshotPolicy]: + """Patch a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Required. + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) + :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - body: Union[_models.ElasticCapacityPoolUpdate, _types.ElasticCapacityPoolUpdate, IO[bytes]], + snapshot_policy_name: str, + body: Union[_models.SnapshotPolicyPatch, _types.SnapshotPolicyPatch, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Patch the specified NetApp Elastic Capacity Pool. + ) -> LROPoller[_models.SnapshotPolicy]: + """Patch a snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The resource properties to be updated. Is either a ElasticCapacityPoolUpdate type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticCapacityPoolUpdate or - ~azure.mgmt.netapp.types.ElasticCapacityPoolUpdate or IO[bytes] - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :param body: Snapshot policy object supplied in the body of the operation. Is either a + SnapshotPolicyPatch type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.SnapshotPolicyPatch or + ~azure.mgmt.netapp.types.SnapshotPolicyPatch or IO[bytes] + :return: An instance of LROPoller that returns SnapshotPolicy. The SnapshotPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) + cls: ClsType[_models.SnapshotPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -23267,7 +12936,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, + snapshot_policy_name=snapshot_policy_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -23280,7 +12949,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) + deserialized = _deserialize(_models.SnapshotPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -23298,32 +12967,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticCapacityPool].from_continuation_token( + return LROPoller[_models.SnapshotPolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticCapacityPool]( + return LROPoller[_models.SnapshotPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "pool_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def _delete_initial( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -23338,10 +12993,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_capacity_pools_delete_request( + _request = build_snapshot_policies_delete_request( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, + snapshot_policy_name=snapshot_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -23360,7 +13015,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -23385,32 +13040,18 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "pool_name"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def begin_delete( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete the specified NetApp Elastic Capacity Pool. + """Delete snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -23426,7 +13067,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, + snapshot_policy_name=snapshot_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -23461,38 +13102,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticCapacityPool"]: - """List and describe all NetApp Elastic Capacity Pools in the Elastic NetApp Account. + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.SnapshotPolicy"]: + """List snapshot policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :return: An iterator like instance of ElasticCapacityPool - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticCapacityPool] + :return: An iterator like instance of SnapshotPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SnapshotPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ElasticCapacityPool]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SnapshotPolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -23505,7 +13130,7 @@ def list_by_elastic_account( def prepare_request(next_link=None): if not next_link: - _request = build_elastic_capacity_pools_list_by_elastic_account_request( + _request = build_snapshot_policies_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -23548,62 +13173,209 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ElasticCapacityPool], + List[_models.SnapshotPolicy], deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_volumes( + self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any + ) -> _models.SnapshotPolicyVolumeList: + """Get volumes associated with snapshot policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param snapshot_policy_name: The name of the snapshot policy. Required. + :type snapshot_policy_name: str + :return: SnapshotPolicyVolumeList. The SnapshotPolicyVolumeList is compatible with + MutableMapping + :rtype: ~azure.mgmt.netapp.models.SnapshotPolicyVolumeList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SnapshotPolicyVolumeList] = kwargs.pop("cls", None) + + _request = build_snapshot_policies_list_volumes_request( + resource_group_name=resource_group_name, + account_name=account_name, + snapshot_policy_name=snapshot_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SnapshotPolicyVolumeList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class BackupPoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.netapp.NetAppManagementClient`'s + :attr:`backup_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + ) -> _models.BackupPolicy: + """Get a particular backup Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :return: BackupPolicy. The BackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.BackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.BackupPolicy] = kwargs.pop("cls", None) + + _request = build_backup_policies_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + backup_policy_name=backup_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.BackupPolicy, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _change_zone_initial( + def _create_initial( self, resource_group_name: str, account_name: str, - pool_name: str, - body: Union[_models.ChangeZoneRequest, _types.ChangeZoneRequest, IO[bytes]], + backup_policy_name: str, + body: Union[_models.BackupPolicy, _types.BackupPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -23627,10 +13399,10 @@ def _change_zone_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_capacity_pools_change_zone_request( + _request = build_backup_policies_create_request( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, + backup_policy_name=backup_policy_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -23651,7 +13423,7 @@ def _change_zone_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -23664,6 +13436,12 @@ def _change_zone_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -23676,562 +13454,184 @@ def _change_zone_initial( return deserialized # type: ignore @overload - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _models.ChangeZoneRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.ChangeZoneRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: _types.ChangeZoneRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.ChangeZoneRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_change_zone( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - body: Union[_models.ChangeZoneRequest, _types.ChangeZoneRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ElasticCapacityPool]: - """Moves pool to another zone. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Is either a ChangeZoneRequest type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ChangeZoneRequest or - ~azure.mgmt.netapp.types.ChangeZoneRequest or IO[bytes] - :return: An instance of LROPoller that returns ElasticCapacityPool. The ElasticCapacityPool is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticCapacityPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticCapacityPool] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._change_zone_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticCapacityPool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ElasticCapacityPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ElasticCapacityPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def check_volume_file_path_availability( + def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: _models.CheckElasticVolumeFilePathAvailabilityRequest, + backup_policy_name: str, + body: _models.BackupPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. + ) -> LROPoller[_models.BackupPolicy]: + """Create a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.CheckElasticVolumeFilePathAvailabilityRequest + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.BackupPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def check_volume_file_path_availability( + def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: _types.CheckElasticVolumeFilePathAvailabilityRequest, + backup_policy_name: str, + body: _types.BackupPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. + ) -> LROPoller[_models.BackupPolicy]: + """Create a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.CheckElasticVolumeFilePathAvailabilityRequest + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.BackupPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def check_volume_file_path_availability( + def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, + backup_policy_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. + ) -> LROPoller[_models.BackupPolicy]: + """Create a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Required. + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def check_volume_file_path_availability( + def begin_create( self, resource_group_name: str, account_name: str, - pool_name: str, - body: Union[ - _models.CheckElasticVolumeFilePathAvailabilityRequest, - _types.CheckElasticVolumeFilePathAvailabilityRequest, - IO[bytes], - ], + backup_policy_name: str, + body: Union[_models.BackupPolicy, _types.BackupPolicy, IO[bytes]], **kwargs: Any - ) -> _models.CheckElasticResourceAvailabilityResponse: - """Check if an Elastic Volume file path is available within the given Elastic Capacity Pool. + ) -> LROPoller[_models.BackupPolicy]: + """Create a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param body: The content of the action request. Is either a - CheckElasticVolumeFilePathAvailabilityRequest type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.CheckElasticVolumeFilePathAvailabilityRequest or - ~azure.mgmt.netapp.types.CheckElasticVolumeFilePathAvailabilityRequest or IO[bytes] - :return: CheckElasticResourceAvailabilityResponse. The CheckElasticResourceAvailabilityResponse - is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.CheckElasticResourceAvailabilityResponse + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Is either a + BackupPolicy type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BackupPolicy or ~azure.mgmt.netapp.types.BackupPolicy or + IO[bytes] + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckElasticResourceAvailabilityResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_capacity_pools_check_volume_file_path_availability_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + cls: ClsType[_models.BackupPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + backup_policy_name=backup_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CheckElasticResourceAvailabilityResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ElasticVolumesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_volumes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def get( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.ElasticVolume: - """Get the details of the specified volume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :return: ElasticVolume. The ElasticVolume is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticVolume - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.BackupPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_elastic_volumes_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.ElasticVolume, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.BackupPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BackupPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( + def _update_initial( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolume, _types.ElasticVolume, IO[bytes]], + backup_policy_name: str, + body: Union[_models.BackupPolicyPatch, _types.BackupPolicyPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -24255,11 +13655,10 @@ def _create_or_update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_volumes_create_or_update_request( + _request = build_backup_policies_update_request( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, + backup_policy_name=backup_policy_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -24280,7 +13679,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -24293,7 +13692,7 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) @@ -24307,176 +13706,269 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, - body: _models.ElasticVolume, + backup_policy_name: str, + body: _models.BackupPolicyPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. + ) -> LROPoller[_models.BackupPolicy]: + """Patch a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolume + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.BackupPolicyPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, - body: _types.ElasticVolume, + backup_policy_name: str, + body: _types.BackupPolicyPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. + ) -> LROPoller[_models.BackupPolicy]: + """Patch a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticVolume + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.BackupPolicyPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, + backup_policy_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. + ) -> LROPoller[_models.BackupPolicy]: + """Patch a backup policy for Netapp Account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Required. + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - pool_name: str, - volume_name: str, - body: Union[_models.ElasticVolume, _types.ElasticVolume, IO[bytes]], + backup_policy_name: str, + body: Union[_models.BackupPolicyPatch, _types.BackupPolicyPatch, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Create or update the specified volume within the capacity pool. + ) -> LROPoller[_models.BackupPolicy]: + """Patch a backup policy for Netapp Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :param body: Backup policy object supplied in the body of the operation. Is either a + BackupPolicyPatch type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BackupPolicyPatch or + ~azure.mgmt.netapp.types.BackupPolicyPatch or IO[bytes] + :return: An instance of LROPoller that returns BackupPolicy. The BackupPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + backup_policy_name=backup_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.BackupPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BackupPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BackupPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_backup_policies_delete_request( + resource_group_name=resource_group_name, + account_name=account_name, + backup_policy_name=backup_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete backup policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: Resource create parameters. Is either a ElasticVolume type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolume or ~azure.mgmt.netapp.types.ElasticVolume - or IO[bytes] - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :param backup_policy_name: Backup policy Name which uniquely identify backup policy. Required. + :type backup_policy_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - body=body, - content_type=content_type, + backup_policy_name=backup_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -24485,12 +13977,9 @@ def begin_create_or_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticVolume, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -24505,46 +13994,227 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticVolume].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticVolume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.BackupPolicy"]: + """List backup policies for Netapp Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :return: An iterator like instance of BackupPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.BackupPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_backup_policies_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.BackupPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VolumeQuotaRulesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.netapp.NetAppManagementClient`'s + :attr:`volume_quota_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + **kwargs: Any + ) -> _models.VolumeQuotaRule: + """Get details of the specified quota rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :return: VolumeQuotaRule. The VolumeQuotaRule is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.VolumeQuotaRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VolumeQuotaRule] = kwargs.pop("cls", None) + + _request = build_volume_quota_rules_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + volume_quota_rule_name=volume_quota_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _update_initial( + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VolumeQuotaRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: Union[_models.ElasticVolumeUpdate, _types.ElasticVolumeUpdate, IO[bytes]], + volume_quota_rule_name: str, + body: Union[_models.VolumeQuotaRule, _types.VolumeQuotaRule, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -24568,11 +14238,12 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_volumes_update_request( + _request = build_volume_quota_rules_create_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, + volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -24593,7 +14264,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -24606,10 +14277,7 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 201: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -24621,174 +14289,164 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: _models.ElasticVolumeUpdate, + volume_quota_rule_name: str, + body: _models.VolumeQuotaRule, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. + ) -> LROPoller[_models.VolumeQuotaRule]: + """Create the specified quota rule within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeUpdate + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.VolumeQuotaRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: _types.ElasticVolumeUpdate, + volume_quota_rule_name: str, + body: _types.VolumeQuotaRule, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. + ) -> LROPoller[_models.VolumeQuotaRule]: + """Create the specified quota rule within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticVolumeUpdate + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.VolumeQuotaRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, + volume_quota_rule_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. + ) -> LROPoller[_models.VolumeQuotaRule]: + """Create the specified quota rule within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param body: The resource properties to be updated. Required. + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_update( + def begin_create( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: Union[_models.ElasticVolumeUpdate, _types.ElasticVolumeUpdate, IO[bytes]], + volume_quota_rule_name: str, + body: Union[_models.VolumeQuotaRule, _types.VolumeQuotaRule, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Patch the specified elastic volume. + ) -> LROPoller[_models.VolumeQuotaRule]: + """Create the specified quota rule within the given volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param body: The resource properties to be updated. Is either a ElasticVolumeUpdate type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeUpdate or - ~azure.mgmt.netapp.types.ElasticVolumeUpdate or IO[bytes] - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Is either a + VolumeQuotaRule type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.VolumeQuotaRule or + ~azure.mgmt.netapp.types.VolumeQuotaRule or IO[bytes] + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) + cls: ClsType[_models.VolumeQuotaRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, + volume_quota_rule_name=volume_quota_rule_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -24801,7 +14459,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticVolume, response.json()) + deserialized = _deserialize(_models.VolumeQuotaRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -24819,39 +14477,25 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticVolume].from_continuation_token( + return LROPoller[_models.VolumeQuotaRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticVolume]( + return LROPoller[_models.VolumeQuotaRule]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _delete_initial( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + def _update_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: Union[_models.VolumeQuotaRulePatch, _types.VolumeQuotaRulePatch, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -24861,18 +14505,29 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_volumes_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_volume_quota_rules_update_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, + volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -24889,7 +14544,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -24911,61 +14566,169 @@ def _delete_initial( if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized # type: ignore + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: _models.VolumeQuotaRulePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VolumeQuotaRule]: + """Patch a quota rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.VolumeQuotaRulePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: _types.VolumeQuotaRulePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VolumeQuotaRule]: + """Patch a quota rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.VolumeQuotaRulePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VolumeQuotaRule]: + """Patch a quota rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_delete( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete the specified Elastic Volume. + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + volume_quota_rule_name: str, + body: Union[_models.VolumeQuotaRulePatch, _types.VolumeQuotaRulePatch, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VolumeQuotaRule]: + """Patch a quota rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :param body: Quota rule object supplied in the body of the operation. Is either a + VolumeQuotaRulePatch type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.VolumeQuotaRulePatch or + ~azure.mgmt.netapp.types.VolumeQuotaRulePatch or IO[bytes] + :return: An instance of LROPoller that returns VolumeQuotaRule. The VolumeQuotaRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VolumeQuotaRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, + volume_quota_rule_name=volume_quota_rule_name, + body=body, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -24974,9 +14737,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VolumeQuotaRule, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -24991,170 +14757,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.VolumeQuotaRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_pool( - self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticVolume"]: - """List all Elastic Volumes within the Elastic Capacity Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :return: An iterator like instance of ElasticVolume - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticVolume]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_volumes_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticVolume], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + return LROPoller[_models.VolumeQuotaRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _revert_initial( + def _delete_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: Union[_models.ElasticVolumeRevert, _types.ElasticVolumeRevert, IO[bytes]], + volume_quota_rule_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -25165,28 +14784,19 @@ def _revert_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_volumes_revert_request( + _request = build_volume_quota_rules_delete_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, + volume_quota_rule_name=volume_quota_rule_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -25203,7 +14813,7 @@ def _revert_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -25227,177 +14837,47 @@ def _revert_initial( return deserialized # type: ignore - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _models.ElasticVolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeRevert - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: _types.ElasticVolumeRevert, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.netapp.types.ElasticVolumeRevert - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_revert( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def begin_revert( + def begin_delete( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - body: Union[_models.ElasticVolumeRevert, _types.ElasticVolumeRevert, IO[bytes]], + volume_quota_rule_name: str, **kwargs: Any - ) -> LROPoller[_models.ElasticVolume]: - """Revert an Elastic Volume to the snapshot specified in the body. + ) -> LROPoller[None]: + """Delete quota rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param body: The content of the action request. Is either a ElasticVolumeRevert type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticVolumeRevert or - ~azure.mgmt.netapp.types.ElasticVolumeRevert or IO[bytes] - :return: An instance of LROPoller that returns ElasticVolume. The ElasticVolume is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticVolume] + :param volume_quota_rule_name: The name of volume quota rule. Required. + :type volume_quota_rule_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticVolume] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._revert_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - body=body, - content_type=content_type, + volume_quota_rule_name=volume_quota_rule_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -25406,45 +14886,148 @@ def begin_revert( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticVolume, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_volume( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> ItemPaged["_models.VolumeQuotaRule"]: + """List all quota rules associated with the volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An iterator like instance of VolumeQuotaRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeQuotaRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VolumeQuotaRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_volume_quota_rules_list_by_volume_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VolumeQuotaRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + return pipeline_response - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ElasticVolume].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ElasticVolume]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return ItemPaged(get_next, extract_data) -class ElasticSnapshotsOperations: # pylint: disable=docstring-missing-param +class RansomwareReportsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_snapshots` attribute. + :attr:`ransomware_reports` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -25456,26 +15039,35 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2025-12-01", params_added_on={ - "2025-12-15-preview": [ + "2025-12-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", "pool_name", "volume_name", - "snapshot_name", + "ransomware_report_name", "accept", ] }, api_versions_list=[ + "2025-12-01", "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def get( @@ -25484,24 +15076,28 @@ def get( account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, + ransomware_report_name: str, **kwargs: Any - ) -> _models.ElasticSnapshot: - """Get a ElasticSnapshot. + ) -> _models.RansomwareReport: + """Get details of the specified ransomware report (ARP) ARP reports are created with a list of + suspected files when it detects any combination of high data entropy, abnormal volume activity + with data encryption, and unusual file extensions. ARP creates snapshots named + Anti_ransomware_backup when it detects a potential ransomware threat. You can use one of these + ARP snapshots or another snapshot of your volume to restore data. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :return: ElasticSnapshot. The ElasticSnapshot is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticSnapshot + :param ransomware_report_name: The name of the ransomware report. Required. + :type ransomware_report_name: str + :return: RansomwareReport. The RansomwareReport is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.RansomwareReport :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -25515,14 +15111,14 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ElasticSnapshot] = kwargs.pop("cls", None) + cls: ClsType[_models.RansomwareReport] = kwargs.pop("cls", None) - _request = build_elastic_snapshots_get_request( + _request = build_ransomware_reports_get_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - snapshot_name=snapshot_name, + ransomware_report_name=ransomware_report_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -25557,372 +15153,197 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ElasticSnapshot, response.json()) + deserialized = _deserialize(_models.RansomwareReport, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "snapshot_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.ElasticSnapshot, _types.ElasticSnapshot, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_elastic_snapshots_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _models.ElasticSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: _types.ElasticSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticSnapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2025-12-01", params_added_on={ - "2025-12-15-preview": [ + "2025-12-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", "pool_name", "volume_name", - "snapshot_name", - "content_type", "accept", ] }, api_versions_list=[ + "2025-12-01", "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - snapshot_name: str, - body: Union[_models.ElasticSnapshot, _types.ElasticSnapshot, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshot]: - """Create a ElasticSnapshot. + def list( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> ItemPaged["_models.RansomwareReport"]: + """List all ransomware reports for the volume Returns a list of the Advanced Ransomware Protection + (ARP) reports for the volume. ARP reports are created with a list of suspected files when it + detects any combination of high data entropy, abnormal volume activity with data encryption, + and unusual file extensions. ARP creates snapshots named Anti_ransomware_backup when it detects + a potential ransomware threat. You can use one of these ARP snapshots or another snapshot of + your volume to restore data". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str - :param body: Resource create parameters. Is either a ElasticSnapshot type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshot or - ~azure.mgmt.netapp.types.ElasticSnapshot or IO[bytes] - :return: An instance of LROPoller that returns ElasticSnapshot. The ElasticSnapshot is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshot] + :return: An iterator like instance of RansomwareReport + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.RansomwareReport] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticSnapshot] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - snapshot_name=snapshot_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticSnapshot, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + cls: ClsType[List[_models.RansomwareReport]] = kwargs.pop("cls", None) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } + error_map.update(kwargs.pop("error_map", {}) or {}) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + def prepare_request(next_link=None): + if not next_link: + + _request = build_ransomware_reports_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RansomwareReport], + deserialized.get("value", []), ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ElasticSnapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[_models.ElasticSnapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2025-12-01", params_added_on={ - "2025-12-15-preview": [ + "2025-12-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", "pool_name", "volume_name", - "snapshot_name", + "ransomware_report_name", + "content_type", ] }, api_versions_list=[ + "2025-12-01", "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _delete_initial( + def _clear_suspects_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, + ransomware_report_name: str, + body: Union[_models.RansomwareSuspectsClearRequest, _types.RansomwareSuspectsClearRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -25933,19 +15354,29 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_snapshots_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ransomware_reports_clear_suspects_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - snapshot_name=snapshot_name, + ransomware_report_name=ransomware_report_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -25962,7 +15393,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -25975,80 +15406,221 @@ def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_clear_suspects( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + body: _models.RansomwareSuspectsClearRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should + evaluate the report to determine whether the activity is acceptable (false positive) or whether + an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a + potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your + volume to restore data",. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param ransomware_report_name: The name of the ransomware report. Required. + :type ransomware_report_name: str + :param body: Clear suspects request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.RansomwareSuspectsClearRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_clear_suspects( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + body: _types.RansomwareSuspectsClearRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should + evaluate the report to determine whether the activity is acceptable (false positive) or whether + an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a + potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your + volume to restore data",. - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param ransomware_report_name: The name of the ransomware report. Required. + :type ransomware_report_name: str + :param body: Clear suspects request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.RansomwareSuspectsClearRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + @overload + def begin_clear_suspects( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + ransomware_report_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should + evaluate the report to determine whether the activity is acceptable (false positive) or whether + an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a + potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your + volume to restore data",. - return deserialized # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param ransomware_report_name: The name of the ransomware report. Required. + :type ransomware_report_name: str + :param body: Clear suspects request object supplied in the body of the operation. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2025-12-01", params_added_on={ - "2025-12-15-preview": [ + "2025-12-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", "pool_name", "volume_name", - "snapshot_name", + "ransomware_report_name", + "content_type", ] }, api_versions_list=[ + "2025-12-01", "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_delete( + def begin_clear_suspects( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, - snapshot_name: str, + ransomware_report_name: str, + body: Union[_models.RansomwareSuspectsClearRequest, _types.RansomwareSuspectsClearRequest, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: - """Delete a ElasticSnapshot. + """Clear ransomware suspects for the given Advanced Ransomware Protection report. You should + evaluate the report to determine whether the activity is acceptable (false positive) or whether + an attack seems malicious. ARP creates snapshots named Anti_ransomware_backup when it detects a + potential ransomware threat. You can use one of these ARP snapshots or another snapshot of your + volume to restore data",. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. + :param pool_name: The name of the capacity pool. Required. :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. + :param volume_name: The name of the volume. Required. :type volume_name: str - :param snapshot_name: The name of the ElasticSnapshot. Required. - :type snapshot_name: str + :param ransomware_report_name: The name of the ransomware report. Required. + :type ransomware_report_name: str + :param body: Clear suspects request object supplied in the body of the operation. Is either a + RansomwareSuspectsClearRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.RansomwareSuspectsClearRequest or + ~azure.mgmt.netapp.types.RansomwareSuspectsClearRequest or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._clear_suspects_initial( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, - snapshot_name=snapshot_name, + ransomware_report_name=ransomware_report_name, + body=body, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -26082,190 +15654,39 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "pool_name", - "volume_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_volume( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticSnapshot"]: - """List ElasticSnapshot resources by ElasticVolume. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param pool_name: The name of the ElasticCapacityPool. Required. - :type pool_name: str - :param volume_name: The name of the ElasticVolume. Required. - :type volume_name: str - :return: An iterator like instance of ElasticSnapshot - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticSnapshot]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_snapshots_list_by_elastic_volume_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticSnapshot], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - -class ElasticSnapshotPoliciesOperations: # pylint: disable=docstring-missing-param +class BackupVaultsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_snapshot_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) + + Instead, you should access the following operations through + :class:`~azure.mgmt.netapp.NetAppManagementClient`'s + :attr:`backup_vaults` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace def get( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> _models.ElasticSnapshotPolicy: - """Get a ElasticSnapshotPolicy. + self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any + ) -> _models.BackupVault: + """Get the Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :return: ElasticSnapshotPolicy. The ElasticSnapshotPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticSnapshotPolicy + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :return: BackupVault. The BackupVault is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.BackupVault :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -26279,12 +15700,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ElasticSnapshotPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.BackupVault] = kwargs.pop("cls", None) - _request = build_elastic_snapshot_policies_get_request( + _request = build_backup_vaults_get_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -26319,41 +15740,19 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ElasticSnapshotPolicy, response.json()) + deserialized = _deserialize(_models.BackupVault, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def _create_or_update_initial( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicy, _types.ElasticSnapshotPolicy, IO[bytes]], + backup_vault_name: str, + body: Union[_models.BackupVault, _types.BackupVault, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -26377,10 +15776,10 @@ def _create_or_update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_snapshot_policies_create_or_update_request( + _request = build_backup_vaults_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -26432,29 +15831,29 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: _models.ElasticSnapshotPolicy, + backup_vault_name: str, + body: _models.BackupVault, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Create or update the specified Backup Vault in the NetApp account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicy + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: BackupVault object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.BackupVault :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -26463,29 +15862,29 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: _types.ElasticSnapshotPolicy, + backup_vault_name: str, + body: _types.BackupVault, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Create or update the specified Backup Vault in the NetApp account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticSnapshotPolicy + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: BackupVault object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.BackupVault :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -26494,86 +15893,64 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + backup_vault_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Create or update the specified Backup Vault in the NetApp account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Required. + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: BackupVault object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def begin_create_or_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicy, _types.ElasticSnapshotPolicy, IO[bytes]], + backup_vault_name: str, + body: Union[_models.BackupVault, _types.BackupVault, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Create a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Create or update the specified Backup Vault in the NetApp account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: Resource create parameters. Is either a ElasticSnapshotPolicy type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicy or - ~azure.mgmt.netapp.types.ElasticSnapshotPolicy or IO[bytes] - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: BackupVault object supplied in the body of the operation. Is either a BackupVault + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BackupVault or ~azure.mgmt.netapp.types.BackupVault or + IO[bytes] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticSnapshotPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.BackupVault] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -26581,7 +15958,7 @@ def begin_create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -26594,7 +15971,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticSnapshotPolicy, response.json()) + deserialized = _deserialize(_models.BackupVault, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -26612,44 +15989,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticSnapshotPolicy].from_continuation_token( + return LROPoller[_models.BackupVault].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticSnapshotPolicy]( + return LROPoller[_models.BackupVault]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def _update_initial( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicyUpdate, _types.ElasticSnapshotPolicyUpdate, IO[bytes]], + backup_vault_name: str, + body: Union[_models.BackupVaultPatch, _types.BackupVaultPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -26673,10 +16028,10 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_snapshot_policies_update_request( + _request = build_backup_vaults_update_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -26711,9 +16066,6 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -26729,29 +16081,29 @@ def begin_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: _models.ElasticSnapshotPolicyUpdate, + backup_vault_name: str, + body: _models.BackupVaultPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Patch the specified NetApp Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdate + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: Backup Vault object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.BackupVaultPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -26760,29 +16112,29 @@ def begin_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: _types.ElasticSnapshotPolicyUpdate, + backup_vault_name: str, + body: _types.BackupVaultPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Patch the specified NetApp Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticSnapshotPolicyUpdate + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: Backup Vault object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.BackupVaultPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -26791,86 +16143,64 @@ def begin_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, + backup_vault_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Patch the specified NetApp Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Required. + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: Backup Vault object supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def begin_update( self, resource_group_name: str, account_name: str, - snapshot_policy_name: str, - body: Union[_models.ElasticSnapshotPolicyUpdate, _types.ElasticSnapshotPolicyUpdate, IO[bytes]], + backup_vault_name: str, + body: Union[_models.BackupVaultPatch, _types.BackupVaultPatch, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticSnapshotPolicy]: - """Update a ElasticSnapshotPolicy. + ) -> LROPoller[_models.BackupVault]: + """Patch the specified NetApp Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :param body: The resource properties to be updated. Is either a ElasticSnapshotPolicyUpdate - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticSnapshotPolicyUpdate or - ~azure.mgmt.netapp.types.ElasticSnapshotPolicyUpdate or IO[bytes] - :return: An instance of LROPoller that returns ElasticSnapshotPolicy. The ElasticSnapshotPolicy - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str + :param body: Backup Vault object supplied in the body of the operation. Is either a + BackupVaultPatch type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BackupVaultPatch or + ~azure.mgmt.netapp.types.BackupVaultPatch or IO[bytes] + :return: An instance of LROPoller that returns BackupVault. The BackupVault is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticSnapshotPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.BackupVault] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -26878,7 +16208,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -26891,7 +16221,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticSnapshotPolicy, response.json()) + deserialized = _deserialize(_models.BackupVault, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -26909,38 +16239,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticSnapshotPolicy].from_continuation_token( + return LROPoller[_models.BackupVault].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticSnapshotPolicy]( + return LROPoller[_models.BackupVault]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def _delete_initial( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -26955,10 +16265,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_snapshot_policies_delete_request( + _request = build_backup_vaults_delete_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -27002,38 +16312,18 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) def begin_delete( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a ElasticSnapshotPolicy. + """Delete the specified Backup Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str + :param backup_vault_name: The name of the Backup Vault. Required. + :type backup_vault_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -27049,7 +16339,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, + backup_vault_name=backup_vault_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -27084,163 +16374,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( + def list_by_net_app_account( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticSnapshotPolicy"]: - """List ElasticSnapshotPolicy resources by ElasticAccount. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticSnapshotPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticSnapshotPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticSnapshotPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_snapshot_policies_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticSnapshotPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "snapshot_policy_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_elastic_volumes( - self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticVolume"]: - """Get elastic volumes associated with Elastic Snapshot Policy. + ) -> ItemPaged["_models.BackupVault"]: + """List and describe all Backup Vaults in the NetApp account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param snapshot_policy_name: The name of the ElasticSnapshotPolicy. Required. - :type snapshot_policy_name: str - :return: An iterator like instance of ElasticVolume - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticVolume] + :return: An iterator like instance of BackupVault + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupVault] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ElasticVolume]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.BackupVault]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -27253,10 +16404,9 @@ def list_elastic_volumes( def prepare_request(next_link=None): if not next_link: - _request = build_elastic_snapshot_policies_list_elastic_volumes_request( + _request = build_backup_vaults_list_by_net_app_account_request( resource_group_name=resource_group_name, account_name=account_name, - snapshot_policy_name=snapshot_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -27297,7 +16447,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ElasticVolume], + List[_models.BackupVault], deserialized.get("value", []), ) if cls: @@ -27326,14 +16476,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ElasticBackupVaultsOperations: # pylint: disable=docstring-missing-param +class BucketsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_backup_vaults` attribute. + :attr:`buckets` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -27352,33 +16502,54 @@ def __init__(self, *args, **kwargs) -> None: "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def get( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> _models.ElasticBackupVault: - """Get the Elastic Backup Vault. + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any + ) -> _models.Bucket: + """Get the details of the specified volume's bucket. A bucket allows additional services, such as + AI services, connect to the volume data contained in those buckets. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :return: ElasticBackupVault. The ElasticBackupVault is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticBackupVault + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :return: Bucket. The Bucket is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.Bucket :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -27392,12 +16563,14 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ElasticBackupVault] = kwargs.pop("cls", None) + cls: ClsType[_models.Bucket] = kwargs.pop("cls", None) - _request = build_elastic_backup_vaults_get_request( + _request = build_buckets_get_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -27432,7 +16605,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ElasticBackupVault, response.json()) + deserialized = _deserialize(_models.Bucket, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -27447,26 +16620,38 @@ def get( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _create_or_update_initial( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVault, _types.ElasticBackupVault, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.Bucket, _types.Bucket, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -27490,10 +16675,12 @@ def _create_or_update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_backup_vaults_create_or_update_request( + _request = build_buckets_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -27545,29 +16732,37 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _models.ElasticBackupVault, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _models.Bucket, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. + ) -> LROPoller[_models.Bucket]: + """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI + services, connect to the volume data contained in those buckets. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVault + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Required. + :type body: ~azure.mgmt.netapp.models.Bucket :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -27576,29 +16771,37 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _types.ElasticBackupVault, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _types.Bucket, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. + ) -> LROPoller[_models.Bucket]: + """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI + services, connect to the volume data contained in those buckets. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupVault + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Required. + :type body: ~azure.mgmt.netapp.types.Bucket :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -27607,29 +16810,37 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. + ) -> LROPoller[_models.Bucket]: + """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI + services, connect to the volume data contained in those buckets. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -27642,51 +16853,67 @@ def begin_create_or_update( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVault, _types.ElasticBackupVault, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.Bucket, _types.Bucket, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Create or update the specified Elastic Backup Vault in the Elastic NetApp account. + ) -> LROPoller[_models.Bucket]: + """Creates or updates a bucket for a volume. A bucket allows additional services, such as AI + services, connect to the volume data contained in those buckets. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: Resource create parameters. Is either a ElasticBackupVault type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVault or - ~azure.mgmt.netapp.types.ElasticBackupVault or IO[bytes] - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Is either a Bucket type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.Bucket or ~azure.mgmt.netapp.types.Bucket or IO[bytes] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupVault] = kwargs.pop("cls", None) + cls: ClsType[_models.Bucket] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -27694,7 +16921,9 @@ def begin_create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -27707,7 +16936,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupVault, response.json()) + deserialized = _deserialize(_models.Bucket, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -27725,13 +16954,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticBackupVault].from_continuation_token( + return LROPoller[_models.Bucket].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticBackupVault]( + return LROPoller[_models.Bucket]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -27743,26 +16972,38 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _update_initial( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVaultUpdate, _types.ElasticBackupVaultUpdate, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.BucketPatch, _types.BucketPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -27786,10 +17027,12 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_backup_vaults_update_request( + _request = build_buckets_update_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -27842,29 +17085,36 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _models.ElasticBackupVaultUpdate, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _models.BucketPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. + ) -> LROPoller[_models.Bucket]: + """Updates the details of a volume bucket. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVaultUpdate + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Required. + :type body: ~azure.mgmt.netapp.models.BucketPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -27873,29 +17123,36 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: _types.ElasticBackupVaultUpdate, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _types.BucketPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. + ) -> LROPoller[_models.Bucket]: + """Updates the details of a volume bucket. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupVaultUpdate + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Required. + :type body: ~azure.mgmt.netapp.types.BucketPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -27904,29 +17161,36 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. + ) -> LROPoller[_models.Bucket]: + """Updates the details of a volume bucket. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -27939,51 +17203,67 @@ def begin_update( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - body: Union[_models.ElasticBackupVaultUpdate, _types.ElasticBackupVaultUpdate, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.BucketPatch, _types.BucketPatch, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticBackupVault]: - """Patch the specified NetApp Elastic Backup Vault. + ) -> LROPoller[_models.Bucket]: + """Updates the details of a volume bucket. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param body: The resource properties to be updated. Is either a ElasticBackupVaultUpdate type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupVaultUpdate or - ~azure.mgmt.netapp.types.ElasticBackupVaultUpdate or IO[bytes] - :return: An instance of LROPoller that returns ElasticBackupVault. The ElasticBackupVault is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupVault] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket details including user details, and the volume path that should be + mounted inside the bucket. Is either a BucketPatch type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BucketPatch or ~azure.mgmt.netapp.types.BucketPatch or + IO[bytes] + :return: An instance of LROPoller that returns Bucket. The Bucket is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Bucket] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupVault] = kwargs.pop("cls", None) + cls: ClsType[_models.Bucket] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -27991,7 +17271,9 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -28004,7 +17286,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupVault, response.json()) + deserialized = _deserialize(_models.Bucket, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -28022,13 +17304,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticBackupVault].from_continuation_token( + return LROPoller[_models.Bucket].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticBackupVault]( + return LROPoller[_models.Bucket]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -28040,20 +17322,36 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _delete_initial( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -28068,10 +17366,12 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_backup_vaults_delete_request( + _request = build_buckets_delete_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -28104,6 +17404,9 @@ def _delete_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -28123,30 +17426,50 @@ def _delete_initial( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", + "volume_name", + "bucket_name", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_delete( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any ) -> LROPoller[None]: - """Delete the specified Elastic Backup Vault. + """Delete a volume's bucket. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -28162,7 +17485,9 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -28171,261 +17496,32 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticBackupVault"]: - """List and describe all Elastic Backup Vaults in the elastic account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticBackupVault - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticBackupVault] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticBackupVault]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_backup_vaults_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticBackupVault], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ElasticBackupPoliciesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_backup_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "backup_policy_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def get( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any - ) -> _models.ElasticBackupPolicy: - """Get the Elastic Backup Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :return: ElasticBackupPolicy. The ElasticBackupPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ElasticBackupPolicy] = kwargs.pop("cls", None) - - _request = build_elastic_backup_policies_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ElasticBackupPolicy, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return deserialized # type: ignore + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @distributed_trace @api_version_validation( method_added_on="2025-12-15-preview", params_added_on={ @@ -28434,28 +17530,52 @@ def get( "subscription_id", "resource_group_name", "account_name", - "backup_policy_name", - "content_type", + "pool_name", + "volume_name", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicy, _types.ElasticBackupPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def list( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> ItemPaged["_models.Bucket"]: + """Describes all buckets belonging to a volume. Buckets allow additional services, such as AI + services, connect to the volume data contained in those buckets. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An iterator like instance of Bucket + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Bucket] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Bucket]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -28464,159 +17584,196 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def prepare_request(next_link=None): + if not next_link: - _request = build_elastic_backup_policies_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_buckets_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Bucket], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response = pipeline_response.http_response - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @overload - def begin_create_or_update( + def generate_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _models.ElasticBackupPolicy, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _models.BucketCredentialsExpiry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. + ) -> _models.BucketGenerateCredentials: + """Generate the access key and secret key used for accessing the specified volume bucket. Also + return expiry date and time of key pair (in UTC). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicy + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket's Access and Secret key pair expiry time expressed as the number of + days from now. Required. + :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with + MutableMapping + :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def generate_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _types.ElasticBackupPolicy, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _types.BucketCredentialsExpiry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. + ) -> _models.BucketGenerateCredentials: + """Generate the access key and secret key used for accessing the specified volume bucket. Also + return expiry date and time of key pair (in UTC). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupPolicy + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket's Access and Secret key pair expiry time expressed as the number of + days from now. Required. + :type body: ~azure.mgmt.netapp.types.BucketCredentialsExpiry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with + MutableMapping + :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def generate_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. + ) -> _models.BucketGenerateCredentials: + """Generate the access key and secret key used for accessing the specified volume bucket. Also + return expiry date and time of key pair (in UTC). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket's Access and Secret key pair expiry time expressed as the number of + days from now. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with + MutableMapping + :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials :raises ~azure.core.exceptions.HttpResponseError: """ @@ -28629,98 +17786,132 @@ def begin_create_or_update( "subscription_id", "resource_group_name", "account_name", - "backup_policy_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_create_or_update( + def generate_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicy, _types.ElasticBackupPolicy, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.BucketCredentialsExpiry, _types.BucketCredentialsExpiry, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Create or update the specified Elastic Backup Policy in the NetApp account. + ) -> _models.BucketGenerateCredentials: + """Generate the access key and secret key used for accessing the specified volume bucket. Also + return expiry date and time of key pair (in UTC). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: Resource create parameters. Is either a ElasticBackupPolicy type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicy or - ~azure.mgmt.netapp.types.ElasticBackupPolicy or IO[bytes] - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The bucket's Access and Secret key pair expiry time expressed as the number of + days from now. Is either a BucketCredentialsExpiry type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry or + ~azure.mgmt.netapp.types.BucketCredentialsExpiry or IO[bytes] + :return: BucketGenerateCredentials. The BucketGenerateCredentials is compatible with + MutableMapping + :rtype: ~azure.mgmt.netapp.models.BucketGenerateCredentials :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupPolicy] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - backup_policy_name=backup_policy_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.BucketGenerateCredentials] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupPolicy, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_buckets_generate_credentials_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.ElasticBackupPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ElasticBackupPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.BucketGenerateCredentials, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @api_version_validation( method_added_on="2025-12-15-preview", @@ -28730,26 +17921,37 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "account_name", - "backup_policy_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", - "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _update_initial( + def _generate_akv_credentials_initial( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicyUpdate, _types.ElasticBackupPolicyUpdate, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.BucketCredentialsExpiry, _types.BucketCredentialsExpiry, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -28773,10 +17975,12 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_backup_policies_update_request( + _request = build_buckets_generate_akv_credentials_request( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -28797,7 +18001,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -28810,9 +18014,11 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -28822,95 +18028,113 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_generate_akv_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _models.ElasticBackupPolicyUpdate, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _models.BucketCredentialsExpiry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. + ) -> LROPoller[None]: + """Generate the access key and secret key used for accessing the specified volume bucket and store + in Azure Key Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicyUpdate + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_generate_akv_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: _types.ElasticBackupPolicyUpdate, + pool_name: str, + volume_name: str, + bucket_name: str, + body: _types.BucketCredentialsExpiry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. + ) -> LROPoller[None]: + """Generate the access key and secret key used for accessing the specified volume bucket and store + in Azure Key Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackupPolicyUpdate + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.netapp.types.BucketCredentialsExpiry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_generate_akv_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. + ) -> LROPoller[None]: + """Generate the access key and secret key used for accessing the specified volume bucket and store + in Azure Key Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Required. + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The content of the action request. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -28923,59 +18147,76 @@ def begin_update( "subscription_id", "resource_group_name", "account_name", - "backup_policy_name", + "pool_name", + "volume_name", + "bucket_name", "content_type", - "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_update( + def begin_generate_akv_credentials( self, resource_group_name: str, account_name: str, - backup_policy_name: str, - body: Union[_models.ElasticBackupPolicyUpdate, _types.ElasticBackupPolicyUpdate, IO[bytes]], + pool_name: str, + volume_name: str, + bucket_name: str, + body: Union[_models.BucketCredentialsExpiry, _types.BucketCredentialsExpiry, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticBackupPolicy]: - """Patch the specified NetApp Elastic Backup Policy. + ) -> LROPoller[None]: + """Generate the access key and secret key used for accessing the specified volume bucket and store + in Azure Key Vault. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str - :param body: The resource properties to be updated. Is either a ElasticBackupPolicyUpdate type - or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackupPolicyUpdate or - ~azure.mgmt.netapp.types.ElasticBackupPolicyUpdate or IO[bytes] - :return: An instance of LROPoller that returns ElasticBackupPolicy. The ElasticBackupPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackupPolicy] + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str + :param body: The content of the action request. Is either a BucketCredentialsExpiry type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.BucketCredentialsExpiry or + ~azure.mgmt.netapp.types.BucketCredentialsExpiry or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackupPolicy] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._generate_akv_credentials_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -28986,12 +18227,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackupPolicy, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -29006,15 +18244,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticBackupPolicy].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticBackupPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @api_version_validation( method_added_on="2025-12-15-preview", @@ -29024,20 +18260,36 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "account_name", - "backup_policy_name", + "pool_name", + "volume_name", + "bucket_name", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _delete_initial( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + def _refresh_certificate_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -29052,10 +18304,12 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_backup_policies_delete_request( + _request = build_buckets_refresh_certificate_request( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -29074,7 +18328,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -29087,9 +18341,11 @@ def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -29107,30 +18363,51 @@ def _delete_initial( "subscription_id", "resource_group_name", "account_name", - "backup_policy_name", + "pool_name", + "volume_name", + "bucket_name", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_delete( - self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any + def begin_refresh_certificate( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + bucket_name: str, + **kwargs: Any ) -> LROPoller[None]: - """Delete the specified Elastic Policy. + """This operation will fetch the certificate from Azure Key Vault and install it on the bucket + server. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_policy_name: The name of the ElasticBackupPolicy. Required. - :type backup_policy_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param bucket_name: The name of the bucket. Required. + :type bucket_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -29143,10 +18420,12 @@ def begin_delete( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._refresh_certificate_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_policy_name=backup_policy_name, + pool_name=pool_name, + volume_name=volume_name, + bucket_name=bucket_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -29180,131 +18459,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_elastic_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticBackupPolicy"]: - """List and describe all Elastic Backup Policies in the elastic account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. - :type account_name: str - :return: An iterator like instance of ElasticBackupPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticBackupPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ElasticBackupPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_elastic_backup_policies_list_by_elastic_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ElasticBackupPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - -class ElasticBackupsOperations: # pylint: disable=docstring-missing-param +class CachesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`elastic_backups` attribute. + :attr:`caches` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -29323,36 +18486,44 @@ def __init__(self, *args, **kwargs) -> None: "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def get( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any - ) -> _models.ElasticBackup: - """Get the specified Elastic Backup under Elastic Backup Vault. + self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any + ) -> _models.Cache: + """Get the details of the specified Cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :return: ElasticBackup. The ElasticBackup is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ElasticBackup + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :return: Cache. The Cache is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.Cache :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -29366,13 +18537,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ElasticBackup] = kwargs.pop("cls", None) + cls: ClsType[_models.Cache] = kwargs.pop("cls", None) - _request = build_elastic_backups_get_request( + _request = build_caches_get_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -29407,7 +18578,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ElasticBackup, response.json()) + deserialized = _deserialize(_models.Cache, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -29422,28 +18593,36 @@ def get( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _create_or_update_initial( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], + pool_name: str, + cache_name: str, + body: Union[_models.Cache, _types.Cache, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -29467,11 +18646,11 @@ def _create_or_update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_backups_create_or_update_request( + _request = build_caches_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -29523,32 +18702,32 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: _models.ElasticBackup, + pool_name: str, + cache_name: str, + body: _models.Cache, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Create or update the specified Cache within the Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup + :type body: ~azure.mgmt.netapp.models.Cache :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -29557,32 +18736,32 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: _types.ElasticBackup, + pool_name: str, + cache_name: str, + body: _types.Cache, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Create or update the specified Cache within the Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackup + :type body: ~azure.mgmt.netapp.types.Cache :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -29591,32 +18770,32 @@ def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, + cache_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Create or update the specified Cache within the Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :param body: Resource create parameters. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -29629,55 +18808,61 @@ def begin_create_or_update( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_create_or_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], + pool_name: str, + cache_name: str, + body: Union[_models.Cache, _types.Cache, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Create an elastic backup under the elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Create or update the specified Cache within the Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: Resource create parameters. Is either a ElasticBackup type or a IO[bytes] type. - Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup or ~azure.mgmt.netapp.types.ElasticBackup - or IO[bytes] - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :param body: Resource create parameters. Is either a Cache type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.Cache or ~azure.mgmt.netapp.types.Cache or IO[bytes] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackup] = kwargs.pop("cls", None) + cls: ClsType[_models.Cache] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -29685,8 +18870,8 @@ def begin_create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -29699,7 +18884,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackup, response.json()) + deserialized = _deserialize(_models.Cache, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -29717,13 +18902,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticBackup].from_continuation_token( + return LROPoller[_models.Cache].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticBackup]( + return LROPoller[_models.Cache]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -29735,28 +18920,36 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _update_initial( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], + pool_name: str, + cache_name: str, + body: Union[_models.CacheUpdate, _types.CacheUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -29780,11 +18973,11 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_elastic_backups_update_request( + _request = build_caches_update_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -29837,32 +19030,32 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: _models.ElasticBackup, + pool_name: str, + cache_name: str, + body: _models.CacheUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Patch the specified Cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup + :type body: ~azure.mgmt.netapp.models.CacheUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -29871,32 +19064,32 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: _types.ElasticBackup, + pool_name: str, + cache_name: str, + body: _types.CacheUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Patch the specified Cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ElasticBackup + :type body: ~azure.mgmt.netapp.types.CacheUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -29905,32 +19098,32 @@ def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, + pool_name: str, + cache_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Patch the specified Cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :param body: The resource properties to be updated. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -29943,55 +19136,63 @@ def begin_update( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_update( self, resource_group_name: str, account_name: str, - backup_vault_name: str, - backup_name: str, - body: Union[_models.ElasticBackup, _types.ElasticBackup, IO[bytes]], + pool_name: str, + cache_name: str, + body: Union[_models.CacheUpdate, _types.CacheUpdate, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ElasticBackup]: - """Patch an elastic Backup under the Elastic Backup Vault. + ) -> LROPoller[_models.Cache]: + """Patch the specified Cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str - :param body: The resource properties to be updated. Is either a ElasticBackup type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ElasticBackup or ~azure.mgmt.netapp.types.ElasticBackup - or IO[bytes] - :return: An instance of LROPoller that returns ElasticBackup. The ElasticBackup is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ElasticBackup] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :param body: The resource properties to be updated. Is either a CacheUpdate type or a IO[bytes] + type. Required. + :type body: ~azure.mgmt.netapp.models.CacheUpdate or ~azure.mgmt.netapp.types.CacheUpdate or + IO[bytes] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticBackup] = kwargs.pop("cls", None) + cls: ClsType[_models.Cache] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -29999,8 +19200,8 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -30013,7 +19214,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ElasticBackup, response.json()) + deserialized = _deserialize(_models.Cache, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -30031,13 +19232,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ElasticBackup].from_continuation_token( + return LROPoller[_models.Cache].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ElasticBackup]( + return LROPoller[_models.Cache]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -30049,21 +19250,29 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _delete_initial( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -30078,11 +19287,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_elastic_backups_delete_request( + _request = build_caches_delete_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -30134,33 +19343,41 @@ def _delete_initial( "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", - "backup_name", + "pool_name", + "cache_name", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_delete( - self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a ElasticBackup. + """Delete the specified cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :param backup_name: The name of the ElasticBackup. Required. - :type backup_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -30176,8 +19393,8 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, - backup_name=backup_name, + pool_name=pool_name, + cache_name=cache_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -30213,46 +19430,53 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2025-12-15-preview", + method_added_on="2026-01-01", params_added_on={ - "2025-12-15-preview": [ + "2026-01-01": [ "api_version", "subscription_id", "resource_group_name", "account_name", - "backup_vault_name", + "pool_name", "accept", ] }, api_versions_list=[ - "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def list_by_vault( - self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticBackup"]: - """List all elastic backups Under an elastic Backup Vault. + def list( + self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.Cache"]: + """List all Caches within the Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of the ElasticAccount. Required. + :param account_name: The name of the NetApp account. Required. :type account_name: str - :param backup_vault_name: The name of the ElasticBackupVault. Required. - :type backup_vault_name: str - :return: An iterator like instance of ElasticBackup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ElasticBackup] + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :return: An iterator like instance of Cache + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ElasticBackup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Cache]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -30265,10 +19489,10 @@ def list_by_vault( def prepare_request(next_link=None): if not next_link: - _request = build_elastic_backups_list_by_vault_request( + _request = build_caches_list_request( resource_group_name=resource_group_name, account_name=account_name, - backup_vault_name=backup_vault_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -30309,7 +19533,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ElasticBackup], + List[_models.Cache], deserialized.get("value", []), ) if cls: @@ -30333,302 +19557,10 @@ def get_next(next_link=None): ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ActiveDirectoryConfigsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`active_directory_configs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NetAppManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def get( - self, resource_group_name: str, active_directory_config_name: str, **kwargs: Any - ) -> _models.ActiveDirectoryConfig: - """Get the details of the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :return: ActiveDirectoryConfig. The ActiveDirectoryConfig is compatible with MutableMapping - :rtype: ~azure.mgmt.netapp.models.ActiveDirectoryConfig - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ActiveDirectoryConfig] = kwargs.pop("cls", None) - - _request = build_active_directory_configs_get_request( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ActiveDirectoryConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={ - "2025-12-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "active_directory_config_name", - "content_type", - "accept", - ] - }, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfig, _types.ActiveDirectoryConfig, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_active_directory_configs_create_or_update_request( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: _models.ActiveDirectoryConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfig - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: _types.ActiveDirectoryConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Required. - :type body: ~azure.mgmt.netapp.types.ActiveDirectoryConfig - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace @api_version_validation( method_added_on="2025-12-15-preview", @@ -30637,94 +19569,106 @@ def begin_create_or_update( "api_version", "subscription_id", "resource_group_name", - "active_directory_config_name", - "content_type", + "account_name", + "pool_name", + "cache_name", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_create_or_update( - self, - resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfig, _types.ActiveDirectoryConfig, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Create or update the specified active directory configuration. + def list_peering_passphrases( + self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any + ) -> _models.PeeringPassphrases: + """This operation will list the cluster peering command, cluster peering passphrase and the + vserver peering command. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: Resource create parameters. Is either a ActiveDirectoryConfig type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfig or - ~azure.mgmt.netapp.types.ActiveDirectoryConfig or IO[bytes] - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :return: PeeringPassphrases. The PeeringPassphrases is compatible with MutableMapping + :rtype: ~azure.mgmt.netapp.models.PeeringPassphrases :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ActiveDirectoryConfig] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ActiveDirectoryConfig, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + cls: ClsType[_models.PeeringPassphrases] = kwargs.pop("cls", None) + _request = build_caches_list_peering_passphrases_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + cache_name=cache_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.ActiveDirectoryConfig].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ActiveDirectoryConfig]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.PeeringPassphrases, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @api_version_validation( method_added_on="2025-12-15-preview", @@ -30733,25 +19677,37 @@ def get_long_running_output(pipeline_response): "api_version", "subscription_id", "resource_group_name", - "active_directory_config_name", + "account_name", + "pool_name", + "cache_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _update_initial( + def _pool_change_initial( self, resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfigUpdate, _types.ActiveDirectoryConfigUpdate, IO[bytes]], + account_name: str, + pool_name: str, + cache_name: str, + body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -30775,9 +19731,11 @@ def _update_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_active_directory_configs_update_request( + _request = build_caches_pool_change_request( resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, + account_name=account_name, + pool_name=pool_name, + cache_name=cache_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -30812,9 +19770,6 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -30826,86 +19781,104 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_pool_change( self, resource_group_name: str, - active_directory_config_name: str, - body: _models.ActiveDirectoryConfigUpdate, + account_name: str, + pool_name: str, + cache_name: str, + body: _models.PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. + ) -> LROPoller[_models.Cache]: + """Moves Cache to another Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfigUpdate + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :param body: Move cache to the pool supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.PoolChangeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_pool_change( self, resource_group_name: str, - active_directory_config_name: str, - body: _types.ActiveDirectoryConfigUpdate, + account_name: str, + pool_name: str, + cache_name: str, + body: _types.PoolChangeRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. + ) -> LROPoller[_models.Cache]: + """Moves Cache to another Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Required. - :type body: ~azure.mgmt.netapp.types.ActiveDirectoryConfigUpdate + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :param body: Move cache to the pool supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.types.PoolChangeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_pool_change( self, resource_group_name: str, - active_directory_config_name: str, + account_name: str, + pool_name: str, + cache_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. + ) -> LROPoller[_models.Cache]: + """Moves Cache to another Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Required. + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :param body: Move cache to the pool supplied in the body of the operation. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -30917,55 +19890,73 @@ def begin_update( "api_version", "subscription_id", "resource_group_name", - "active_directory_config_name", + "account_name", + "pool_name", + "cache_name", "content_type", "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_update( + def begin_pool_change( self, resource_group_name: str, - active_directory_config_name: str, - body: Union[_models.ActiveDirectoryConfigUpdate, _types.ActiveDirectoryConfigUpdate, IO[bytes]], + account_name: str, + pool_name: str, + cache_name: str, + body: Union[_models.PoolChangeRequest, _types.PoolChangeRequest, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConfig]: - """Patch the specified active directory configuration. + ) -> LROPoller[_models.Cache]: + """Moves Cache to another Capacity Pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :param body: The resource properties to be updated. Is either a ActiveDirectoryConfigUpdate - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.netapp.models.ActiveDirectoryConfigUpdate or - ~azure.mgmt.netapp.types.ActiveDirectoryConfigUpdate or IO[bytes] - :return: An instance of LROPoller that returns ActiveDirectoryConfig. The ActiveDirectoryConfig - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ActiveDirectoryConfig] + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :param body: Move cache to the pool supplied in the body of the operation. Is either a + PoolChangeRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.PoolChangeRequest or + ~azure.mgmt.netapp.types.PoolChangeRequest or IO[bytes] + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ActiveDirectoryConfig] = kwargs.pop("cls", None) + cls: ClsType[_models.Cache] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._pool_change_initial( resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, + account_name=account_name, + pool_name=pool_name, + cache_name=cache_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -30978,7 +19969,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ActiveDirectoryConfig, response.json()) + deserialized = _deserialize(_models.Cache, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -30996,13 +19987,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ActiveDirectoryConfig].from_continuation_token( + return LROPoller[_models.Cache].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ActiveDirectoryConfig]( + return LROPoller[_models.Cache]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -31013,20 +20004,31 @@ def get_long_running_output(pipeline_response): "api_version", "subscription_id", "resource_group_name", - "active_directory_config_name", + "account_name", + "pool_name", + "cache_name", + "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def _delete_initial( - self, resource_group_name: str, active_directory_config_name: str, **kwargs: Any + def _reset_smb_password_initial( + self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -31041,9 +20043,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_active_directory_configs_delete_request( + _request = build_caches_reset_smb_password_request( resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, + account_name=account_name, + pool_name=pool_name, + cache_name=cache_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -31062,7 +20066,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -31094,43 +20098,61 @@ def _delete_initial( "api_version", "subscription_id", "resource_group_name", - "active_directory_config_name", + "account_name", + "pool_name", + "cache_name", + "accept", ] }, api_versions_list=[ "2025-12-15-preview", + "2026-01-01", "2026-01-15-preview", + "2026-03-01", "2026-03-15-preview", + "2026-04-01", "2026-04-15-preview", + "2026-05-01", "2026-05-15-preview", + "2026-06-01", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) - def begin_delete( - self, resource_group_name: str, active_directory_config_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete the specified Active Directory configuration. + def begin_reset_smb_password( + self, resource_group_name: str, account_name: str, pool_name: str, cache_name: str, **kwargs: Any + ) -> LROPoller[_models.Cache]: + """Resets the SMB password for the cache. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param active_directory_config_name: The name of the ActiveDirectoryConfig. Required. - :type active_directory_config_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param cache_name: The name of the cache resource. Required. + :type cache_name: str + :return: An instance of LROPoller that returns Cache. The Cache is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Cache] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.Cache] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._reset_smb_password_initial( resource_group_name=resource_group_name, - active_directory_config_name=active_directory_config_name, + account_name=account_name, + pool_name=pool_name, + cache_name=cache_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -31139,9 +20161,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Cache, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -31156,229 +20181,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.Cache].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.ActiveDirectoryConfig"]: - """List all active directory configurations within the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of ActiveDirectoryConfig - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ActiveDirectoryConfig]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_active_directory_configs_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ActiveDirectoryConfig], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2025-12-15-preview", - params_added_on={"2025-12-15-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=[ - "2025-12-15-preview", - "2026-01-15-preview", - "2026-03-15-preview", - "2026-04-15-preview", - "2026-05-15-preview", - "2026-06-15-preview", - ], - ) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ActiveDirectoryConfig"]: - """List all active directory configurations within the subscription. - - :return: An iterator like instance of ActiveDirectoryConfig - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ActiveDirectoryConfig] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ActiveDirectoryConfig]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_active_directory_configs_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ActiveDirectoryConfig], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + return LROPoller[_models.Cache]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) class NetAppResourceQuotaLimitsOperations: # pylint: disable=docstring-missing-param @@ -32087,6 +20898,9 @@ def get_long_running_output(pipeline_response): "2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def _update_initial( @@ -32268,6 +21082,9 @@ def begin_update( "2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", ], ) def begin_update( @@ -33390,7 +22207,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2026-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] }, - api_versions_list=["2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview"], + api_versions_list=[ + "2026-04-15-preview", + "2026-05-15-preview", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], ) def _refresh_ldap_bind_password_initial( self, resource_group_name: str, account_name: str, **kwargs: Any @@ -33461,7 +22285,14 @@ def _refresh_ldap_bind_password_initial( params_added_on={ "2026-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name"] }, - api_versions_list=["2026-04-15-preview", "2026-05-15-preview", "2026-06-15-preview"], + api_versions_list=[ + "2026-04-15-preview", + "2026-05-15-preview", + "2026-06-15-preview", + "2026-07-01", + "2026-07-15-preview", + "2026-08-01", + ], ) def begin_refresh_ldap_bind_password( self, resource_group_name: str, account_name: str, **kwargs: Any diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/types.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/types.py index b4a2d133e57a..43a790abc80d 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/types.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/types.py @@ -33,22 +33,7 @@ CoolAccessTieringPolicy, CreatedByType, CredentialsStatus, - DayOfWeek, DesiredRansomwareProtectionState, - ElasticBackupPolicyState, - ElasticBackupType, - ElasticKeyVaultStatus, - ElasticNfsv3Access, - ElasticNfsv4Access, - ElasticPoolEncryptionKeySource, - ElasticProtocolType, - ElasticResourceAvailabilityStatus, - ElasticRootAccess, - ElasticServiceLevel, - ElasticSmbEncryption, - ElasticUnixAccessRule, - ElasticVolumePolicyEnforcement, - ElasticVolumeRestorationState, EnableSubvolumes, EnableWriteBackState, EncryptionKeySource, @@ -62,7 +47,6 @@ KerberosState, KeySource, KeyVaultStatus, - LargeVolumeType, LdapServerType, LdapState, ManagedServiceIdentityType, @@ -71,7 +55,6 @@ NetAppProvisioningState, NetworkFeatures, OnCertificateConflictAction, - PolicyStatus, ProtocolTypes, QosType, QuotaType, @@ -84,11 +67,8 @@ SmbAccessBasedEnumeration, SmbEncryptionState, SmbNonBrowsable, - SnapshotDirectoryVisibility, - SnapshotUsage, VolumeLanguage, VolumeReplicationRelationshipStatus, - VolumeSize, VolumeStorageToNetworkProximity, ) @@ -117,6 +97,30 @@ class AccountEncryption(TypedDict, total=False): """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" +class AccountEncryptionPatch(TypedDict, total=False): + """Encryption settings for PATCH operations (no default values). + + :ivar keySource: The encryption keySource (provider). Possible values (case-insensitive): + Microsoft.NetApp, Microsoft.KeyVault. Known values are: "Microsoft.NetApp" and + "Microsoft.KeyVault". + :vartype keySource: Union[str, "KeySource"] + :ivar keyVaultProperties: Properties provided by KeVault. Applicable if keySource is + 'Microsoft.KeyVault'. + :vartype keyVaultProperties: "KeyVaultPropertiesPatch" + :ivar identity: Identity used to authenticate to KeyVault. Applicable if keySource is + 'Microsoft.KeyVault'. + :vartype identity: "EncryptionIdentityPatch" + """ + + keySource: Union[str, "KeySource"] + """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.NetApp, + Microsoft.KeyVault. Known values are: \"Microsoft.NetApp\" and \"Microsoft.KeyVault\".""" + keyVaultProperties: "KeyVaultPropertiesPatch" + """Properties provided by KeVault. Applicable if keySource is 'Microsoft.KeyVault'.""" + identity: "EncryptionIdentityPatch" + """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" + + class AccountProperties(TypedDict, total=False): """NetApp account properties. @@ -124,8 +128,6 @@ class AccountProperties(TypedDict, total=False): :vartype provisioningState: str :ivar activeDirectories: Active Directories. :vartype activeDirectories: list["ActiveDirectory"] - :ivar entraIdConfig: Entra ID configuration for the account. - :vartype entraIdConfig: "EntraIdConfig" :ivar encryption: Encryption settings. :vartype encryption: "AccountEncryption" :ivar disableShowmount: Shows the status of disableShowmount for all volumes under the @@ -145,8 +147,6 @@ class AccountProperties(TypedDict, total=False): """Azure lifecycle management.""" activeDirectories: list["ActiveDirectory"] """Active Directories.""" - entraIdConfig: "EntraIdConfig" - """Entra ID configuration for the account.""" encryption: "AccountEncryption" """Encryption settings.""" disableShowmount: Optional[bool] @@ -164,27 +164,23 @@ class AccountPropertiesPatch(TypedDict, total=False): """NetApp account patch properties. :ivar activeDirectories: Active Directories. - :vartype activeDirectories: list["ActiveDirectory"] + :vartype activeDirectories: list["ActiveDirectoryPatch"] :ivar encryption: Encryption settings. - :vartype encryption: "AccountEncryption" + :vartype encryption: "AccountEncryptionPatch" :ivar nfsV4IDDomain: Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. :vartype nfsV4IDDomain: str - :ivar entraIdConfig: Entra ID configuration for the account. - :vartype entraIdConfig: "EntraIdConfigPatch" :ivar ldapConfiguration: LDAP Configuration for the account. :vartype ldapConfiguration: "LdapConfigurationPatch" """ - activeDirectories: list["ActiveDirectory"] + activeDirectories: list["ActiveDirectoryPatch"] """Active Directories.""" - encryption: "AccountEncryption" + encryption: "AccountEncryptionPatch" """Encryption settings.""" nfsV4IDDomain: Optional[str] """Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes.""" - entraIdConfig: "EntraIdConfigPatch" - """Entra ID configuration for the account.""" ldapConfiguration: "LdapConfigurationPatch" """LDAP Configuration for the account.""" @@ -313,196 +309,21 @@ class ActiveDirectory(TypedDict, total=False): separated IPv4 addresses can be passed.""" -class Resource(TypedDict, total=False): - """Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - """ - - id: str - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" - name: str - """The name of the resource.""" - type: str - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - systemData: "SystemData" - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class TrackedResource(Resource): - """Tracked Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - tags: dict[str, str] - """Resource tags.""" - location: Required[str] - """The geo-location where the resource lives. Required.""" - - -class ActiveDirectoryConfig(TrackedResource): - """Active Directory Configuration resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ActiveDirectoryConfigProperties" - :ivar etag: "If etag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). - :vartype etag: str - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: "ManagedServiceIdentity" - """ - - properties: "ActiveDirectoryConfigProperties" - """The resource-specific properties for this resource.""" - etag: str - """\"If etag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" - identity: "ManagedServiceIdentity" - """The managed service identities assigned to this resource.""" - - -class ActiveDirectoryConfigProperties(TypedDict, total=False): - """Active Directory Configuration properties. +class ActiveDirectoryPatch(TypedDict, total=False): + """Active Directory settings for PATCH operations (no default values). - :ivar userName: A domain user account with permission to create machine accounts. - :vartype userName: str - :ivar dns: An array of DNS server IP addresses(IPv4 only) for the Active Directory. - :vartype dns: list[str] - :ivar smbServerName: NetBIOS name of the SMB server. This name will be registered as a computer - account in the AD and used to mount volumes. - :vartype smbServerName: str - :ivar organizationalUnit: The Organizational Unit (OU) within the Windows Active Directory. - :vartype organizationalUnit: str - :ivar site: The Active Directory site the service will limit Domain Controller discovery to. - Required. - :vartype site: str - :ivar backupOperators: Users to be added to the Built-in Backup Operator active directory - group. A list of unique usernames without domain specifier. - :vartype backupOperators: list[str] - :ivar administrators: Users to be added to the Built-in Administrators active directory group. - A list of unique usernames without domain specifier. - :vartype administrators: list[str] - :ivar securityOperators: Domain Users in the Active directory to be given SecurityPrivilege - privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames - without domain specifier. - :vartype securityOperators: list[str] - :ivar activeDirectoryStatus: Status of the Active Directory. Known values are: "Created", - "InUse", "Deleted", "Error", and "Updating". - :vartype activeDirectoryStatus: Union[str, "ActiveDirectoryStatus"] - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - :ivar domain: Name of the Active Directory domain. Required. + :ivar activeDirectoryId: Id of the Active Directory. + :vartype activeDirectoryId: str + :ivar username: A domain user account with permission to create machine accounts. + :vartype username: str + :ivar password: Plain text password of Active Directory domain administrator, value is masked + in the response. + :vartype password: str + :ivar domain: Name of the Active Directory domain. :vartype domain: str - :ivar secretPassword: Access password from Azure KeyVault Secrets to connect Active Directory. - Required. - :vartype secretPassword: "SecretPassword" - """ - - userName: str - """A domain user account with permission to create machine accounts.""" - dns: list[str] - """An array of DNS server IP addresses(IPv4 only) for the Active Directory.""" - smbServerName: str - """NetBIOS name of the SMB server. This name will be registered as a computer account in the AD - and used to mount volumes.""" - organizationalUnit: str - """The Organizational Unit (OU) within the Windows Active Directory.""" - site: Required[str] - """The Active Directory site the service will limit Domain Controller discovery to. Required.""" - backupOperators: list[str] - """Users to be added to the Built-in Backup Operator active directory group. A list of unique - usernames without domain specifier.""" - administrators: list[str] - """Users to be added to the Built-in Administrators active directory group. A list of unique - usernames without domain specifier.""" - securityOperators: list[str] - """Domain Users in the Active directory to be given SecurityPrivilege privilege (Needed for SMB - Continuously available shares for SQL). A list of unique usernames without domain specifier.""" - activeDirectoryStatus: Union[str, "ActiveDirectoryStatus"] - """Status of the Active Directory. Known values are: \"Created\", \"InUse\", \"Deleted\", - \"Error\", and \"Updating\".""" - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - domain: Required[str] - """Name of the Active Directory domain. Required.""" - secretPassword: Required["SecretPassword"] - """Access password from Azure KeyVault Secrets to connect Active Directory. Required.""" - - -class ActiveDirectoryConfigUpdate(TypedDict, total=False): - """The type used for update operations of the ActiveDirectoryConfig. - - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: "ManagedServiceIdentity" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ActiveDirectoryConfigUpdateProperties" - """ - - identity: "ManagedServiceIdentity" - """The managed service identities assigned to this resource.""" - tags: dict[str, str] - """Resource tags.""" - properties: "ActiveDirectoryConfigUpdateProperties" - """The resource-specific properties for this resource.""" - - -class ActiveDirectoryConfigUpdateProperties(TypedDict, total=False): - """The updatable properties of the ActiveDirectoryConfig. - - :ivar userName: A domain user account with permission to create machine accounts. - :vartype userName: str - :ivar dns: An array of DNS server IP addresses(IPv4 only) for the Active Directory. - :vartype dns: list[str] + :ivar dns: Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory + domain. + :vartype dns: str :ivar smbServerName: NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes. :vartype smbServerName: str @@ -516,20 +337,49 @@ class ActiveDirectoryConfigUpdateProperties(TypedDict, total=False): :ivar administrators: Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier. :vartype administrators: list[str] - :ivar securityOperators: Domain Users in the Active directory to be given SecurityPrivilege + :ivar kdcIP: kdc server IP address for the active directory machine. This optional parameter is + used only while creating kerberos volume. + :vartype kdcIP: str + :ivar adName: Name of the active directory machine. This optional parameter is used only while + creating kerberos volume. + :vartype adName: str + :ivar serverRootCACertificate: When LDAP over SSL/TLS is enabled, the LDAP client is required + to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, + this optional parameter is used only for dual protocol with LDAP user-mapping volumes. + :vartype serverRootCACertificate: str + :ivar aesEncryption: If enabled, AES encryption will be enabled for SMB communication. + :vartype aesEncryption: bool + :ivar ldapSigning: Specifies whether or not the LDAP traffic needs to be signed. + :vartype ldapSigning: bool + :ivar securityOperators: Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier. :vartype securityOperators: list[str] - :ivar domain: Name of the Active Directory domain. - :vartype domain: str - :ivar secretPassword: Access password from Azure KeyVault Secrets to connect Active Directory. - :vartype secretPassword: "SecretPassword" + :ivar ldapOverTLS: Specifies whether or not the LDAP traffic needs to be secured via TLS. + :vartype ldapOverTLS: bool + :ivar allowLocalNfsUsersWithLdap: If enabled, NFS client local users can also (in addition to + LDAP users) access the NFS volumes. + :vartype allowLocalNfsUsersWithLdap: bool + :ivar encryptDCConnections: If enabled, Traffic between the SMB server to Domain Controller + (DC) will be encrypted. + :vartype encryptDCConnections: bool + :ivar ldapSearchScope: LDAP Search scope options. + :vartype ldapSearchScope: "LdapSearchScopeOpt" + :ivar preferredServersForLdapClient: Comma separated list of IPv4 addresses of preferred + servers for LDAP client. At most two comma separated IPv4 addresses can be passed. + :vartype preferredServersForLdapClient: str """ - userName: str + activeDirectoryId: Optional[str] + """Id of the Active Directory.""" + username: str """A domain user account with permission to create machine accounts.""" - dns: list[str] - """An array of DNS server IP addresses(IPv4 only) for the Active Directory.""" + password: str + """Plain text password of Active Directory domain administrator, value is masked in the response.""" + domain: str + """Name of the Active Directory domain.""" + dns: str + """Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain.""" smbServerName: str """NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes.""" @@ -543,13 +393,34 @@ class ActiveDirectoryConfigUpdateProperties(TypedDict, total=False): administrators: list[str] """Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier.""" + kdcIP: str + """kdc server IP address for the active directory machine. This optional parameter is used only + while creating kerberos volume.""" + adName: str + """Name of the active directory machine. This optional parameter is used only while creating + kerberos volume.""" + serverRootCACertificate: str + """When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active + Directory Certificate Service's self-signed root CA certificate, this optional parameter is + used only for dual protocol with LDAP user-mapping volumes.""" + aesEncryption: bool + """If enabled, AES encryption will be enabled for SMB communication.""" + ldapSigning: bool + """Specifies whether or not the LDAP traffic needs to be signed.""" securityOperators: list[str] - """Domain Users in the Active directory to be given SecurityPrivilege privilege (Needed for SMB + """Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier.""" - domain: str - """Name of the Active Directory domain.""" - secretPassword: "SecretPassword" - """Access password from Azure KeyVault Secrets to connect Active Directory.""" + ldapOverTLS: bool + """Specifies whether or not the LDAP traffic needs to be secured via TLS.""" + allowLocalNfsUsersWithLdap: bool + """If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes.""" + encryptDCConnections: bool + """If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted.""" + ldapSearchScope: "LdapSearchScopeOpt" + """LDAP Search scope options.""" + preferredServersForLdapClient: str + """Comma separated list of IPv4 addresses of preferred servers for LDAP client. At most two comma + separated IPv4 addresses can be passed.""" class AuthorizeRequest(TypedDict, total=False): @@ -593,8 +464,8 @@ class AzureKeyVaultDetails(TypedDict, total=False): """Specifies the Azure Key Vault settings for storing the bucket credentials.""" -class ProxyResource(Resource): - """Proxy Resource. +class Resource(TypedDict, total=False): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -609,12 +480,40 @@ class ProxyResource(Resource): :vartype systemData: "SystemData" """ - -class Backup(ProxyResource): - """Backup under a Backup Vault. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class Backup(ProxyResource): + """Backup under a Backup Vault. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -654,6 +553,32 @@ class BackupPatchProperties(TypedDict, total=False): """Label for backup.""" +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + class BackupPolicy(TrackedResource): """Backup policy information. @@ -1047,8 +972,8 @@ class BucketPatchProperties(TypedDict, total=False): user's uid and gid. For Windows, this is the user's username. Note that the Unix and Windows user details are mutually exclusive, meaning one or other must be supplied, but not both. :vartype fileSystemUser: "FileSystemUser" - :ivar provisioningState: Provisioning state of the resource. Known values are: "Accepted", - "Creating", "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", "Creating", "Patching", "Updating", "Deleting", and "Moving". :vartype provisioningState: Union[str, "NetAppProvisioningState"] :ivar server: Properties of the server managing the lifecycle of volume buckets. :vartype server: "BucketServerPatchProperties" @@ -1076,8 +1001,8 @@ class BucketPatchProperties(TypedDict, total=False): Windows, this is the user's username. Note that the Unix and Windows user details are mutually exclusive, meaning one or other must be supplied, but not both.""" provisioningState: Union[str, "NetAppProvisioningState"] - """Provisioning state of the resource. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", \"Creating\", \"Patching\", \"Updating\", \"Deleting\", and \"Moving\".""" server: "BucketServerPatchProperties" """Properties of the server managing the lifecycle of volume buckets.""" permissions: Union[str, "BucketPatchPermissions"] @@ -1109,8 +1034,8 @@ class BucketProperties(TypedDict, total=False): user's uid and gid. For Windows, this is the user's username. Note that the Unix and Windows user details are mutually exclusive, meaning one or other must be supplied, but not both. :vartype fileSystemUser: "FileSystemUser" - :ivar provisioningState: Provisioning state of the resource. Known values are: "Accepted", - "Creating", "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", "Creating", "Patching", "Updating", "Deleting", and "Moving". :vartype provisioningState: Union[str, "NetAppProvisioningState"] :ivar status: The bucket credentials status. There states: @@ -1149,8 +1074,8 @@ class BucketProperties(TypedDict, total=False): Windows, this is the user's username. Note that the Unix and Windows user details are mutually exclusive, meaning one or other must be supplied, but not both.""" provisioningState: Union[str, "NetAppProvisioningState"] - """Provisioning state of the resource. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", \"Creating\", \"Patching\", \"Updating\", \"Deleting\", and \"Moving\".""" status: Union[str, "CredentialsStatus"] """The bucket credentials status. There states: @@ -1624,1323 +1549,128 @@ class CertificateAkvDetails(TypedDict, total=False): the bucket certificate. :vartype certificateKeyVaultUri: str :ivar certificateName: The name of the bucket server certificate stored in the Azure Key Vault. - :vartype certificateName: str - :ivar userAssignedIdentity: Optional resource ID of the managed identity that has access to the - Azure Key Vault (AKV) secret. If a value is provided, it is used to find a matching entry in - the account's collection of user-assigned managed identities. If no match is found, an - exception is thrown. If no value is provided, the system-assigned managed identity is used. - :vartype userAssignedIdentity: str - """ - - certificateKeyVaultUri: str - """The base URI of the Azure Key Vault that is used when retrieving the bucket certificate.""" - certificateName: str - """The name of the bucket server certificate stored in the Azure Key Vault.""" - userAssignedIdentity: str - """Optional resource ID of the managed identity that has access to the Azure Key Vault (AKV) - secret. If a value is provided, it is used to find a matching entry in the account's collection - of user-assigned managed identities. If no match is found, an exception is thrown. If no value - is provided, the system-assigned managed identity is used.""" - - -class ChangeKeyVault(TypedDict, total=False): - """Change key vault request. - - :ivar keyVaultUri: The URI of the key vault/managed HSM that should be used for encryption. - Required. - :vartype keyVaultUri: str - :ivar keyName: The name of the key that should be used for encryption. Required. - :vartype keyName: str - :ivar keyVaultResourceId: Azure resource ID of the key vault/managed HSM that should be used - for encryption. - :vartype keyVaultResourceId: str - :ivar keyVaultPrivateEndpoints: Pairs of virtual network ID and private endpoint ID. Every - virtual network that has volumes encrypted with customer-managed keys needs its own key vault - private endpoint. Required. - :vartype keyVaultPrivateEndpoints: list["KeyVaultPrivateEndpoint"] - """ - - keyVaultUri: Required[str] - """The URI of the key vault/managed HSM that should be used for encryption. Required.""" - keyName: Required[str] - """The name of the key that should be used for encryption. Required.""" - keyVaultResourceId: str - """Azure resource ID of the key vault/managed HSM that should be used for encryption.""" - keyVaultPrivateEndpoints: Required[list["KeyVaultPrivateEndpoint"]] - """Pairs of virtual network ID and private endpoint ID. Every virtual network that has volumes - encrypted with customer-managed keys needs its own key vault private endpoint. Required.""" - - -class ChangeZoneRequest(TypedDict, total=False): - """Changes the zone for the Zone Redundant elastic capacity pool. - - :ivar newZone: Availability zone to move Zone Redundant elastic capacity pool to. Required. - :vartype newZone: str - """ - - newZone: Required[str] - """Availability zone to move Zone Redundant elastic capacity pool to. Required.""" - - -class CheckElasticVolumeFilePathAvailabilityRequest(TypedDict, total=False): # pylint: disable=name-too-long - """File path availability request content - availability is based on the elastic volume filePath - within the given elastic capacityPool. - - :ivar filePath: A unique file path for the volume. Used when creating mount targets. This needs - to be unique within the elastic capacity pool. Required. - :vartype filePath: str - """ - - filePath: Required[str] - """A unique file path for the volume. Used when creating mount targets. This needs to be unique - within the elastic capacity pool. Required.""" - - -class CifsUser(TypedDict, total=False): - """The effective CIFS username when accessing the volume data. - - :ivar username: The CIFS user's username. - :vartype username: str - """ - - username: str - """The CIFS user's username.""" - - -class CredentialsAkvDetails(TypedDict, total=False): - """Specifies the Azure Key Vault settings for storing the bucket credentials. - - :ivar credentialsKeyVaultUri: The base URI of the Azure Key Vault that is used when storing the - bucket credentials. - :vartype credentialsKeyVaultUri: str - :ivar secretName: The name of the secret stored in Azure Key Vault. The associated key pair has - the following structure: - - { - "access_key_id": "", - "secret_access_key": "" - }. - :vartype secretName: str - :ivar userAssignedIdentity: Optional resource ID of the managed identity that has access to the - Azure Key Vault (AKV) secret. If a value is provided, it is used to find a matching entry in - the account's collection of user-assigned managed identities. If no match is found, an - exception is thrown. If no value is provided, the system-assigned managed identity is used. - :vartype userAssignedIdentity: str - """ - - credentialsKeyVaultUri: str - """The base URI of the Azure Key Vault that is used when storing the bucket credentials.""" - secretName: str - """The name of the secret stored in Azure Key Vault. The associated key pair has the following - structure: - - { - \"access_key_id\": \"\", - \"secret_access_key\": \"\" - }.""" - userAssignedIdentity: str - """Optional resource ID of the managed identity that has access to the Azure Key Vault (AKV) - secret. If a value is provided, it is used to find a matching entry in the account's collection - of user-assigned managed identities. If no match is found, an exception is thrown. If no value - is provided, the system-assigned managed identity is used.""" - - -class DailySchedule(TypedDict, total=False): - """Daily Schedule properties. - - :ivar snapshotsToKeep: Daily snapshot count to keep. - :vartype snapshotsToKeep: int - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - :ivar usedBytes: Resource size in bytes, current storage usage for the volume in bytes. - :vartype usedBytes: int - """ - - snapshotsToKeep: int - """Daily snapshot count to keep.""" - hour: int - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: int - """Indicates which minute snapshot should be taken.""" - usedBytes: int - """Resource size in bytes, current storage usage for the volume in bytes.""" - - -class DestinationReplication(TypedDict, total=False): - """Destination replication properties. - - :ivar resourceId: The resource ID of the remote volume. - :vartype resourceId: str - :ivar replicationType: Indicates whether the replication is cross zone or cross region. Known - values are: "CrossRegionReplication" and "CrossZoneReplication". - :vartype replicationType: Union[str, "ReplicationType"] - :ivar region: The remote region for the destination volume. - :vartype region: str - :ivar zone: The remote zone for the destination volume. - :vartype zone: str - """ - - resourceId: str - """The resource ID of the remote volume.""" - replicationType: Union[str, "ReplicationType"] - """Indicates whether the replication is cross zone or cross region. Known values are: - \"CrossRegionReplication\" and \"CrossZoneReplication\".""" - region: str - """The remote region for the destination volume.""" - zone: str - """The remote zone for the destination volume.""" - - -class ElasticAccount(TrackedResource): - """NetApp elastic account resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticAccountProperties" - :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype eTag: str - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: "ManagedServiceIdentity" - """ - - properties: "ElasticAccountProperties" - """The resource-specific properties for this resource.""" - eTag: str - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - identity: "ManagedServiceIdentity" - """The managed service identities assigned to this resource.""" - - -class ElasticAccountProperties(TypedDict, total=False): - """NetApp elastic account properties. - - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - :ivar encryption: Encryption settings. - :vartype encryption: "ElasticEncryption" - """ - - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - encryption: "ElasticEncryption" - """Encryption settings.""" - - -class ElasticAccountUpdate(TypedDict, total=False): - """The type used for update operations of the ElasticAccount. - - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: "ManagedServiceIdentity" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticAccountUpdateProperties" - """ - - identity: "ManagedServiceIdentity" - """The managed service identities assigned to this resource.""" - tags: dict[str, str] - """Resource tags.""" - properties: "ElasticAccountUpdateProperties" - """The resource-specific properties for this resource.""" - - -class ElasticAccountUpdateProperties(TypedDict, total=False): - """The updatable properties of the ElasticAccount. - - :ivar encryption: Encryption settings. - :vartype encryption: "ElasticEncryption" - """ - - encryption: "ElasticEncryption" - """Encryption settings.""" - - -class ElasticBackup(ProxyResource): - """NetApp Elastic Backup under an elastic Backup Vault. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticBackupProperties" - """ - - properties: "ElasticBackupProperties" - """The resource-specific properties for this resource.""" - - -class ElasticBackupPolicy(TrackedResource): - """NetApp Elastic Backup Policy resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticBackupPolicyProperties" - :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype eTag: str - """ - - properties: "ElasticBackupPolicyProperties" - """The resource-specific properties for this resource.""" - eTag: str - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - - -class ElasticBackupPolicyProperties(TypedDict, total=False): - """Elastic Backup Policy properties. - - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - :ivar dailyBackupsToKeep: Daily backups count to keep. - :vartype dailyBackupsToKeep: int - :ivar weeklyBackupsToKeep: Weekly backups count to keep. - :vartype weeklyBackupsToKeep: int - :ivar monthlyBackupsToKeep: Monthly backups count to keep. - :vartype monthlyBackupsToKeep: int - :ivar assignedVolumesCount: The number of volumes currently using this Backup Policy. - :vartype assignedVolumesCount: int - :ivar policyState: The property to identify whether Backup Policy is enabled or not. Known - values are: "Enabled" and "Disabled". - :vartype policyState: Union[str, "ElasticBackupPolicyState"] - """ - - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - dailyBackupsToKeep: int - """Daily backups count to keep.""" - weeklyBackupsToKeep: int - """Weekly backups count to keep.""" - monthlyBackupsToKeep: int - """Monthly backups count to keep.""" - assignedVolumesCount: int - """The number of volumes currently using this Backup Policy.""" - policyState: Union[str, "ElasticBackupPolicyState"] - """The property to identify whether Backup Policy is enabled or not. Known values are: \"Enabled\" - and \"Disabled\".""" - - -class ElasticBackupPolicyUpdate(TypedDict, total=False): - """The type used for update operations of the ElasticBackupPolicy. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticBackupPolicyUpdateProperties" - """ - - tags: dict[str, str] - """Resource tags.""" - properties: "ElasticBackupPolicyUpdateProperties" - """The resource-specific properties for this resource.""" - - -class ElasticBackupPolicyUpdateProperties(TypedDict, total=False): - """The updatable properties of the ElasticBackupPolicy. - - :ivar dailyBackupsToKeep: Daily backups count to keep. - :vartype dailyBackupsToKeep: int - :ivar weeklyBackupsToKeep: Weekly backups count to keep. - :vartype weeklyBackupsToKeep: int - :ivar monthlyBackupsToKeep: Monthly backups count to keep. - :vartype monthlyBackupsToKeep: int - :ivar policyState: The property to identify whether Backup Policy is enabled or not. Known - values are: "Enabled" and "Disabled". - :vartype policyState: Union[str, "ElasticBackupPolicyState"] - """ - - dailyBackupsToKeep: int - """Daily backups count to keep.""" - weeklyBackupsToKeep: int - """Weekly backups count to keep.""" - monthlyBackupsToKeep: int - """Monthly backups count to keep.""" - policyState: Union[str, "ElasticBackupPolicyState"] - """The property to identify whether Backup Policy is enabled or not. Known values are: \"Enabled\" - and \"Disabled\".""" - - -class ElasticBackupProperties(TypedDict, total=False): - """Elastic Backup properties. - - :ivar creationDate: The creation date of the backup. - :vartype creationDate: str - :ivar snapshotCreationDate: The snapshot creation date of the backup. - :vartype snapshotCreationDate: str - :ivar completionDate: The completion date of the backup. - :vartype completionDate: str - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - :ivar size: Size of backup in bytes. - :vartype size: int - :ivar label: Label for backup. - :vartype label: str - :ivar backupType: Type of backup Manual or Scheduled. Known values are: "Manual" and - "Scheduled". - :vartype backupType: Union[str, "ElasticBackupType"] - :ivar failureReason: Failure reason. - :vartype failureReason: str - :ivar elasticVolumeResourceId: ResourceId used to identify the Elastic Volume. Required. - :vartype elasticVolumeResourceId: str - :ivar snapshotUsage: Manual backup using an already existing snapshot. This will always be - CreateNewSnapshot for scheduled backups and UseExistingSnapshot/CreateNewSnapshot for manual - backups. Known values are: "UseExistingSnapshot" and "CreateNewSnapshot". - :vartype snapshotUsage: Union[str, "SnapshotUsage"] - :ivar elasticSnapshotResourceId: ResourceId used to identify the elastic snapshot resource. - This is required when an existing snapshot needs to be used for creating a manual backup. - :vartype elasticSnapshotResourceId: str - :ivar elasticBackupPolicyResourceId: ResourceId used to identify the elastic backup policy. - :vartype elasticBackupPolicyResourceId: str - :ivar volumeSize: Specifies if the backup is for a large volume. Known values are: "Large" and - "Regular". - :vartype volumeSize: Union[str, "VolumeSize"] - """ - - creationDate: str - """The creation date of the backup.""" - snapshotCreationDate: str - """The snapshot creation date of the backup.""" - completionDate: str - """The completion date of the backup.""" - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - size: int - """Size of backup in bytes.""" - label: str - """Label for backup.""" - backupType: Union[str, "ElasticBackupType"] - """Type of backup Manual or Scheduled. Known values are: \"Manual\" and \"Scheduled\".""" - failureReason: str - """Failure reason.""" - elasticVolumeResourceId: Required[str] - """ResourceId used to identify the Elastic Volume. Required.""" - snapshotUsage: Union[str, "SnapshotUsage"] - """Manual backup using an already existing snapshot. This will always be CreateNewSnapshot for - scheduled backups and UseExistingSnapshot/CreateNewSnapshot for manual backups. Known values - are: \"UseExistingSnapshot\" and \"CreateNewSnapshot\".""" - elasticSnapshotResourceId: str - """ResourceId used to identify the elastic snapshot resource. This is required when an existing - snapshot needs to be used for creating a manual backup.""" - elasticBackupPolicyResourceId: str - """ResourceId used to identify the elastic backup policy.""" - volumeSize: Union[str, "VolumeSize"] - """Specifies if the backup is for a large volume. Known values are: \"Large\" and \"Regular\".""" - - -class ElasticBackupVault(TrackedResource): - """NetApp elastic backup vault resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticBackupVaultProperties" - :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype eTag: str - """ - - properties: "ElasticBackupVaultProperties" - """The resource-specific properties for this resource.""" - eTag: str - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - - -class ElasticBackupVaultProperties(TypedDict, total=False): - """Elastic Backup Vault properties. - - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - """ - - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - - -class ElasticBackupVaultUpdate(TypedDict, total=False): - """The type used for update operations of the ElasticBackupVault. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - tags: dict[str, str] - """Resource tags.""" - - -class ElasticCapacityPool(TrackedResource): - """NetApp Elastic Capacity Pool resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticCapacityPoolProperties" - :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype eTag: str - :ivar zones: The availability zones. - :vartype zones: list[str] - """ - - properties: "ElasticCapacityPoolProperties" - """The resource-specific properties for this resource.""" - eTag: str - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - zones: list[str] - """The availability zones.""" - - -class ElasticCapacityPoolProperties(TypedDict, total=False): - """Elastic capacity pool properties. - - :ivar size: Provisioned size of the pool (in bytes). For zoneRedundant service level pool, - value must be in the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values - expressed in bytes as multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to - 128TiB. Pool size can't be shrunk once it is created. Required. - :vartype size: int - :ivar serviceLevel: The service level of the elastic capacity pool. Required. "ZoneRedundant" - :vartype serviceLevel: Union[str, "ElasticServiceLevel"] - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - :ivar encryption: Encryption settings. - :vartype encryption: "ElasticEncryptionConfiguration" - :ivar totalThroughputMibps: Total throughput of the pool in MiB/s. - :vartype totalThroughputMibps: float - :ivar subnetResourceId: The Azure Resource URI for a delegated subnet. Must have the delegation - Microsoft.NetApp/elasticVolumes, this is used by all the volumes within the pool. Required. - :vartype subnetResourceId: str - :ivar currentZone: Indicates the current zone of the pool. This can be changed for - zoneRedundant service level pool with the changeZone action. - :vartype currentZone: str - :ivar availabilityStatus: Current availability status of the resource. Known values are: - "Online" and "Offline". - :vartype availabilityStatus: Union[str, "ElasticResourceAvailabilityStatus"] - :ivar activeDirectoryConfigResourceId: The Azure Resource URI for an Active Directory - configuration. This is used by all the SMB volumes within the pool. - :vartype activeDirectoryConfigResourceId: str - """ - - size: Required[int] - """Provisioned size of the pool (in bytes). For zoneRedundant service level pool, value must be in - the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values expressed in bytes as - multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to 128TiB. Pool size can't be - shrunk once it is created. Required.""" - serviceLevel: Required[Union[str, "ElasticServiceLevel"]] - """The service level of the elastic capacity pool. Required. \"ZoneRedundant\"""" - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - encryption: "ElasticEncryptionConfiguration" - """Encryption settings.""" - totalThroughputMibps: float - """Total throughput of the pool in MiB/s.""" - subnetResourceId: Required[str] - """The Azure Resource URI for a delegated subnet. Must have the delegation - Microsoft.NetApp/elasticVolumes, this is used by all the volumes within the pool. Required.""" - currentZone: str - """Indicates the current zone of the pool. This can be changed for zoneRedundant service level - pool with the changeZone action.""" - availabilityStatus: Union[str, "ElasticResourceAvailabilityStatus"] - """Current availability status of the resource. Known values are: \"Online\" and \"Offline\".""" - activeDirectoryConfigResourceId: str - """The Azure Resource URI for an Active Directory configuration. This is used by all the SMB - volumes within the pool.""" - - -class ElasticCapacityPoolUpdate(TypedDict, total=False): - """The type used for update operations of the ElasticCapacityPool. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticCapacityPoolUpdateProperties" - """ - - tags: dict[str, str] - """Resource tags.""" - properties: "ElasticCapacityPoolUpdateProperties" - """The resource-specific properties for this resource.""" - - -class ElasticCapacityPoolUpdateProperties(TypedDict, total=False): - """The updatable properties of the ElasticCapacityPool. - - :ivar size: Provisioned size of the pool (in bytes). For zoneRedundant service level pool, - value must be in the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values - expressed in bytes as multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to - 128TiB. Pool size can't be shrunk once it is created. - :vartype size: int - :ivar encryption: Encryption settings. - :vartype encryption: "ElasticEncryptionConfiguration" - :ivar activeDirectoryConfigResourceId: The Azure Resource URI for an Active Directory - configuration. This is used by all the SMB volumes within the pool. - :vartype activeDirectoryConfigResourceId: str - """ - - size: int - """Provisioned size of the pool (in bytes). For zoneRedundant service level pool, value must be in - the range 1TiB to 16TiB or 1TiB to 128TiB for supported region. Values expressed in bytes as - multiples of 1TiB till 16TiB and in multiples of 8TiB from 24TiB to 128TiB. Pool size can't be - shrunk once it is created.""" - encryption: "ElasticEncryptionConfiguration" - """Encryption settings.""" - activeDirectoryConfigResourceId: str - """The Azure Resource URI for an Active Directory configuration. This is used by all the SMB - volumes within the pool.""" - - -class ElasticEncryption(TypedDict, total=False): - """Encryption settings. - - :ivar keySource: The encryption keySource (provider). Possible values (case-insensitive): - Microsoft.NetApp, Microsoft.KeyVault. Known values are: "Microsoft.NetApp" and - "Microsoft.KeyVault". - :vartype keySource: Union[str, "KeySource"] - :ivar keyVaultProperties: Properties provided by KeyVault. Applicable if keySource is - 'Microsoft.KeyVault'. - :vartype keyVaultProperties: "ElasticKeyVaultProperties" - :ivar identity: Identity used to authenticate to KeyVault. Applicable if keySource is - 'Microsoft.KeyVault'. - :vartype identity: "ElasticEncryptionIdentity" - """ - - keySource: Union[str, "KeySource"] - """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.NetApp, - Microsoft.KeyVault. Known values are: \"Microsoft.NetApp\" and \"Microsoft.KeyVault\".""" - keyVaultProperties: "ElasticKeyVaultProperties" - """Properties provided by KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" - identity: "ElasticEncryptionIdentity" - """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" - - -class ElasticEncryptionConfiguration(TypedDict, total=False): - """CMK Encryption Configuration. - - :ivar elasticPoolEncryptionKeySource: Pool Encryption Key Source. Required. Known values are: - "NetApp" and "KeyVault". - :vartype elasticPoolEncryptionKeySource: Union[str, "ElasticPoolEncryptionKeySource"] - :ivar keyVaultPrivateEndpointResourceId: The resource ID of private endpoint for KeyVault. It - must reside in the same VNET as the volume. Only applicable if encryptionKeySource = - 'Microsoft.KeyVault'. Required. - :vartype keyVaultPrivateEndpointResourceId: str - """ - - elasticPoolEncryptionKeySource: Required[Union[str, "ElasticPoolEncryptionKeySource"]] - """Pool Encryption Key Source. Required. Known values are: \"NetApp\" and \"KeyVault\".""" - keyVaultPrivateEndpointResourceId: Required[str] - """The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the - volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. Required.""" - - -class ElasticEncryptionIdentity(TypedDict, total=False): - """Identity used to authenticate with key vault. - - :ivar principalId: The principal ID (object ID) of the identity used to authenticate with key - vault. Read-only. - :vartype principalId: str - :ivar userAssignedIdentity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match - key of identity.userAssignedIdentities. - :vartype userAssignedIdentity: str - :ivar federatedClientId: ClientId of the multi-tenant Entra ID Application. Used to access - cross-tenant keyvaults. - :vartype federatedClientId: str - """ - - principalId: str - """The principal ID (object ID) of the identity used to authenticate with key vault. Read-only.""" - userAssignedIdentity: str - """The ARM resource identifier of the user assigned identity used to authenticate with key vault. - Applicable if identity.type has 'UserAssigned'. It should match key of - identity.userAssignedIdentities.""" - federatedClientId: str - """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" - - -class ElasticExportPolicy(TypedDict, total=False): - """Set of export policy rules. - - :ivar rules: Export policy rule. - :vartype rules: list["ElasticExportPolicyRule"] - """ - - rules: list["ElasticExportPolicyRule"] - """Export policy rule.""" - - -class ElasticExportPolicyRule(TypedDict, total=False): - """Elastic Volume Export Policy Rule. - - :ivar ruleIndex: Controls the priority of the export policy rule. When connecting to the volume - the rule with the lowest index that applies to the connecting client is used. - :vartype ruleIndex: int - :ivar unixAccessRule: Specifies the Unix file access level for the volume. It encompasses both - read-only and read-write permissions. Additionally, NoAccess can be set to block all access to - the volume. Known values are: "ReadOnly", "ReadWrite", and "NoAccess". - :vartype unixAccessRule: Union[str, "ElasticUnixAccessRule"] - :ivar nfsv3: Allows clients to access the volume with the NFSv3 protocol. Enable only for NFSv3 - type volumes. Known values are: "Enabled" and "Disabled". - :vartype nfsv3: Union[str, "ElasticNfsv3Access"] - :ivar nfsv4: Allows clients to access the volume with at least NFSv4.1 protocol. Known values - are: "Enabled" and "Disabled". - :vartype nfsv4: Union[str, "ElasticNfsv4Access"] - :ivar allowedClients: Client ingress specification for the export policy as list of IPv4 CIDRs, - IPv4 host addresses and host names. - :vartype allowedClients: list[str] - :ivar rootAccess: Indicates whether root access to the volume is granted to clients affected by - this rule. Known values are: "Enabled" and "Disabled". - :vartype rootAccess: Union[str, "ElasticRootAccess"] - """ - - ruleIndex: int - """Controls the priority of the export policy rule. When connecting to the volume the rule with - the lowest index that applies to the connecting client is used.""" - unixAccessRule: Union[str, "ElasticUnixAccessRule"] - """Specifies the Unix file access level for the volume. It encompasses both read-only and - read-write permissions. Additionally, NoAccess can be set to block all access to the volume. - Known values are: \"ReadOnly\", \"ReadWrite\", and \"NoAccess\".""" - nfsv3: Union[str, "ElasticNfsv3Access"] - """Allows clients to access the volume with the NFSv3 protocol. Enable only for NFSv3 type - volumes. Known values are: \"Enabled\" and \"Disabled\".""" - nfsv4: Union[str, "ElasticNfsv4Access"] - """Allows clients to access the volume with at least NFSv4.1 protocol. Known values are: - \"Enabled\" and \"Disabled\".""" - allowedClients: list[str] - """Client ingress specification for the export policy as list of IPv4 CIDRs, IPv4 host addresses - and host names.""" - rootAccess: Union[str, "ElasticRootAccess"] - """Indicates whether root access to the volume is granted to clients affected by this rule. Known - values are: \"Enabled\" and \"Disabled\".""" - - -class ElasticKeyVaultProperties(TypedDict, total=False): - """Properties of key vault. - - :ivar keyVaultUri: The Uri of KeyVault. - :vartype keyVaultUri: str - :ivar keyName: The name of KeyVault key. - :vartype keyName: str - :ivar keyVaultResourceId: The resource ID of KeyVault. - :vartype keyVaultResourceId: str - :ivar status: Status of the KeyVault connection. Known values are: "Created", "InUse", - "Deleted", "Error", and "Updating". - :vartype status: Union[str, "ElasticKeyVaultStatus"] - """ - - keyVaultUri: str - """The Uri of KeyVault.""" - keyName: str - """The name of KeyVault key.""" - keyVaultResourceId: str - """The resource ID of KeyVault.""" - status: Union[str, "ElasticKeyVaultStatus"] - """Status of the KeyVault connection. Known values are: \"Created\", \"InUse\", \"Deleted\", - \"Error\", and \"Updating\".""" - - -class ElasticMountTargetProperties(TypedDict, total=False): - """Contains all the information needed to mount an elastic volume. - - :ivar ipAddress: The mount target's IPv4 address, used to mount the volume. - :vartype ipAddress: str - :ivar smbServerFqdn: The SMB server's Fully Qualified Domain Name, FQDN. - :vartype smbServerFqdn: str - """ - - ipAddress: str - """The mount target's IPv4 address, used to mount the volume.""" - smbServerFqdn: str - """The SMB server's Fully Qualified Domain Name, FQDN.""" - - -class ElasticSmbPatchProperties(TypedDict, total=False): - """SMB Patch Properties. - - :ivar smbEncryption: Used to enable or disable encryption for in-flight SMB data volume. This - flag can be modified during Elastic volume update operation as well. Only applicable for SMB - protocol Elastic volumes. Known values are: "Enabled" and "Disabled". - :vartype smbEncryption: Union[str, "ElasticSmbEncryption"] - """ - - smbEncryption: Union[str, "ElasticSmbEncryption"] - """Used to enable or disable encryption for in-flight SMB data volume. This flag can be modified - during Elastic volume update operation as well. Only applicable for SMB protocol Elastic - volumes. Known values are: \"Enabled\" and \"Disabled\".""" - - -class ElasticSmbProperties(TypedDict, total=False): - """SMB Properties. - - :ivar smbEncryption: Used to enable or disable encryption for in-flight SMB data volume. This - flag can be modified during Elastic volume update operation as well. Only applicable for SMB - protocol Elastic volumes. Known values are: "Enabled" and "Disabled". - :vartype smbEncryption: Union[str, "ElasticSmbEncryption"] - """ - - smbEncryption: Union[str, "ElasticSmbEncryption"] - """Used to enable or disable encryption for in-flight SMB data volume. This flag can be modified - during Elastic volume update operation as well. Only applicable for SMB protocol Elastic - volumes. Known values are: \"Enabled\" and \"Disabled\".""" - - -class ElasticSnapshot(ProxyResource): - """NetApp Elastic Snapshot under an Elastic Volume. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticSnapshotProperties" - """ - - properties: "ElasticSnapshotProperties" - """The resource-specific properties for this resource.""" - - -class ElasticSnapshotPolicy(TrackedResource): - """NetApp Elastic Snapshot Policy under an Elastic Account. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticSnapshotPolicyProperties" - :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype eTag: str - """ - - properties: "ElasticSnapshotPolicyProperties" - """The resource-specific properties for this resource.""" - eTag: str - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - - -class ElasticSnapshotPolicyDailySchedule(TypedDict, total=False): - """Daily Schedule properties used to create NetApp snapshot policy. - - :ivar snapshotsToKeep: Daily snapshot count to keep. - :vartype snapshotsToKeep: int - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshotsToKeep: int - """Daily snapshot count to keep.""" - hour: int - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: int - """Indicates which minute snapshot should be taken.""" - - -class ElasticSnapshotPolicyHourlySchedule(TypedDict, total=False): - """Hourly Schedule properties used to create NetApp snapshot policy. - - :ivar snapshotsToKeep: Hourly snapshot count to keep. - :vartype snapshotsToKeep: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshotsToKeep: int - """Hourly snapshot count to keep.""" - minute: int - """Indicates which minute snapshot should be taken.""" - - -class ElasticSnapshotPolicyMonthlySchedule(TypedDict, total=False): - """Monthly Schedule properties used to create NetApp snapshot policy. - - :ivar snapshotsToKeep: Monthly snapshot count to keep. - :vartype snapshotsToKeep: int - :ivar daysOfMonth: Indicates which days of the month snapshot (1-31) should be taken, accepts a - list of integers. - :vartype daysOfMonth: list[int] - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshotsToKeep: int - """Monthly snapshot count to keep.""" - daysOfMonth: list[int] - """Indicates which days of the month snapshot (1-31) should be taken, accepts a list of integers.""" - hour: int - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: int - """Indicates which minute snapshot should be taken.""" - - -class ElasticSnapshotPolicyProperties(TypedDict, total=False): - """Elastic Snapshot policy properties. - - :ivar hourlySchedule: Schedule for hourly snapshots. - :vartype hourlySchedule: "ElasticSnapshotPolicyHourlySchedule" - :ivar dailySchedule: Schedule for daily snapshots. - :vartype dailySchedule: "ElasticSnapshotPolicyDailySchedule" - :ivar weeklySchedule: Schedule for weekly snapshots. - :vartype weeklySchedule: "ElasticSnapshotPolicyWeeklySchedule" - :ivar monthlySchedule: Schedule for monthly snapshots. - :vartype monthlySchedule: "ElasticSnapshotPolicyMonthlySchedule" - :ivar policyStatus: Configures if the snapshot policy is enabled on the volumes connected to - the policy. Known values are: "Enabled" and "Disabled". - :vartype policyStatus: Union[str, "PolicyStatus"] - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - """ - - hourlySchedule: "ElasticSnapshotPolicyHourlySchedule" - """Schedule for hourly snapshots.""" - dailySchedule: "ElasticSnapshotPolicyDailySchedule" - """Schedule for daily snapshots.""" - weeklySchedule: "ElasticSnapshotPolicyWeeklySchedule" - """Schedule for weekly snapshots.""" - monthlySchedule: "ElasticSnapshotPolicyMonthlySchedule" - """Schedule for monthly snapshots.""" - policyStatus: Union[str, "PolicyStatus"] - """Configures if the snapshot policy is enabled on the volumes connected to the policy. Known - values are: \"Enabled\" and \"Disabled\".""" - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - - -class ElasticSnapshotPolicyUpdate(TypedDict, total=False): - """The type used for update operations of the ElasticSnapshotPolicy. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticSnapshotPolicyUpdateProperties" - """ - - tags: dict[str, str] - """Resource tags.""" - properties: "ElasticSnapshotPolicyUpdateProperties" - """The resource-specific properties for this resource.""" - - -class ElasticSnapshotPolicyUpdateProperties(TypedDict, total=False): - """The updatable properties of the ElasticSnapshotPolicy. - - :ivar hourlySchedule: Schedule for hourly snapshots. - :vartype hourlySchedule: "ElasticSnapshotPolicyHourlySchedule" - :ivar dailySchedule: Schedule for daily snapshots. - :vartype dailySchedule: "ElasticSnapshotPolicyDailySchedule" - :ivar weeklySchedule: Schedule for weekly snapshots. - :vartype weeklySchedule: "ElasticSnapshotPolicyWeeklySchedule" - :ivar monthlySchedule: Schedule for monthly snapshots. - :vartype monthlySchedule: "ElasticSnapshotPolicyMonthlySchedule" - :ivar policyStatus: Configures if the snapshot policy is enabled on the volumes connected to - the policy. Known values are: "Enabled" and "Disabled". - :vartype policyStatus: Union[str, "PolicyStatus"] - """ - - hourlySchedule: "ElasticSnapshotPolicyHourlySchedule" - """Schedule for hourly snapshots.""" - dailySchedule: "ElasticSnapshotPolicyDailySchedule" - """Schedule for daily snapshots.""" - weeklySchedule: "ElasticSnapshotPolicyWeeklySchedule" - """Schedule for weekly snapshots.""" - monthlySchedule: "ElasticSnapshotPolicyMonthlySchedule" - """Schedule for monthly snapshots.""" - policyStatus: Union[str, "PolicyStatus"] - """Configures if the snapshot policy is enabled on the volumes connected to the policy. Known - values are: \"Enabled\" and \"Disabled\".""" - - -class ElasticSnapshotPolicyWeeklySchedule(TypedDict, total=False): - """Weekly Schedule properties used to create NetApp snapshot policy. - - :ivar snapshotsToKeep: Weekly snapshot count to keep. - :vartype snapshotsToKeep: int - :ivar days: Indicates which weekday(s) snapshot(s) should be taken, accepts a list of week day - names in english. - :vartype days: list[Union[str, "DayOfWeek"]] - :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. - :vartype hour: int - :ivar minute: Indicates which minute snapshot should be taken. - :vartype minute: int - """ - - snapshotsToKeep: int - """Weekly snapshot count to keep.""" - days: list[Union[str, "DayOfWeek"]] - """Indicates which weekday(s) snapshot(s) should be taken, accepts a list of week day names in - english.""" - hour: int - """Indicates which hour in UTC timezone a snapshot should be taken.""" - minute: int - """Indicates which minute snapshot should be taken.""" - - -class ElasticSnapshotProperties(TypedDict, total=False): - """Elastic Snapshot properties. - - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - """ - - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - - -class ElasticVolume(TrackedResource): - """NetApp Elastic Volume resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticVolumeProperties" - :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per - the normal etag convention. Entity tags are used for comparing two or more entities from the - same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match - (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - :vartype eTag: str - :ivar zones: The availability zones. - :vartype zones: list[str] - """ - - properties: "ElasticVolumeProperties" - """The resource-specific properties for this resource.""" - eTag: str - """If eTag is provided in the response body, it may also be provided as a header per the normal - etag convention. Entity tags are used for comparing two or more entities from the same - requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section - 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" - zones: list[str] - """The availability zones.""" - - -class ElasticVolumeBackupProperties(TypedDict, total=False): - """Elastic Volume Backup Properties. - - :ivar elasticBackupPolicyResourceId: ResourceId used to identify Elastic Backup Policy. - :vartype elasticBackupPolicyResourceId: str - :ivar policyEnforcement: The property to decide policy is enforced or not on the volume. Known - values are: "Enforced" and "NotEnforced". - :vartype policyEnforcement: Union[str, "ElasticVolumePolicyEnforcement"] - :ivar elasticBackupVaultResourceId: ResourceId used to identify Elastic Backup Vault. - :vartype elasticBackupVaultResourceId: str - """ - - elasticBackupPolicyResourceId: str - """ResourceId used to identify Elastic Backup Policy.""" - policyEnforcement: Union[str, "ElasticVolumePolicyEnforcement"] - """The property to decide policy is enforced or not on the volume. Known values are: \"Enforced\" - and \"NotEnforced\".""" - elasticBackupVaultResourceId: str - """ResourceId used to identify Elastic Backup Vault.""" - - -class ElasticVolumeDataProtectionPatchProperties(TypedDict, total=False): # pylint: disable=name-too-long - """Data protection configuration option for updating the volume, including snapshot policies and - backup. - - :ivar snapshot: Used to apply a snapshot policy to a volume. - :vartype snapshot: "ElasticVolumeSnapshotProperties" - :ivar backup: Used to configure backups on an elastic volume. - :vartype backup: "ElasticVolumeBackupProperties" + :vartype certificateName: str """ - snapshot: "ElasticVolumeSnapshotProperties" - """Used to apply a snapshot policy to a volume.""" - backup: "ElasticVolumeBackupProperties" - """Used to configure backups on an elastic volume.""" + certificateKeyVaultUri: str + """The base URI of the Azure Key Vault that is used when retrieving the bucket certificate.""" + certificateName: str + """The name of the bucket server certificate stored in the Azure Key Vault.""" -class ElasticVolumeDataProtectionProperties(TypedDict, total=False): - """Data protection configuration option for the volume, including snapshot policies and backup. +class ChangeKeyVault(TypedDict, total=False): + """Change key vault request. - :ivar snapshot: Used to apply a snapshot policy to a volume. - :vartype snapshot: "ElasticVolumeSnapshotProperties" - :ivar backup: Used to configure backups on an elastic volume. - :vartype backup: "ElasticVolumeBackupProperties" + :ivar keyVaultUri: The URI of the key vault/managed HSM that should be used for encryption. + Required. + :vartype keyVaultUri: str + :ivar keyName: The name of the key that should be used for encryption. Required. + :vartype keyName: str + :ivar keyVaultResourceId: Azure resource ID of the key vault/managed HSM that should be used + for encryption. + :vartype keyVaultResourceId: str + :ivar keyVaultPrivateEndpoints: Pairs of virtual network ID and private endpoint ID. Every + virtual network that has volumes encrypted with customer-managed keys needs its own key vault + private endpoint. Required. + :vartype keyVaultPrivateEndpoints: list["KeyVaultPrivateEndpoint"] """ - snapshot: "ElasticVolumeSnapshotProperties" - """Used to apply a snapshot policy to a volume.""" - backup: "ElasticVolumeBackupProperties" - """Used to configure backups on an elastic volume.""" + keyVaultUri: Required[str] + """The URI of the key vault/managed HSM that should be used for encryption. Required.""" + keyName: Required[str] + """The name of the key that should be used for encryption. Required.""" + keyVaultResourceId: str + """Azure resource ID of the key vault/managed HSM that should be used for encryption.""" + keyVaultPrivateEndpoints: Required[list["KeyVaultPrivateEndpoint"]] + """Pairs of virtual network ID and private endpoint ID. Every virtual network that has volumes + encrypted with customer-managed keys needs its own key vault private endpoint. Required.""" -class ElasticVolumeProperties(TypedDict, total=False): - """Elastic Volume properties. +class CifsUser(TypedDict, total=False): + """The effective CIFS username when accessing the volume data. - :ivar filePath: A unique file path for the volume. Used when creating mount targets. This needs - to be unique within the elastic capacity pool. Required. - :vartype filePath: str - :ivar size: Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to - 16TiB. Values expressed in bytes as multiples of 1 GiB. Required. - :vartype size: int - :ivar exportPolicy: Set of export policy rules. - :vartype exportPolicy: "ElasticExportPolicy" - :ivar protocolTypes: Set of support protocol types for the elastic volume. Required. - :vartype protocolTypes: list[Union[str, "ElasticProtocolType"]] - :ivar provisioningState: Azure lifecycle management. Known values are: "Accepted", "Creating", - "Patching", "Updating", "Deleting", "Moving", "Failed", and "Succeeded". - :vartype provisioningState: Union[str, "NetAppProvisioningState"] - :ivar availabilityStatus: Current availability status of the resource. Known values are: - "Online" and "Offline". - :vartype availabilityStatus: Union[str, "ElasticResourceAvailabilityStatus"] - :ivar snapshotResourceId: Resource identifier used to identify the Elastic Snapshot. - :vartype snapshotResourceId: str - :ivar mountTargets: List of mount targets that can be used to mount this volume. - :vartype mountTargets: list["ElasticMountTargetProperties"] - :ivar dataProtection: Data protection configuration option for the volume, including snapshot - policies and backup. - :vartype dataProtection: "ElasticVolumeDataProtectionProperties" - :ivar snapshotDirectoryVisibility: Controls the visibility of the volume's read-only snapshot - directory, which provides access to each of the volume's snapshots. Known values are: "Hidden" - and "Visible". - :vartype snapshotDirectoryVisibility: Union[str, "SnapshotDirectoryVisibility"] - :ivar smbProperties: SMB Properties. - :vartype smbProperties: "ElasticSmbProperties" - :ivar backupResourceId: Resource identifier used to identify the Elastic Backup. - :vartype backupResourceId: str - :ivar restorationState: The current state of the restoration process. Known values are: - "Restoring", "Restored", and "Failed". - :vartype restorationState: Union[str, "ElasticVolumeRestorationState"] + :ivar username: The CIFS user's username. + :vartype username: str """ - filePath: Required[str] - """A unique file path for the volume. Used when creating mount targets. This needs to be unique - within the elastic capacity pool. Required.""" - size: Required[int] - """Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to 16TiB. Values - expressed in bytes as multiples of 1 GiB. Required.""" - exportPolicy: "ElasticExportPolicy" - """Set of export policy rules.""" - protocolTypes: Required[list[Union[str, "ElasticProtocolType"]]] - """Set of support protocol types for the elastic volume. Required.""" - provisioningState: Union[str, "NetAppProvisioningState"] - """Azure lifecycle management. Known values are: \"Accepted\", \"Creating\", \"Patching\", - \"Updating\", \"Deleting\", \"Moving\", \"Failed\", and \"Succeeded\".""" - availabilityStatus: Union[str, "ElasticResourceAvailabilityStatus"] - """Current availability status of the resource. Known values are: \"Online\" and \"Offline\".""" - snapshotResourceId: str - """Resource identifier used to identify the Elastic Snapshot.""" - mountTargets: list["ElasticMountTargetProperties"] - """List of mount targets that can be used to mount this volume.""" - dataProtection: "ElasticVolumeDataProtectionProperties" - """Data protection configuration option for the volume, including snapshot policies and backup.""" - snapshotDirectoryVisibility: Union[str, "SnapshotDirectoryVisibility"] - """Controls the visibility of the volume's read-only snapshot directory, which provides access to - each of the volume's snapshots. Known values are: \"Hidden\" and \"Visible\".""" - smbProperties: "ElasticSmbProperties" - """SMB Properties.""" - backupResourceId: str - """Resource identifier used to identify the Elastic Backup.""" - restorationState: Union[str, "ElasticVolumeRestorationState"] - """The current state of the restoration process. Known values are: \"Restoring\", \"Restored\", - and \"Failed\".""" - - -class ElasticVolumeRevert(TypedDict, total=False): - """Reverts the elastic volume to the specified snapshot. - - :ivar snapshotResourceId: Resource identifier used to identify the Elastic Snapshot. - :vartype snapshotResourceId: str - """ + username: str + """The CIFS user's username.""" - snapshotResourceId: str - """Resource identifier used to identify the Elastic Snapshot.""" +class CredentialsAkvDetails(TypedDict, total=False): + """Specifies the Azure Key Vault settings for storing the bucket credentials. -class ElasticVolumeSnapshotProperties(TypedDict, total=False): - """Elastic Volume Snapshot Properties. + :ivar credentialsKeyVaultUri: The base URI of the Azure Key Vault that is used when storing the + bucket credentials. + :vartype credentialsKeyVaultUri: str + :ivar secretName: The name of the secret stored in Azure Key Vault. The associated key pair has + the following structure: - :ivar snapshotPolicyResourceId: Snapshot Policy ResourceId. - :vartype snapshotPolicyResourceId: str + { + "access_key_id": "", + "secret_access_key": "" + }. + :vartype secretName: str """ - snapshotPolicyResourceId: str - """Snapshot Policy ResourceId.""" + credentialsKeyVaultUri: str + """The base URI of the Azure Key Vault that is used when storing the bucket credentials.""" + secretName: str + """The name of the secret stored in Azure Key Vault. The associated key pair has the following + structure: + + { + \"access_key_id\": \"\", + \"secret_access_key\": \"\" + }.""" -class ElasticVolumeUpdate(TypedDict, total=False): - """The type used for update operations of the ElasticVolume. +class DailySchedule(TypedDict, total=False): + """Daily Schedule properties. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "ElasticVolumeUpdateProperties" + :ivar snapshotsToKeep: Daily snapshot count to keep. + :vartype snapshotsToKeep: int + :ivar hour: Indicates which hour in UTC timezone a snapshot should be taken. + :vartype hour: int + :ivar minute: Indicates which minute snapshot should be taken. + :vartype minute: int + :ivar usedBytes: Resource size in bytes, current storage usage for the volume in bytes. + :vartype usedBytes: int """ - tags: dict[str, str] - """Resource tags.""" - properties: "ElasticVolumeUpdateProperties" - """The resource-specific properties for this resource.""" + snapshotsToKeep: int + """Daily snapshot count to keep.""" + hour: int + """Indicates which hour in UTC timezone a snapshot should be taken.""" + minute: int + """Indicates which minute snapshot should be taken.""" + usedBytes: int + """Resource size in bytes, current storage usage for the volume in bytes.""" -class ElasticVolumeUpdateProperties(TypedDict, total=False): - """The updatable properties of the ElasticVolume. +class DestinationReplication(TypedDict, total=False): + """Destination replication properties. - :ivar size: Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to - 16TiB. Values expressed in bytes as multiples of 1 GiB. - :vartype size: int - :ivar exportPolicy: Set of export policy rules. - :vartype exportPolicy: "ElasticExportPolicy" - :ivar dataProtection: Data protection configuration option for the volume, including snapshot - policies and backup. - :vartype dataProtection: "ElasticVolumeDataProtectionPatchProperties" - :ivar snapshotDirectoryVisibility: Controls the visibility of the volume's read-only snapshot - directory, which provides access to each of the volume's snapshots. Known values are: "Hidden" - and "Visible". - :vartype snapshotDirectoryVisibility: Union[str, "SnapshotDirectoryVisibility"] - :ivar smbProperties: SMB Properties. - :vartype smbProperties: "ElasticSmbPatchProperties" + :ivar resourceId: The resource ID of the remote volume. + :vartype resourceId: str + :ivar replicationType: Indicates whether the replication is cross zone or cross region. Known + values are: "CrossRegionReplication" and "CrossZoneReplication". + :vartype replicationType: Union[str, "ReplicationType"] + :ivar region: The remote region for the destination volume. + :vartype region: str + :ivar zone: The remote zone for the destination volume. + :vartype zone: str """ - size: int - """Maximum size allowed for a volume in bytes. Valid values are in the range 1GiB to 16TiB. Values - expressed in bytes as multiples of 1 GiB.""" - exportPolicy: "ElasticExportPolicy" - """Set of export policy rules.""" - dataProtection: "ElasticVolumeDataProtectionPatchProperties" - """Data protection configuration option for the volume, including snapshot policies and backup.""" - snapshotDirectoryVisibility: Union[str, "SnapshotDirectoryVisibility"] - """Controls the visibility of the volume's read-only snapshot directory, which provides access to - each of the volume's snapshots. Known values are: \"Hidden\" and \"Visible\".""" - smbProperties: "ElasticSmbPatchProperties" - """SMB Properties.""" + resourceId: str + """The resource ID of the remote volume.""" + replicationType: Union[str, "ReplicationType"] + """Indicates whether the replication is cross zone or cross region. Known values are: + \"CrossRegionReplication\" and \"CrossZoneReplication\".""" + region: str + """The remote region for the destination volume.""" + zone: str + """The remote zone for the destination volume.""" class EncryptionIdentity(TypedDict, total=False): @@ -2968,6 +1698,26 @@ class EncryptionIdentity(TypedDict, total=False): """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" +class EncryptionIdentityPatch(TypedDict, total=False): + """Identity used to authenticate with key vault for PATCH operations. + + :ivar userAssignedIdentity: The ARM resource identifier of the user assigned identity used to + authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match + key of identity.userAssignedIdentities. + :vartype userAssignedIdentity: str + :ivar federatedClientId: ClientId of the multi-tenant Entra ID Application. Used to access + cross-tenant keyvaults. + :vartype federatedClientId: str + """ + + userAssignedIdentity: str + """The ARM resource identifier of the user assigned identity used to authenticate with key vault. + Applicable if identity.type has 'UserAssigned'. It should match key of + identity.userAssignedIdentities.""" + federatedClientId: str + """ClientId of the multi-tenant Entra ID Application. Used to access cross-tenant keyvaults.""" + + class EncryptionTransitionRequest(TypedDict, total=False): """Encryption transition request. @@ -2984,113 +1734,6 @@ class EncryptionTransitionRequest(TypedDict, total=False): """Identifier of the private endpoint to reach the Azure Key Vault. Required.""" -class EntraIdAkvConfig(TypedDict, total=False): - """Using AKV config, certificate will be fetched, which will contain private key & public - certificate, that correspond to the public certificate which is uploaded on the application - created by customer. This will be used further for authentication. - - :ivar azureKeyVaultUri: The Azure Key Vault URI where the Entra ID credentials are stored. - Required. - :vartype azureKeyVaultUri: str - :ivar certificateName: The name of the certificate in Azure Key Vault. Required. - :vartype certificateName: str - :ivar userAssignedIdentity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. - :vartype userAssignedIdentity: str - """ - - azureKeyVaultUri: Required[str] - """The Azure Key Vault URI where the Entra ID credentials are stored. Required.""" - certificateName: Required[str] - """The name of the certificate in Azure Key Vault. Required.""" - userAssignedIdentity: str - """The ARM resource identifier of the user assigned identity used to authenticate with key vault.""" - - -class EntraIdAkvConfigPatch(TypedDict, total=False): - """Entra ID Patch configuration for the account. - - :ivar azureKeyVaultUri: The Azure Key Vault URI where the Entra ID credentials are stored. - :vartype azureKeyVaultUri: str - :ivar certificateName: The name of the certificate in Azure Key Vault. - :vartype certificateName: str - :ivar userAssignedIdentity: The ARM resource identifier of the user assigned identity used to - authenticate with key vault. - :vartype userAssignedIdentity: str - """ - - azureKeyVaultUri: str - """The Azure Key Vault URI where the Entra ID credentials are stored.""" - certificateName: str - """The name of the certificate in Azure Key Vault.""" - userAssignedIdentity: str - """The ARM resource identifier of the user assigned identity used to authenticate with key vault.""" - - -class EntraIdConfig(TypedDict, total=False): - """Entra ID configuration for the account. - - :ivar applicationId: ApplicationId of the app created by customer to provide authentication and - required API permissions for Microsoft Graph endpoint. Required. - :vartype applicationId: str - :ivar domain: Domain of the Active directory synced to Entra ID for hybrid identities. - Required. - :vartype domain: str - :ivar serverNamePrefix: Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be - generated for SMB share, using this FQDN, SMB Share will be mounted on Entra Joined VM. - Required. - :vartype serverNamePrefix: str - :ivar entraIdAkvConfig: Using AKV config, certificate will be fetched, which will contain - private key & public certificate, that correspond to the public certificate which is uploaded - on the application created by customer. This will be used further for authentication. - :vartype entraIdAkvConfig: "EntraIdAkvConfig" - """ - - applicationId: Required[str] - """ApplicationId of the app created by customer to provide authentication and required API - permissions for Microsoft Graph endpoint. Required.""" - domain: Required[str] - """Domain of the Active directory synced to Entra ID for hybrid identities. Required.""" - serverNamePrefix: Required[str] - """Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be generated for SMB share, - using this FQDN, SMB Share will be mounted on Entra Joined VM. Required.""" - entraIdAkvConfig: "EntraIdAkvConfig" - """Using AKV config, certificate will be fetched, which will contain private key & public - certificate, that correspond to the public certificate which is uploaded on the application - created by customer. This will be used further for authentication.""" - - -class EntraIdConfigPatch(TypedDict, total=False): - """Entra ID Patch configuration for the account. - - :ivar applicationId: ApplicationId of the app created by customer to provide authentication and - required API permissions for Microsoft Graph endpoint. - :vartype applicationId: str - :ivar domain: Domain of the Active directory synced to Entra ID for hybrid identities. - :vartype domain: str - :ivar serverNamePrefix: Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be - generated for SMB share, using this FQDN, SMB Share will be mounted on Entra Joined VM. - :vartype serverNamePrefix: str - :ivar entraIdAkvConfig: Using AKV config, certificate will be fetched, which will contain - private key & public certificate, that correspond to the public certificate which is uploaded - on the application created by customer. This will be used further for authentication. - :vartype entraIdAkvConfig: "EntraIdAkvConfigPatch" - """ - - applicationId: str - """ApplicationId of the app created by customer to provide authentication and required API - permissions for Microsoft Graph endpoint.""" - domain: str - """Domain of the Active directory synced to Entra ID for hybrid identities.""" - serverNamePrefix: str - """Using ServerNamePrefix, FQDN (Fully Qualified Domain Name) will be generated for SMB share, - using this FQDN, SMB Share will be mounted on Entra Joined VM.""" - entraIdAkvConfig: "EntraIdAkvConfigPatch" - """Using AKV config, certificate will be fetched, which will contain private key & public - certificate, that correspond to the public certificate which is uploaded on the application - created by customer. This will be used further for authentication.""" - - class ExportPolicyRule(TypedDict, total=False): """Volume Export Policy Rule. @@ -3286,6 +1929,25 @@ class KeyVaultProperties(TypedDict, total=False): \"Error\", and \"Updating\".""" +class KeyVaultPropertiesPatch(TypedDict, total=False): + """Properties of key vault for PATCH operations (no required properties). + + :ivar keyVaultUri: The Uri of KeyVault. + :vartype keyVaultUri: str + :ivar keyName: The name of KeyVault key. + :vartype keyName: str + :ivar keyVaultResourceId: The resource ID of KeyVault. + :vartype keyVaultResourceId: str + """ + + keyVaultUri: str + """The Uri of KeyVault.""" + keyName: str + """The name of KeyVault key.""" + keyVaultResourceId: str + """The resource ID of KeyVault.""" + + class LdapConfiguration(TypedDict, total=False): """LDAP configuration. @@ -3699,8 +2361,8 @@ class PoolChangeRequest(TypedDict, total=False): class PoolPatchProperties(TypedDict, total=False): """Patchable pool properties. - :ivar size: Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 - bytes) or in 1TiB chunks (value must be multiple of 1099511627776). + :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value + must be multiple of 1099511627776). :vartype size: int :ivar qosType: The qos type of the pool. Known values are: "Auto" and "Manual". :vartype qosType: Union[str, "QosType"] @@ -3712,8 +2374,8 @@ class PoolPatchProperties(TypedDict, total=False): """ size: int - """Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 bytes) or in - 1TiB chunks (value must be multiple of 1099511627776).""" + """Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be + multiple of 1099511627776).""" qosType: Union[str, "QosType"] """The qos type of the pool. Known values are: \"Auto\" and \"Manual\".""" coolAccess: bool @@ -3728,8 +2390,8 @@ class PoolProperties(TypedDict, total=False): :ivar poolId: UUID v4 used to identify the Pool. :vartype poolId: str - :ivar size: Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 - bytes) or in 1TiB chunks (value must be multiple of 1099511627776). Required. + :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value + must be multiple of 1099511627776). Required. :vartype size: int :ivar serviceLevel: The service level of the file system. Required. Known values are: "Standard", "Premium", "Ultra", "StandardZRS", and "Flexible". @@ -3756,8 +2418,8 @@ class PoolProperties(TypedDict, total=False): poolId: str """UUID v4 used to identify the Pool.""" size: Required[int] - """Provisioned size of the pool (in bytes). Allowed values are 512GiB (549755813888 bytes) or in - 1TiB chunks (value must be multiple of 1099511627776). Required.""" + """Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be + multiple of 1099511627776). Required.""" serviceLevel: Required[Union[str, "ServiceLevel"]] """The service level of the file system. Required. Known values are: \"Standard\", \"Premium\", \"Ultra\", \"StandardZRS\", and \"Flexible\".""" @@ -4067,57 +2729,6 @@ class ResourceNameAvailabilityRequest(TypedDict, total=False): """Resource group name. Required.""" -class SecretPassword(TypedDict, total=False): - """Access password from Azure KeyVault Secrets to connect Active Directory. - - :ivar keyVaultProperties: Properties provided by KeyVault. - :vartype keyVaultProperties: "SecretPasswordKeyVaultProperties" - :ivar identity: Identity used to authenticate to KeyVault. Applicable if keySource is - 'Microsoft.KeyVault'. - :vartype identity: "SecretPasswordIdentity" - """ - - keyVaultProperties: "SecretPasswordKeyVaultProperties" - """Properties provided by KeyVault.""" - identity: "SecretPasswordIdentity" - """Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'.""" - - -class SecretPasswordIdentity(TypedDict, total=False): - """Identity used to authenticate with key vault. - - :ivar principalId: The principal ID (object ID) of the identity used to authenticate with key - vault. Read-only. - :vartype principalId: str - :ivar userAssignedIdentity: The Azure resource identifier of the user assigned identity used to - authenticate with key vault. Applicable if identity.type has 'UserAssigned'. It should match - key of identity.userAssignedIdentities. - :vartype userAssignedIdentity: str - """ - - principalId: str - """The principal ID (object ID) of the identity used to authenticate with key vault. Read-only.""" - userAssignedIdentity: str - """The Azure resource identifier of the user assigned identity used to authenticate with key - vault. Applicable if identity.type has 'UserAssigned'. It should match key of - identity.userAssignedIdentities.""" - - -class SecretPasswordKeyVaultProperties(TypedDict, total=False): - """Properties of key vault to get the secrets for password. - - :ivar keyVaultUri: The Uri of KeyVault. Required. - :vartype keyVaultUri: str - :ivar secretName: The name of KeyVault password secret. Required. - :vartype secretName: str - """ - - keyVaultUri: Required[str] - """The Uri of KeyVault. Required.""" - secretName: Required[str] - """The name of KeyVault password secret. Required.""" - - class SmbSettings(TypedDict, total=False): """SMB settings for the cache. @@ -4125,11 +2736,10 @@ class SmbSettings(TypedDict, total=False): SMB/DualProtocol cache. Known values are: "Disabled" and "Enabled". :vartype smbEncryption: Union[str, "SmbEncryptionState"] :ivar smbAccessBasedEnumeration: Enables access-based enumeration share property for SMB - Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and - "Enabled". + Shares. Only applicable for SMB/DualProtocol cache. Known values are: "Disabled" and "Enabled". :vartype smbAccessBasedEnumeration: Union[str, "SmbAccessBasedEnumeration"] :ivar smbNonBrowsable: Enables non-browsable property for SMB Shares. Only applicable for - SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". + SMB/DualProtocol cache. Known values are: "Disabled" and "Enabled". :vartype smbNonBrowsable: Union[str, "SmbNonBrowsable"] """ @@ -4138,9 +2748,9 @@ class SmbSettings(TypedDict, total=False): values are: \"Disabled\" and \"Enabled\".""" smbAccessBasedEnumeration: Union[str, "SmbAccessBasedEnumeration"] """Enables access-based enumeration share property for SMB Shares. Only applicable for - SMB/DualProtocol volume. Known values are: \"Disabled\" and \"Enabled\".""" + SMB/DualProtocol cache. Known values are: \"Disabled\" and \"Enabled\".""" smbNonBrowsable: Union[str, "SmbNonBrowsable"] - """Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. + """Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol cache. Known values are: \"Disabled\" and \"Enabled\".""" @@ -4687,8 +3297,7 @@ class VolumePatchProperties(TypedDict, total=False): :ivar usageThreshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an - exceptional basis, from to 2400GiB to 2400TiB. For extra large volumes, valid values are in the - range 2400GiB to 7200TiB. Values expressed in bytes as multiples of 1 GiB. + exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. :vartype usageThreshold: int :ivar exportPolicy: Set of export policy rules. :vartype exportPolicy: "VolumePatchPropertiesExportPolicy" @@ -4756,8 +3365,7 @@ class VolumePatchProperties(TypedDict, total=False): """Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to - 2400GiB to 2400TiB. For extra large volumes, valid values are in the range 2400GiB to 7200TiB. - Values expressed in bytes as multiples of 1 GiB.""" + 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB.""" exportPolicy: "VolumePatchPropertiesExportPolicy" """Set of export policy rules.""" protocolTypes: list[str] @@ -4855,8 +3463,8 @@ class VolumeProperties(TypedDict, total=False): :ivar usageThreshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an - exceptional basis, from to 2400GiB to 2400TiB. For extra large volumes, valid values are in the - range 2400GiB to 7200TiB. Values expressed in bytes as multiples of 1 GiB. Required. + exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. + Required. :vartype usageThreshold: int :ivar exportPolicy: Set of export policy rules. :vartype exportPolicy: "VolumePropertiesExportPolicy" @@ -4948,9 +3556,6 @@ class VolumeProperties(TypedDict, total=False): :vartype keyVaultPrivateEndpointResourceId: str :ivar ldapEnabled: Specifies whether LDAP is enabled or not for a given NFS volume. :vartype ldapEnabled: bool - :ivar ldapServerType: Specifies the type of LDAP server for a given NFS volume. Known values - are: "ActiveDirectory" and "OpenLDAP". - :vartype ldapServerType: Union[str, "LdapServerType"] :ivar coolAccess: Specifies whether Cool Access(tiering) is enabled for the volume. :vartype coolAccess: bool :ivar coolnessPeriod: Specifies the number of days after which data that is not accessed by @@ -5029,27 +3634,11 @@ class VolumeProperties(TypedDict, total=False): :vartype provisionedAvailabilityZone: str :ivar isLargeVolume: Specifies whether volume is a Large Volume or Regular Volume. :vartype isLargeVolume: bool - :ivar largeVolumeType: Specifies the type of the Large Volume. When set to 'LargeVolume', the - large volume is created with standard configuration. If it is set to - 'ExtraLargeVolume7Dot2PiB', the extra large volume is created with higher capacity limit 7.2PiB - with cool access enabled, delivering higher capacity limit with lower costs. Known values are: - "LargeVolume" and "PremExtraLargeVolume7Dot2PiB". - :vartype largeVolumeType: Union[str, "LargeVolumeType"] :ivar originatingResourceId: Id of the snapshot or backup that the volume is restored from. :vartype originatingResourceId: str :ivar inheritedSizeInBytes: Space shared by short term clone volume with parent volume in bytes. :vartype inheritedSizeInBytes: int - :ivar language: Language supported for volume. Known values are: "c.utf-8", "utf8mb4", "ar", - "ar.utf-8", "hr", "hr.utf-8", "cs", "cs.utf-8", "da", "da.utf-8", "nl", "nl.utf-8", "en", - "en.utf-8", "fi", "fi.utf-8", "fr", "fr.utf-8", "de", "de.utf-8", "he", "he.utf-8", "hu", - "hu.utf-8", "it", "it.utf-8", "ja", "ja.utf-8", "ja-v1", "ja-v1.utf-8", "ja-jp.pck", - "ja-jp.pck.utf-8", "ja-jp.932", "ja-jp.932.utf-8", "ja-jp.pck-v2", "ja-jp.pck-v2.utf-8", "ko", - "ko.utf-8", "no", "no.utf-8", "pl", "pl.utf-8", "pt", "pt.utf-8", "c", "ro", "ro.utf-8", "ru", - "ru.utf-8", "zh", "zh.utf-8", "zh.gbk", "zh.gbk.utf-8", "zh-tw.big5", "zh-tw.big5.utf-8", - "zh-tw", "zh-tw.utf-8", "sk", "sk.utf-8", "sl", "sl.utf-8", "es", "es.utf-8", "sv", "sv.utf-8", - "tr", "tr.utf-8", "en-us", and "en-us.utf-8". - :vartype language: Union[str, "VolumeLanguage"] :ivar breakthroughMode: Specifies whether the volume operates in Breakthrough Mode. Known values are: "Enabled" and "Disabled". :vartype breakthroughMode: Union[str, "BreakthroughMode"] @@ -5066,8 +3655,7 @@ class VolumeProperties(TypedDict, total=False): """Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to - 2400GiB to 2400TiB. For extra large volumes, valid values are in the range 2400GiB to 7200TiB. - Values expressed in bytes as multiples of 1 GiB. Required.""" + 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. Required.""" exportPolicy: "VolumePropertiesExportPolicy" """Set of export policy rules.""" protocolTypes: list[str] @@ -5148,9 +3736,6 @@ class VolumeProperties(TypedDict, total=False): volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'.""" ldapEnabled: bool """Specifies whether LDAP is enabled or not for a given NFS volume.""" - ldapServerType: Union[str, "LdapServerType"] - """Specifies the type of LDAP server for a given NFS volume. Known values are: \"ActiveDirectory\" - and \"OpenLDAP\".""" coolAccess: bool """Specifies whether Cool Access(tiering) is enabled for the volume.""" coolnessPeriod: int @@ -5222,28 +3807,10 @@ class VolumeProperties(TypedDict, total=False): zone where the volume resides.""" isLargeVolume: bool """Specifies whether volume is a Large Volume or Regular Volume.""" - largeVolumeType: Union[str, "LargeVolumeType"] - """Specifies the type of the Large Volume. When set to 'LargeVolume', the large volume is created - with standard configuration. If it is set to 'ExtraLargeVolume7Dot2PiB', the extra large volume - is created with higher capacity limit 7.2PiB with cool access enabled, delivering higher - capacity limit with lower costs. Known values are: \"LargeVolume\" and - \"PremExtraLargeVolume7Dot2PiB\".""" originatingResourceId: Optional[str] """Id of the snapshot or backup that the volume is restored from.""" inheritedSizeInBytes: Optional[int] """Space shared by short term clone volume with parent volume in bytes.""" - language: Union[str, "VolumeLanguage"] - """Language supported for volume. Known values are: \"c.utf-8\", \"utf8mb4\", \"ar\", - \"ar.utf-8\", \"hr\", \"hr.utf-8\", \"cs\", \"cs.utf-8\", \"da\", \"da.utf-8\", \"nl\", - \"nl.utf-8\", \"en\", \"en.utf-8\", \"fi\", \"fi.utf-8\", \"fr\", \"fr.utf-8\", \"de\", - \"de.utf-8\", \"he\", \"he.utf-8\", \"hu\", \"hu.utf-8\", \"it\", \"it.utf-8\", \"ja\", - \"ja.utf-8\", \"ja-v1\", \"ja-v1.utf-8\", \"ja-jp.pck\", \"ja-jp.pck.utf-8\", \"ja-jp.932\", - \"ja-jp.932.utf-8\", \"ja-jp.pck-v2\", \"ja-jp.pck-v2.utf-8\", \"ko\", \"ko.utf-8\", \"no\", - \"no.utf-8\", \"pl\", \"pl.utf-8\", \"pt\", \"pt.utf-8\", \"c\", \"ro\", \"ro.utf-8\", \"ru\", - \"ru.utf-8\", \"zh\", \"zh.utf-8\", \"zh.gbk\", \"zh.gbk.utf-8\", \"zh-tw.big5\", - \"zh-tw.big5.utf-8\", \"zh-tw\", \"zh-tw.utf-8\", \"sk\", \"sk.utf-8\", \"sl\", \"sl.utf-8\", - \"es\", \"es.utf-8\", \"sv\", \"sv.utf-8\", \"tr\", \"tr.utf-8\", \"en-us\", and - \"en-us.utf-8\".""" breakthroughMode: Union[str, "BreakthroughMode"] """Specifies whether the volume operates in Breakthrough Mode. Known values are: \"Enabled\" and \"Disabled\".""" @@ -5332,8 +3899,8 @@ class VolumeQuotaRulesProperties(TypedDict, total=False): """Volume Quota Rule properties. :ivar provisioningState: Gets the status of the VolumeQuotaRule at the time the operation was - called. Known values are: "Accepted", "Creating", "Patching", "Updating", "Deleting", "Moving", - "Failed", and "Succeeded". + called. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", "Creating", + "Patching", "Updating", "Deleting", and "Moving". :vartype provisioningState: Union[str, "NetAppProvisioningState"] :ivar quotaSizeInKiBs: Size of quota. :vartype quotaSizeInKiBs: int @@ -5348,8 +3915,8 @@ class VolumeQuotaRulesProperties(TypedDict, total=False): provisioningState: Union[str, "NetAppProvisioningState"] """Gets the status of the VolumeQuotaRule at the time the operation was called. Known values are: - \"Accepted\", \"Creating\", \"Patching\", \"Updating\", \"Deleting\", \"Moving\", \"Failed\", - and \"Succeeded\".""" + \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", \"Creating\", \"Patching\", + \"Updating\", \"Deleting\", and \"Moving\".""" quotaSizeInKiBs: int """Size of quota.""" quotaType: Union[str, "QuotaType"] diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py index 448ebe1dec66..7c78fd92cf71 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Accounts_ChangeKeyVault.json +# x-ms-original-file: 2026-08-01/Accounts_ChangeKeyVault.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py index a5d97788d40e..208d7dd9233d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Accounts_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01/Accounts_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py index 622c576e0363..827ea8cea2fe 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Accounts_CreateOrUpdateAD.json +# x-ms-original-file: 2026-08-01/Accounts_CreateOrUpdateAD.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ldap_config.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ldap_config.py index 623f860d20b8..9dae3070b957 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ldap_config.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ldap_config.py @@ -61,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Accounts_CreateOrUpdateLdapConfig.json +# x-ms-original-file: 2026-08-01/Accounts_CreateOrUpdateLdapConfig.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py index 1335e8938c11..7ac966e1964b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Accounts_Delete.json +# x-ms-original-file: 2026-08-01/Accounts_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py index bf6256328124..3f82f3f4d166 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Accounts_Get.json +# x-ms-original-file: 2026-08-01/Accounts_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py index 65b1340c8ad6..533da8159651 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Accounts_GetChangeKeyVaultInformation.json +# x-ms-original-file: 2026-08-01/Accounts_GetChangeKeyVaultInformation.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py index 28382ebf49c4..7851e13db770 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Accounts_List.json +# x-ms-original-file: 2026-08-01/Accounts_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list_by_subscription.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list_by_subscription.py index db76aad88b65..fc53a6830feb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list_by_subscription.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Accounts_ListBySubscription.json +# x-ms-original-file: 2026-08-01/Accounts_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_refresh_ldap_bind_password.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_refresh_ldap_bind_password.py index fafb0e4ebb21..2b0368bfa122 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_refresh_ldap_bind_password.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_refresh_ldap_bind_password.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Accounts_RefreshLdapBindPassword.json +# x-ms-original-file: 2026-08-01/Accounts_RefreshLdapBindPassword.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py index 7e9fe7fc1162..3e0ee6d4f325 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Accounts_RenewCredentials.json +# x-ms-original-file: 2026-08-01/Accounts_RenewCredentials.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_transition_encryption_key.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_transition_encryption_key.py index 4d8489995035..3e16412960a0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_transition_encryption_key.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_transition_encryption_key.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Accounts_TransitionEncryptionKey.json +# x-ms-original-file: 2026-08-01/Accounts_TransitionEncryptionKey.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py index 9a0527223a5a..0f9c270b32ea 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Accounts_Update.json +# x-ms-original-file: 2026-08-01/Accounts_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_create_or_update.py deleted file mode 100644 index f9a15bddf475..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_create_or_update.py +++ /dev/null @@ -1,73 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python active_directory_configs_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.active_directory_configs.begin_create_or_update( - resource_group_name="myRG", - active_directory_config_name="adconfig1", - body={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentity1": {} - }, - }, - "location": "eastus", - "properties": { - "administrators": ["admin1"], - "backupOperators": ["backupOp1"], - "dns": ["10.10.10.4", "10.10.10.5"], - "domain": "example.net", - "organizationalUnit": "OU=Computers,DC=corp,DC=contoso,DC=com", - "secretPassword": { - "identity": { - "userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentity1" - }, - "keyVaultProperties": { - "keyVaultUri": "https://example.vault.azure.net/", - "secretName": "activeDirectoryPassword", - }, - }, - "securityOperators": ["secOp1"], - "site": "Default-First-Site-Name", - "smbServerName": "smbServer", - "userName": "admin1", - }, - "tags": {"ac-tag1": "activeDirectoryConfig1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ActiveDirectoryConfigs_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_delete.py deleted file mode 100644 index 716a8ccf12c1..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python active_directory_configs_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.active_directory_configs.begin_delete( - resource_group_name="myRG", - active_directory_config_name="adconfig1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ActiveDirectoryConfigs_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_get.py deleted file mode 100644 index f8ca255587f5..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python active_directory_configs_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.active_directory_configs.get( - resource_group_name="myRG", - active_directory_config_name="adconfig1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ActiveDirectoryConfigs_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_resource_group.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_resource_group.py deleted file mode 100644 index 63131e52d363..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python active_directory_configs_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.active_directory_configs.list_by_resource_group( - resource_group_name="myRG", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ActiveDirectoryConfigs_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_subscription.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_subscription.py deleted file mode 100644 index a28f6669f3d7..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_list_by_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python active_directory_configs_list_by_subscription.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.active_directory_configs.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ActiveDirectoryConfigs_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_update.py deleted file mode 100644 index 3af14c34a3f1..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/active_directory_configs_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python active_directory_configs_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.active_directory_configs.begin_update( - resource_group_name="myRG", - active_directory_config_name="adconfig1", - body={"properties": {"smbServerName": "smbServer2"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ActiveDirectoryConfigs_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py index b15de4673d66..6c612d28ce85 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupPolicies_Create.json +# x-ms-original-file: 2026-08-01/BackupPolicies_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py index a24c2c9d6fe5..d50693160056 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/BackupPolicies_Delete.json +# x-ms-original-file: 2026-08-01/BackupPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py index 6110902c11fd..586e31de9d3c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupPolicies_Get.json +# x-ms-original-file: 2026-08-01/BackupPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py index a2feeba39b1c..b1c04998d91a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/BackupPolicies_List.json +# x-ms-original-file: 2026-08-01/BackupPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py index d0558180cd15..6c8c01842970 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupPolicies_Update.json +# x-ms-original-file: 2026-08-01/BackupPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py index 731342aec517..0557dcdb21b1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupVaults_Create.json +# x-ms-original-file: 2026-08-01/BackupVaults_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py index cde646796a9d..f126baf7acc7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/BackupVaults_Delete.json +# x-ms-original-file: 2026-08-01/BackupVaults_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py index 2f1ba8bcf0d9..11b6836e6077 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupVaults_Get.json +# x-ms-original-file: 2026-08-01/BackupVaults_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py index 7710015efc5d..4c7bd60446ef 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/BackupVaults_List.json +# x-ms-original-file: 2026-08-01/BackupVaults_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py index 5a18c7879756..20dfead1a94b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupVaults_Update.json +# x-ms-original-file: 2026-08-01/BackupVaults_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list_by_vault.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list_by_vault.py index c2182338e588..ddd88fe3d2e0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list_by_vault.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list_by_vault.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Backups_ListByVault.json +# x-ms-original-file: 2026-08-01/Backups_ListByVault.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py index 0ecd6c22e784..3833d0a71852 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/BackupsUnderAccount_Migrate.json +# x-ms-original-file: 2026-08-01/BackupsUnderAccount_Migrate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py index ef5bc73224cf..ad45573f41bb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupsUnderBackupVault_Create.json +# x-ms-original-file: 2026-08-01/BackupsUnderBackupVault_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py index abef1265bdc4..2aa9627042f3 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/BackupsUnderBackupVault_Delete.json +# x-ms-original-file: 2026-08-01/BackupsUnderBackupVault_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py index 7ff69b1508ac..3d29b56ea8a9 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupsUnderBackupVault_Get.json +# x-ms-original-file: 2026-08-01/BackupsUnderBackupVault_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py index fbf0669c6a7e..2adb5c4bcc6f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py @@ -43,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/BackupsUnderBackupVault_SingleFileRestore.json +# x-ms-original-file: 2026-08-01/BackupsUnderBackupVault_SingleFileRestore.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py index e700c590ec16..5395b658d2c5 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/BackupsUnderBackupVault_Update.json +# x-ms-original-file: 2026-08-01/BackupsUnderBackupVault_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py index 91894de76b58..ab7585a2ed61 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/BackupsUnderVolume_Migrate.json +# x-ms-original-file: 2026-08-01/BackupsUnderVolume_Migrate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update.py index c8fe6c37821a..83c80173dee0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Buckets_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01/Buckets_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update_with_akv.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update_with_akv.py index 0ffef9add54c..25db2a92cb72 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update_with_akv.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_create_or_update_with_akv.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -43,12 +42,10 @@ def main(): "certificateAkvDetails": { "certificateKeyVaultUri": "https://REDACTED.vault.azure.net/", "certificateName": "my-certificate", - "userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", }, "credentialsAkvDetails": { "credentialsKeyVaultUri": "https://REDACTED.vault.azure.net/", "secretName": "my-secret", - "userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", }, }, "fileSystemUser": {"nfsUser": {"groupId": 1000, "userId": 1001}}, @@ -61,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Buckets_CreateOrUpdateWithAkv.json +# x-ms-original-file: 2026-08-01/Buckets_CreateOrUpdateWithAkv.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_delete.py index 9a6c6178caec..432040b03733 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Buckets_Delete.json +# x-ms-original-file: 2026-08-01/Buckets_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_akv_credentials.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_akv_credentials.py index d107dc59c0c8..adafa716dba1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_akv_credentials.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_akv_credentials.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Buckets_GenerateAkvCredentials.json +# x-ms-original-file: 2026-08-01/Buckets_GenerateAkvCredentials.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_credentials.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_credentials.py index 4f87a6977028..85de0ba8d306 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_credentials.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_generate_credentials.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Buckets_GenerateCredentials.json +# x-ms-original-file: 2026-08-01/Buckets_GenerateCredentials.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_get.py index 02cbea984165..c6ba43adf538 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Buckets_Get.json +# x-ms-original-file: 2026-08-01/Buckets_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_list.py index f535703851f6..b859f435b63d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Buckets_List.json +# x-ms-original-file: 2026-08-01/Buckets_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_refresh_certificate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_refresh_certificate.py index de124989cae1..26aebe9344a7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_refresh_certificate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_refresh_certificate.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Buckets_RefreshCertificate.json +# x-ms-original-file: 2026-08-01/Buckets_RefreshCertificate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update.py index 40013e22756f..d44174fec629 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Buckets_Update.json +# x-ms-original-file: 2026-08-01/Buckets_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update_with_akv.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update_with_akv.py index 00909439d286..92920c64b01a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update_with_akv.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/buckets_update_with_akv.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -43,12 +42,10 @@ def main(): "certificateAkvDetails": { "certificateKeyVaultUri": "https://REDACTED.vault.azure.net/", "certificateName": "my-certificate", - "userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", }, "credentialsAkvDetails": { "credentialsKeyVaultUri": "https://REDACTED.vault.azure.net/", "secretName": "my-secret", - "userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", }, }, "permissions": "ReadOnly", @@ -59,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Buckets_UpdateWithAkv.json +# x-ms-original-file: 2026-08-01/Buckets_UpdateWithAkv.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_create_or_update.py index 3eba3b536d8f..ddcbe271e430 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_create_or_update.py @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Caches_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01/Caches_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_delete.py index 19b90543e7da..0572c7308622 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Caches_Delete.json +# x-ms-original-file: 2026-08-01/Caches_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_get.py index 7f50c882d6ca..d32123268244 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Caches_Get.json +# x-ms-original-file: 2026-08-01/Caches_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list.py index b1cf98673848..1e9292f85d95 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Caches_List.json +# x-ms-original-file: 2026-08-01/Caches_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list_peering_passphrases.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list_peering_passphrases.py index 291a6ef1858c..8c6f34bb761b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list_peering_passphrases.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_list_peering_passphrases.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Caches_ListPeeringPassphrases.json +# x-ms-original-file: 2026-08-01/Caches_ListPeeringPassphrases.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_pool_change.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_pool_change.py index d795adf59252..99a1fcd556a3 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_pool_change.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_pool_change.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Caches_PoolChange.json +# x-ms-original-file: 2026-08-01/Caches_PoolChange.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_reset_smb_password.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_reset_smb_password.py index c0d039584061..d93edc7e2cb5 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_reset_smb_password.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_reset_smb_password.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Caches_ResetSmbPassword.json +# x-ms-original-file: 2026-08-01/Caches_ResetSmbPassword.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_update.py index 2b683e178a52..9bec05fcc9fc 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/caches_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Caches_Update.json +# x-ms-original-file: 2026-08-01/Caches_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/check_file_path_availability.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/check_file_path_availability.py index fc18751f1682..44b61463724a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/check_file_path_availability.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/check_file_path_availability.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/CheckFilePathAvailability.json +# x-ms-original-file: 2026-08-01/CheckFilePathAvailability.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/check_name_availability.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/check_name_availability.py index 021c59d34c5f..78d89ccb2310 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/check_name_availability.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/check_name_availability.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/CheckNameAvailability.json +# x-ms-original-file: 2026-08-01/CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/check_quota_availability.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/check_quota_availability.py index 98bdf7ed3a79..d9c5c4011871 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/check_quota_availability.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/check_quota_availability.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/CheckQuotaAvailability.json +# x-ms-original-file: 2026-08-01/CheckQuotaAvailability.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_create_or_update.py deleted file mode 100644 index 914bf00a59de..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_create_or_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_accounts_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_accounts.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - body={"location": "eastus", "properties": {}, "tags": {"ac-tag1": "account1"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticAccounts_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_delete.py deleted file mode 100644 index dafb4b1db9b8..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_accounts_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_accounts.begin_delete( - resource_group_name="myRG", - account_name="account1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticAccounts_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_get.py deleted file mode 100644 index 8ae090a7f001..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_accounts_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_accounts.get( - resource_group_name="myRG", - account_name="account1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticAccounts_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_resource_group.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_resource_group.py deleted file mode 100644 index dfa704a2f3bf..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_accounts_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_accounts.list_by_resource_group( - resource_group_name="myRG", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticAccounts_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_subscription.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_subscription.py deleted file mode 100644 index 364922f8ce71..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_list_by_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_accounts_list_by_subscription.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_accounts.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticAccounts_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_update.py deleted file mode 100644 index 4b28b8164c8d..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_accounts_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_accounts_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_accounts.begin_update( - resource_group_name="myRG", - account_name="account1", - body={"tags": {"Tag1": "Value1"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticAccounts_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_create_or_update.py deleted file mode 100644 index 799e36f6312e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_create_or_update.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_policies_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_policies.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - backup_policy_name="backupPolicyName", - body={ - "location": "westus", - "properties": { - "dailyBackupsToKeep": 10, - "monthlyBackupsToKeep": 10, - "policyState": "Enabled", - "weeklyBackupsToKeep": 10, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupPolicies_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_delete.py deleted file mode 100644 index 7a2541421042..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_policies_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_backup_policies.begin_delete( - resource_group_name="resourceGroup", - account_name="accountName", - backup_policy_name="backupPolicyName", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupPolicies_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_get.py deleted file mode 100644 index 9d7785098c1e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_policies_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_policies.get( - resource_group_name="myRG", - account_name="account1", - backup_policy_name="backupPolicyName", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupPolicies_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_list.py deleted file mode 100644 index c88fabb9d345..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_policies_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_policies.list_by_elastic_account( - resource_group_name="myRG", - account_name="account1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupPolicies_List.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_update.py deleted file mode 100644 index 79fc4bf5b16a..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_policies_update.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_policies_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_policies.begin_update( - resource_group_name="myRG", - account_name="account1", - backup_policy_name="backupPolicyName", - body={ - "properties": { - "dailyBackupsToKeep": 5, - "monthlyBackupsToKeep": 10, - "policyState": "Enabled", - "weeklyBackupsToKeep": 10, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupPolicies_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_create.py deleted file mode 100644 index 628ad027dcfa..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_create.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_vaults_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_vaults.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - body={"location": "eastus"}, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupVaults_Create.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_delete.py deleted file mode 100644 index a13da86a7d1b..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_vaults_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_backup_vaults.begin_delete( - resource_group_name="resourceGroup", - account_name="account1", - backup_vault_name="backupVault1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupVaults_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_get.py deleted file mode 100644 index d82bc44cecc2..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_vaults_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_vaults.get( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupVaults_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_list_by_elastic_account.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_list_by_elastic_account.py deleted file mode 100644 index 86e4f109c475..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_list_by_elastic_account.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_vaults_list_by_elastic_account.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_vaults.list_by_elastic_account( - resource_group_name="myRG", - account_name="account1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupVaults_ListByElasticAccount.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_update.py deleted file mode 100644 index f20a0ebb3d5c..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backup_vaults_update.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backup_vaults_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backup_vaults.begin_update( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - body={"tags": {"Tag1": "Value1"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackupVaults_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_create_or_update.py deleted file mode 100644 index 769901f48280..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_create_or_update.py +++ /dev/null @@ -1,53 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backups_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backups.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - backup_name="backup1", - body={ - "properties": { - "elasticSnapshotResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticCapacityPools/pool1/elasticVolumes/volume1/elasticSnapshots/snap1", - "elasticVolumeResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticCapacityPools/pool1/elasticVolumes/volume1", - "label": "myLabel", - "snapshotUsage": "UseExistingSnapshot", - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackups_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_delete.py deleted file mode 100644 index 93e07a0d6a4c..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backups_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_backups.begin_delete( - resource_group_name="resourceGroup", - account_name="account1", - backup_vault_name="backupVault1", - backup_name="backup1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackups_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_get.py deleted file mode 100644 index e0e1fa0ef52e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backups_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backups.get( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - backup_name="backup1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackups_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_list_by_vault.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_list_by_vault.py deleted file mode 100644 index fe9eb95e02a7..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_list_by_vault.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backups_list_by_vault.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backups.list_by_vault( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackups_ListByVault.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_update.py deleted file mode 100644 index f182a6a52fba..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_backups_update.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_backups_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_backups.begin_update( - resource_group_name="myRG", - account_name="account1", - backup_vault_name="backupVault1", - backup_name="backup1", - body={ - "id": "str", - "name": "str", - "properties": { - "elasticVolumeResourceId": "str", - "backupType": "str", - "completionDate": "2020-02-20 00:00:00", - "creationDate": "2020-02-20 00:00:00", - "elasticBackupPolicyResourceId": "str", - "elasticSnapshotResourceId": "str", - "failureReason": "str", - "label": "str", - "provisioningState": "str", - "size": 0, - "snapshotCreationDate": "2020-02-20 00:00:00", - "snapshotUsage": "str", - "volumeSize": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticBackups_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_change_zone.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_change_zone.py deleted file mode 100644 index 44b6711d7ca3..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_change_zone.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_change_zone.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.begin_change_zone( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - body={"newZone": "3"}, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_ChangeZone.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_check_volume_file_path_availability.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_check_volume_file_path_availability.py deleted file mode 100644 index 7c26b31aa33e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_check_volume_file_path_availability.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_check_volume_file_path_availability.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.check_volume_file_path_availability( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - body={"filePath": "my-exact-filepath"}, - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_CheckVolumeFilePathAvailability.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update.py deleted file mode 100644 index e28c94f5a95d..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update.py +++ /dev/null @@ -1,54 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - body={ - "location": "eastus", - "properties": { - "activeDirectoryConfigResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/activeDirectoryConfigs/activeDirectoryConfig1", - "serviceLevel": "ZoneRedundant", - "size": 4398046511104, - "subnetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", - }, - "zones": ["1", "2", "3"], - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update_cmk.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update_cmk.py deleted file mode 100644 index 33ad2061452a..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_create_or_update_cmk.py +++ /dev/null @@ -1,58 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_create_or_update_cmk.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - body={ - "location": "eastus", - "properties": { - "activeDirectoryConfigResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/activeDirectoryConfigs/activeDirectoryConfig1", - "encryption": { - "elasticPoolEncryptionKeySource": "NetApp", - "keyVaultPrivateEndpointResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myKeyVault/privateEndpointConnections/myKeyVaultPec", - }, - "serviceLevel": "ZoneRedundant", - "size": 4398046511104, - "subnetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", - }, - "zones": ["1", "2", "3"], - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_CreateOrUpdateCMK.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_delete.py deleted file mode 100644 index be5cd92430c3..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_capacity_pools.begin_delete( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_get.py deleted file mode 100644 index 7f5cc0eef64b..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.get( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_list_by_elastic_account.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_list_by_elastic_account.py deleted file mode 100644 index c19cb41fd974..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_list_by_elastic_account.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_list_by_elastic_account.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.list_by_elastic_account( - resource_group_name="myRG", - account_name="account1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_ListByElasticAccount.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_update.py deleted file mode 100644 index e46fbfd6bf47..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_capacity_pools_update.py +++ /dev/null @@ -1,50 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_capacity_pools_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_capacity_pools.begin_update( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - body={ - "properties": { - "activeDirectoryConfigResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/activeDirectoryConfigs/activeDirectoryConfig1", - "size": 4398046511104, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticCapacityPools_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_create_or_update.py deleted file mode 100644 index d09fd89394d5..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_create_or_update.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshot_policies_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshot_policies.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - snapshot_policy_name="snapshotPolicyName", - body={ - "location": "eastus", - "properties": { - "dailySchedule": {"hour": 14, "minute": 30, "snapshotsToKeep": 4}, - "hourlySchedule": {"minute": 50, "snapshotsToKeep": 2}, - "monthlySchedule": {"daysOfMonth": [10, 11, 12], "hour": 14, "minute": 15, "snapshotsToKeep": 5}, - "policyStatus": "Enabled", - "weeklySchedule": {"days": ["Wednesday"], "hour": 14, "minute": 45, "snapshotsToKeep": 3}, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshotPolicies_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_delete.py deleted file mode 100644 index 862071d36597..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshot_policies_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_snapshot_policies.begin_delete( - resource_group_name="resourceGroup", - account_name="accountName", - snapshot_policy_name="snapshotPolicyName", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshotPolicies_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_get.py deleted file mode 100644 index 00d066a76634..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshot_policies_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshot_policies.get( - resource_group_name="myRG", - account_name="account1", - snapshot_policy_name="snapshotPolicyName", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshotPolicies_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_by_elastic_account.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_by_elastic_account.py deleted file mode 100644 index b3d80471a798..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_by_elastic_account.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshot_policies_list_by_elastic_account.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshot_policies.list_by_elastic_account( - resource_group_name="myRG", - account_name="account1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshotPolicies_ListByElasticAccount.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_elastic_volumes.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_elastic_volumes.py deleted file mode 100644 index c1a77962355c..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_list_elastic_volumes.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshot_policies_list_elastic_volumes.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshot_policies.list_elastic_volumes( - resource_group_name="myRG", - account_name="account1", - snapshot_policy_name="snapshotPolicyName", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshotPolicies_ListElasticVolumes.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_update.py deleted file mode 100644 index 25525e499e97..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshot_policies_update.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshot_policies_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshot_policies.begin_update( - resource_group_name="myRG", - account_name="account1", - snapshot_policy_name="snapshotPolicyName", - body={ - "properties": { - "dailySchedule": {"hour": 14, "minute": 30, "snapshotsToKeep": 4}, - "hourlySchedule": {"minute": 50, "snapshotsToKeep": 2}, - "monthlySchedule": {"daysOfMonth": [10, 11, 12], "hour": 14, "minute": 15, "snapshotsToKeep": 5}, - "policyStatus": "Enabled", - "weeklySchedule": {"days": ["Wednesday"], "hour": 14, "minute": 45, "snapshotsToKeep": 3}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshotPolicies_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_create_or_update.py deleted file mode 100644 index ccdb51262b34..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_create_or_update.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshots_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshots.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - snapshot_name="snapshot1", - body={ - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshots_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_delete.py deleted file mode 100644 index 28f6a26873ef..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_delete.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshots_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_snapshots.begin_delete( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - snapshot_name="snapshot1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshots_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_get.py deleted file mode 100644 index cd6c29ae53a8..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_get.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshots_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshots.get( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - snapshot_name="snapshot1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshots_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_list_by_elastic_volume.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_list_by_elastic_volume.py deleted file mode 100644 index 6b650af71cc5..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_snapshots_list_by_elastic_volume.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_snapshots_list_by_elastic_volume.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_snapshots.list_by_elastic_volume( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticSnapshots_ListByElasticVolume.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_create_or_update.py deleted file mode 100644 index b7c8f514abfb..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_create_or_update.py +++ /dev/null @@ -1,75 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_volumes_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_volumes.begin_create_or_update( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - body={ - "location": "eastus", - "properties": { - "dataProtection": { - "backup": { - "elasticBackupPolicyResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticBackupPolicies/elasticBackupPolicy1", - "elasticBackupVaultResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticBackupVaults/elasticBackupVault1", - "policyEnforcement": "Enforced", - }, - "snapshot": { - "snapshotPolicyResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticSnapshotPolicies/policy1" - }, - }, - "exportPolicy": { - "rules": [ - { - "allowedClients": ["0.0.0.0/0"], - "nfsv3": "Enabled", - "nfsv4": "Disabled", - "rootAccess": "Disabled", - "ruleIndex": 1, - "unixAccessRule": "ReadOnly", - } - ] - }, - "filePath": "my-unique-file-path", - "protocolTypes": ["NFSv3"], - "size": 107374182400, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticVolumes_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_delete.py deleted file mode 100644 index 616af92b08d5..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_volumes_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.elastic_volumes.begin_delete( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - ).result() - - -# x-ms-original-file: 2026-06-15-preview/ElasticVolumes_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_get.py deleted file mode 100644 index a828cfd8e78e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_volumes_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_volumes.get( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - ) - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticVolumes_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_list_by_elastic_pool.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_list_by_elastic_pool.py deleted file mode 100644 index c906c87b048e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_list_by_elastic_pool.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_volumes_list_by_elastic_pool.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_volumes.list_by_elastic_pool( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-06-15-preview/ElasticVolumes_ListByElasticPool.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_revert.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_revert.py deleted file mode 100644 index e6bf118a6695..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_revert.py +++ /dev/null @@ -1,48 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_volumes_revert.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_volumes.begin_revert( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - body={ - "snapshotResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticCapacityPools/pool1/elasticVolumes/volume1/elasticSnapshots/snapshot1" - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticVolumes_Revert.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_update.py deleted file mode 100644 index e9b5926d3dbd..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/elastic_volumes_update.py +++ /dev/null @@ -1,66 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python elastic_volumes_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = NetAppManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.elastic_volumes.begin_update( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - body={ - "properties": { - "dataProtection": { - "snapshot": { - "snapshotPolicyResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.NetApp/elasticAccounts/account1/elasticSnapshotPolicies/policy1" - } - }, - "exportPolicy": { - "rules": [ - { - "allowedClients": ["0.0.0.0/0"], - "nfsv3": "Enabled", - "nfsv4": "Disabled", - "rootAccess": "Disabled", - "ruleIndex": 1, - "unixAccessRule": "ReadOnly", - } - ] - }, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-06-15-preview/ElasticVolumes_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py index 4dd73bde4a86..790a3abe600c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/GroupIdListForLDAPUser.json +# x-ms-original-file: 2026-08-01/GroupIdListForLDAPUser.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_get.py index b51b774b3466..54ba939c31ba 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/NetAppResourceQuotaLimitsAccount_Get.json +# x-ms-original-file: 2026-08-01/NetAppResourceQuotaLimitsAccount_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_list.py index 0b12ac934189..c731b56aa12e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_account_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/NetAppResourceQuotaLimitsAccount_List.json +# x-ms-original-file: 2026-08-01/NetAppResourceQuotaLimitsAccount_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_get.py index 7c1053148430..98adebf67f74 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/NetAppResourceQuotaLimits_Get.json +# x-ms-original-file: 2026-08-01/NetAppResourceQuotaLimits_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_list.py index 174b0f00d973..5bc22674c819 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/net_app_resource_quota_limits_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/NetAppResourceQuotaLimits_List.json +# x-ms-original-file: 2026-08-01/NetAppResourceQuotaLimits_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_query.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_query.py index 07503e7b4bd6..be06dc469a3e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_query.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_query.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/NetworkSiblingSet_Query.json +# x-ms-original-file: 2026-08-01/NetworkSiblingSet_Query.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_update.py index 8f0d49dc71f7..89303abc0ae2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/network_sibling_set_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/NetworkSiblingSet_Update.json +# x-ms-original-file: 2026-08-01/NetworkSiblingSet_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py index e5e8d893b165..00d151a3625c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/OperationList.json +# x-ms-original-file: 2026-08-01/OperationList.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py index 5b7e4109e553..f18de3a6b576 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Pools_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01/Pools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update_custom_throughput.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update_custom_throughput.py index 581bd5980b28..bd2e317f551b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update_custom_throughput.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update_custom_throughput.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Pools_CreateOrUpdate_CustomThroughput.json +# x-ms-original-file: 2026-08-01/Pools_CreateOrUpdate_CustomThroughput.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py index 4ea2bcd4f457..a68cbac3113a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Pools_Delete.json +# x-ms-original-file: 2026-08-01/Pools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py index ecf0d5d75cb4..017e04a84026 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Pools_Get.json +# x-ms-original-file: 2026-08-01/Pools_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get_custom_throughput.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get_custom_throughput.py index 205fccec2ee8..0b52a2fdac8f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get_custom_throughput.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get_custom_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Pools_Get_CustomThroughput.json +# x-ms-original-file: 2026-08-01/Pools_Get_CustomThroughput.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py index 6a8587e6e802..ff9f628cfe09 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Pools_List.json +# x-ms-original-file: 2026-08-01/Pools_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update.py index 9923bb915966..1d05ec1e2276 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Pools_Update.json +# x-ms-original-file: 2026-08-01/Pools_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update_custom_throughput.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update_custom_throughput.py index 12f04b2572c1..767a41cb4e2e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update_custom_throughput.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_update_custom_throughput.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Pools_Update_CustomThroughput.json +# x-ms-original-file: 2026-08-01/Pools_Update_CustomThroughput.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_clear_suspects.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_clear_suspects.py index 5b6040d48555..51f37fafcbfb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_clear_suspects.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_clear_suspects.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/RansomwareReports_ClearSuspects.json +# x-ms-original-file: 2026-08-01/RansomwareReports_ClearSuspects.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_get.py index ce6ff1502801..1a07cb8ed999 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/RansomwareReports_Get.json +# x-ms-original-file: 2026-08-01/RansomwareReports_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_list.py index d5d9510052f3..a6292d5ad01e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/ransomware_reports_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/RansomwareReports_List.json +# x-ms-original-file: 2026-08-01/RansomwareReports_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py index f2ed7377ab96..0d0d9b1542bc 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/RegionInfo.json +# x-ms-original-file: 2026-08-01/RegionInfo.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py index 74cb1875ff7f..3c33fe5876e7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/RegionInfos_Get.json +# x-ms-original-file: 2026-08-01/RegionInfos_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py index 3e5a715aa27d..a39c39a90c8d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/RegionInfos_List.json +# x-ms-original-file: 2026-08-01/RegionInfos_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py index 57bb1f5011f2..078587611228 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/SnapshotPolicies_Create.json +# x-ms-original-file: 2026-08-01/SnapshotPolicies_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py index 6c8ba178b2b3..66af7c513aa9 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/SnapshotPolicies_Delete.json +# x-ms-original-file: 2026-08-01/SnapshotPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py index 8060f61a5bbb..9b0c4c8ba71d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/SnapshotPolicies_Get.json +# x-ms-original-file: 2026-08-01/SnapshotPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py index a1c79813c15f..f6fc8f561cb2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/SnapshotPolicies_List.json +# x-ms-original-file: 2026-08-01/SnapshotPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py index 64d3503cf79b..4db2f0d5ce43 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/SnapshotPolicies_ListVolumes.json +# x-ms-original-file: 2026-08-01/SnapshotPolicies_ListVolumes.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py index 7e59346c417b..338df043f392 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/SnapshotPolicies_Update.json +# x-ms-original-file: 2026-08-01/SnapshotPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py index efaa52d18ef0..dfaec7b9b9b1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Snapshots_Create.json +# x-ms-original-file: 2026-08-01/Snapshots_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py index 6ccbcf55efb4..0f77a4a3bb2e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Snapshots_Delete.json +# x-ms-original-file: 2026-08-01/Snapshots_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py index 655ab3c9a37d..0593986e0e1f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Snapshots_Get.json +# x-ms-original-file: 2026-08-01/Snapshots_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py index 4a0b63bdd1c9..940a84eeb383 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Snapshots_List.json +# x-ms-original-file: 2026-08-01/Snapshots_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py index b2aaffca359c..1a8b06c8d135 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Snapshots_SingleFileRestore.json +# x-ms-original-file: 2026-08-01/Snapshots_SingleFileRestore.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_update.py index c29bea0e1509..336a8df69026 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Snapshots_Update.json +# x-ms-original-file: 2026-08-01/Snapshots_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py index c31465e2a19e..f59e908723ac 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Subvolumes_Create.json +# x-ms-original-file: 2026-08-01/Subvolumes_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py index 5a8cdf8b0a13..49a33f18cec4 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Subvolumes_Delete.json +# x-ms-original-file: 2026-08-01/Subvolumes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py index 447c165b01a7..793283e8a90e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Subvolumes_Get.json +# x-ms-original-file: 2026-08-01/Subvolumes_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py index 4f45e7ac568e..38cd27182b15 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Subvolumes_List.json +# x-ms-original-file: 2026-08-01/Subvolumes_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py index 83b9fc71f1dd..70bb2e9938f0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Subvolumes_Metadata.json +# x-ms-original-file: 2026-08-01/Subvolumes_Metadata.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py index 4cec8c7a36ec..e98ff984846f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Subvolumes_Update.json +# x-ms-original-file: 2026-08-01/Subvolumes_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_get.py index d62914bb8188..5569f2293f00 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Usages_Get.json +# x-ms-original-file: 2026-08-01/Usages_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_list.py index edebca0c28f6..8348fb915415 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/usages_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Usages_List.json +# x-ms-original-file: 2026-08-01/Usages_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom.py index 77a3a8dfc3de..f21bfebd6bc8 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom.py @@ -459,6 +459,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Create_Custom.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Create_Custom.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom_smb.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom_smb.py index 13b1a5ad2195..83429b681dbf 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom_smb.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_custom_smb.py @@ -279,6 +279,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Create_Custom_SMB.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Create_Custom_SMB.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py index 6b207117adfd..f2158a0269e5 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py @@ -459,6 +459,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Create_Oracle.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Create_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py index 2d6bfc3fc59d..5b08127c70dc 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py @@ -221,6 +221,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Create_SapHana.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Create_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py index e3057a174783..c9da70ecc28c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Delete.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom.py index b720fa29e395..c3e1c9a115c1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Get_Custom.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Get_Custom.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom_smb.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom_smb.py index 852fcb4e843d..3c2992695458 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom_smb.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_custom_smb.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Get_Custom_SMB.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Get_Custom_SMB.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py index 6ea4e1986c26..f85302dab9bc 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Get_Oracle.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Get_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py index 991f6783b49a..30abe8e3c135 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_Get_SapHana.json +# x-ms-original-file: 2026-08-01/VolumeGroups_Get_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_custom.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_custom.py index a54c2d22745f..1ce51f9fb34b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_custom.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_custom.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_List_Custom.json +# x-ms-original-file: 2026-08-01/VolumeGroups_List_Custom.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py index a77e9adf055b..2a3deab680ea 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_List_Oracle.json +# x-ms-original-file: 2026-08-01/VolumeGroups_List_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py index aac2d6c648ff..dee2fa59fb63 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/VolumeGroups_List_SapHana.json +# x-ms-original-file: 2026-08-01/VolumeGroups_List_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py index e03c86cc702f..eaea5df56e75 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeQuotaRules_Create.json +# x-ms-original-file: 2026-08-01/VolumeQuotaRules_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py index feac62e43b28..a3c6764f1340 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/VolumeQuotaRules_Delete.json +# x-ms-original-file: 2026-08-01/VolumeQuotaRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py index 3fe3bc00af1f..c54f9d4af123 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeQuotaRules_Get.json +# x-ms-original-file: 2026-08-01/VolumeQuotaRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py index ca5db84294f7..c3f8c8ce8f69 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/VolumeQuotaRules_List.json +# x-ms-original-file: 2026-08-01/VolumeQuotaRules_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py index 72cb871f2a51..d1def19cba9a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/VolumeQuotaRules_Update.json +# x-ms-original-file: 2026-08-01/VolumeQuotaRules_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_external_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_external_replication.py index 5b488d3088d4..7190ac23ba27 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_external_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_external_replication.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_AuthorizeExternalReplication.json +# x-ms-original-file: 2026-08-01/Volumes_AuthorizeExternalReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py index 7b4e41f929b0..b675fae48a97 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_AuthorizeReplication.json +# x-ms-original-file: 2026-08-01/Volumes_AuthorizeReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py index 0ded420ab3b6..1978b9cfea27 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_BreakFileLocks.json +# x-ms-original-file: 2026-08-01/Volumes_BreakFileLocks.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py index 9b2aa75e8893..1dad1c8c7317 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_BreakReplication.json +# x-ms-original-file: 2026-08-01/Volumes_BreakReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py index d26d66cb75f7..d106c9c0b5cc 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01/Volumes_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py index b94ce4bb83e6..e8e0b44acd4d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_Delete.json +# x-ms-original-file: 2026-08-01/Volumes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py index a05380a4a61a..0fd3a09e129a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_DeleteReplication.json +# x-ms-original-file: 2026-08-01/Volumes_DeleteReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_get.py index 101b51c28e15..59163eb8d09b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_ExtraLargeVolumes_Get.json +# x-ms-original-file: 2026-08-01/Volumes_ExtraLargeVolumes_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_list.py index 81422a8b25c5..3708d0e38929 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_extra_large_volumes_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Volumes_ExtraLargeVolumes_List.json +# x-ms-original-file: 2026-08-01/Volumes_ExtraLargeVolumes_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_external_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_external_replication.py index c9806d43b457..b04d81a0ba61 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_external_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_external_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_FinalizeExternalReplication.json +# x-ms-original-file: 2026-08-01/Volumes_FinalizeExternalReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py index 4a2428fb7bd3..6f5917ef6c82 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_FinalizeRelocation.json +# x-ms-original-file: 2026-08-01/Volumes_FinalizeRelocation.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py index 4eabf7968f17..593d200dfeeb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_Get.json +# x-ms-original-file: 2026-08-01/Volumes_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py index 8162827e8186..b77692c3b669 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_LatestBackupStatus.json +# x-ms-original-file: 2026-08-01/Volumes_LatestBackupStatus.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py index d05bfc619186..d97a58b24a48 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_LatestRestoreStatus.json +# x-ms-original-file: 2026-08-01/Volumes_LatestRestoreStatus.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py index 19d1f80dde3d..829e9e42a1df 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Volumes_List.json +# x-ms-original-file: 2026-08-01/Volumes_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_quota_report.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_quota_report.py index 506e20b3445c..d3927f966c27 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_quota_report.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_quota_report.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_ListQuotaReport.json +# x-ms-original-file: 2026-08-01/Volumes_ListQuotaReport.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py index 049441bcc6b4..e0064393a7b7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-06-15-preview/Volumes_ListReplications.json +# x-ms-original-file: 2026-08-01/Volumes_ListReplications.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_external_cluster.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_external_cluster.py index 99996200a3d3..df829e14dcfa 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_external_cluster.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_external_cluster.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_PeerExternalCluster.json +# x-ms-original-file: 2026-08-01/Volumes_PeerExternalCluster.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py index f7ea691e4551..13aa682edb1f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_PerformReplicationTransfer.json +# x-ms-original-file: 2026-08-01/Volumes_PerformReplicationTransfer.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py index b2ad4f2f2f8b..06126fbdefbb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_PoolChange.json +# x-ms-original-file: 2026-08-01/Volumes_PoolChange.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py index 9c8111eedd48..30a8e8140bb6 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_PopulateAvailabilityZones.json +# x-ms-original-file: 2026-08-01/Volumes_PopulateAvailabilityZones.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py index 9aad4dd316d6..ca5304209da8 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_ReInitializeReplication.json +# x-ms-original-file: 2026-08-01/Volumes_ReInitializeReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py index c3ed4a0dce74..717d337abe9c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_ReestablishReplication.json +# x-ms-original-file: 2026-08-01/Volumes_ReestablishReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py index 896632bd6f1a..49955c147538 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_Relocate.json +# x-ms-original-file: 2026-08-01/Volumes_Relocate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py index 3c91325fb5f8..6b99c3e90eb2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_ReplicationStatus.json +# x-ms-original-file: 2026-08-01/Volumes_ReplicationStatus.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py index bbb3b84fc422..2cb730f8f796 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_ResetCifsPassword.json +# x-ms-original-file: 2026-08-01/Volumes_ResetCifsPassword.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py index 00ae29924658..c49942dec22c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_ResyncReplication.json +# x-ms-original-file: 2026-08-01/Volumes_ResyncReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py index 90438b00471c..797f83855135 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_Revert.json +# x-ms-original-file: 2026-08-01/Volumes_Revert.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py index 87031bce0f26..a01ca2dca9e0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-06-15-preview/Volumes_RevertRelocation.json +# x-ms-original-file: 2026-08-01/Volumes_RevertRelocation.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py index 2b5ea38f0b52..a2befb8a6075 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_SplitClone.json +# x-ms-original-file: 2026-08-01/Volumes_SplitClone.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_update.py index f0d94cb82ee4..4662881812c6 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_update.py @@ -89,6 +89,6 @@ def main(): print(response) -# x-ms-original-file: 2026-06-15-preview/Volumes_Update.json +# x-ms-original-file: 2026-08-01/Volumes_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations.py index 50e533da27af..dbf453b79e3e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations.py @@ -86,16 +86,6 @@ def test_accounts_begin_create_or_update(self, resource_group): "status": "str", }, }, - "entraIdConfig": { - "applicationId": "str", - "domain": "str", - "serverNamePrefix": "str", - "entraIdAkvConfig": { - "azureKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - }, "ldapConfiguration": { "bindAuthenticationLevel": "str", "bindDN": "str", @@ -171,31 +161,13 @@ def test_accounts_begin_update(self, resource_group): "serverRootCACertificate": "str", "site": "str", "smbServerName": "str", - "status": "str", - "statusDetails": "str", "username": "str", } ], "encryption": { - "identity": {"federatedClientId": "str", "principalId": "str", "userAssignedIdentity": "str"}, + "identity": {"federatedClientId": "str", "userAssignedIdentity": "str"}, "keySource": "str", - "keyVaultProperties": { - "keyName": "str", - "keyVaultUri": "str", - "keyVaultId": "str", - "keyVaultResourceId": "str", - "status": "str", - }, - }, - "entraIdConfig": { - "applicationId": "str", - "domain": "str", - "entraIdAkvConfig": { - "azureKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - "serverNamePrefix": "str", + "keyVaultProperties": {"keyName": "str", "keyVaultResourceId": "str", "keyVaultUri": "str"}, }, "ldapConfiguration": { "bindAuthenticationLevel": "str", diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations_async.py index e6ef9adcd088..5a6475f91655 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations_async.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_accounts_operations_async.py @@ -92,16 +92,6 @@ async def test_accounts_begin_create_or_update(self, resource_group): "status": "str", }, }, - "entraIdConfig": { - "applicationId": "str", - "domain": "str", - "serverNamePrefix": "str", - "entraIdAkvConfig": { - "azureKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - }, "ldapConfiguration": { "bindAuthenticationLevel": "str", "bindDN": "str", @@ -179,35 +169,13 @@ async def test_accounts_begin_update(self, resource_group): "serverRootCACertificate": "str", "site": "str", "smbServerName": "str", - "status": "str", - "statusDetails": "str", "username": "str", } ], "encryption": { - "identity": { - "federatedClientId": "str", - "principalId": "str", - "userAssignedIdentity": "str", - }, + "identity": {"federatedClientId": "str", "userAssignedIdentity": "str"}, "keySource": "str", - "keyVaultProperties": { - "keyName": "str", - "keyVaultUri": "str", - "keyVaultId": "str", - "keyVaultResourceId": "str", - "status": "str", - }, - }, - "entraIdConfig": { - "applicationId": "str", - "domain": "str", - "entraIdAkvConfig": { - "azureKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - "serverNamePrefix": "str", + "keyVaultProperties": {"keyName": "str", "keyVaultResourceId": "str", "keyVaultUri": "str"}, }, "ldapConfiguration": { "bindAuthenticationLevel": "str", diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations.py deleted file mode 100644 index 97f9bd69acea..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementActiveDirectoryConfigsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_active_directory_configs_get(self, resource_group): - response = self.client.active_directory_configs.get( - resource_group_name=resource_group.name, - active_directory_config_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_active_directory_configs_begin_create_or_update(self, resource_group): - response = self.client.active_directory_configs.begin_create_or_update( - resource_group_name=resource_group.name, - active_directory_config_name="str", - body={ - "location": "str", - "etag": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "domain": "str", - "secretPassword": { - "identity": {"principalId": "str", "userAssignedIdentity": "str"}, - "keyVaultProperties": {"keyVaultUri": "str", "secretName": "str"}, - }, - "site": "str", - "activeDirectoryStatus": "str", - "administrators": ["str"], - "backupOperators": ["str"], - "dns": ["str"], - "organizationalUnit": "str", - "provisioningState": "str", - "securityOperators": ["str"], - "smbServerName": "str", - "userName": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_active_directory_configs_begin_update(self, resource_group): - response = self.client.active_directory_configs.begin_update( - resource_group_name=resource_group.name, - active_directory_config_name="str", - body={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "administrators": ["str"], - "backupOperators": ["str"], - "dns": ["str"], - "domain": "str", - "organizationalUnit": "str", - "secretPassword": { - "identity": {"principalId": "str", "userAssignedIdentity": "str"}, - "keyVaultProperties": {"keyVaultUri": "str", "secretName": "str"}, - }, - "securityOperators": ["str"], - "site": "str", - "smbServerName": "str", - "userName": "str", - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_active_directory_configs_begin_delete(self, resource_group): - response = self.client.active_directory_configs.begin_delete( - resource_group_name=resource_group.name, - active_directory_config_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_active_directory_configs_list_by_resource_group(self, resource_group): - response = self.client.active_directory_configs.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_active_directory_configs_list_by_subscription(self, resource_group): - response = self.client.active_directory_configs.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations_async.py deleted file mode 100644 index f51c4b09ae4c..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_active_directory_configs_operations_async.py +++ /dev/null @@ -1,151 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementActiveDirectoryConfigsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_active_directory_configs_get(self, resource_group): - response = await self.client.active_directory_configs.get( - resource_group_name=resource_group.name, - active_directory_config_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_active_directory_configs_begin_create_or_update(self, resource_group): - response = await ( - await self.client.active_directory_configs.begin_create_or_update( - resource_group_name=resource_group.name, - active_directory_config_name="str", - body={ - "location": "str", - "etag": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "domain": "str", - "secretPassword": { - "identity": {"principalId": "str", "userAssignedIdentity": "str"}, - "keyVaultProperties": {"keyVaultUri": "str", "secretName": "str"}, - }, - "site": "str", - "activeDirectoryStatus": "str", - "administrators": ["str"], - "backupOperators": ["str"], - "dns": ["str"], - "organizationalUnit": "str", - "provisioningState": "str", - "securityOperators": ["str"], - "smbServerName": "str", - "userName": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_active_directory_configs_begin_update(self, resource_group): - response = await ( - await self.client.active_directory_configs.begin_update( - resource_group_name=resource_group.name, - active_directory_config_name="str", - body={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "administrators": ["str"], - "backupOperators": ["str"], - "dns": ["str"], - "domain": "str", - "organizationalUnit": "str", - "secretPassword": { - "identity": {"principalId": "str", "userAssignedIdentity": "str"}, - "keyVaultProperties": {"keyVaultUri": "str", "secretName": "str"}, - }, - "securityOperators": ["str"], - "site": "str", - "smbServerName": "str", - "userName": "str", - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_active_directory_configs_begin_delete(self, resource_group): - response = await ( - await self.client.active_directory_configs.begin_delete( - resource_group_name=resource_group.name, - active_directory_config_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_active_directory_configs_list_by_resource_group(self, resource_group): - response = self.client.active_directory_configs.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_active_directory_configs_list_by_subscription(self, resource_group): - response = self.client.active_directory_configs.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations.py index b53eb57ce51b..06d0980b940f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations.py @@ -46,16 +46,8 @@ def test_buckets_begin_create_or_update(self, resource_group): "name": "str", "properties": { "akvDetails": { - "certificateAkvDetails": { - "certificateKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - "credentialsAkvDetails": { - "credentialsKeyVaultUri": "str", - "secretName": "str", - "userAssignedIdentity": "str", - }, + "certificateAkvDetails": {"certificateKeyVaultUri": "str", "certificateName": "str"}, + "credentialsAkvDetails": {"credentialsKeyVaultUri": "str", "secretName": "str"}, }, "fileSystemUser": {"cifsUser": {"username": "str"}, "nfsUser": {"groupId": 0, "userId": 0}}, "path": "str", @@ -100,16 +92,8 @@ def test_buckets_begin_update(self, resource_group): "name": "str", "properties": { "akvDetails": { - "certificateAkvDetails": { - "certificateKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - "credentialsAkvDetails": { - "credentialsKeyVaultUri": "str", - "secretName": "str", - "userAssignedIdentity": "str", - }, + "certificateAkvDetails": {"certificateKeyVaultUri": "str", "certificateName": "str"}, + "credentialsAkvDetails": {"credentialsKeyVaultUri": "str", "secretName": "str"}, }, "fileSystemUser": {"cifsUser": {"username": "str"}, "nfsUser": {"groupId": 0, "userId": 0}}, "permissions": "str", diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations_async.py index b2b3488eae8a..a416510b68d9 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations_async.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_buckets_operations_async.py @@ -48,16 +48,8 @@ async def test_buckets_begin_create_or_update(self, resource_group): "name": "str", "properties": { "akvDetails": { - "certificateAkvDetails": { - "certificateKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - "credentialsAkvDetails": { - "credentialsKeyVaultUri": "str", - "secretName": "str", - "userAssignedIdentity": "str", - }, + "certificateAkvDetails": {"certificateKeyVaultUri": "str", "certificateName": "str"}, + "credentialsAkvDetails": {"credentialsKeyVaultUri": "str", "secretName": "str"}, }, "fileSystemUser": {"cifsUser": {"username": "str"}, "nfsUser": {"groupId": 0, "userId": 0}}, "path": "str", @@ -104,16 +96,8 @@ async def test_buckets_begin_update(self, resource_group): "name": "str", "properties": { "akvDetails": { - "certificateAkvDetails": { - "certificateKeyVaultUri": "str", - "certificateName": "str", - "userAssignedIdentity": "str", - }, - "credentialsAkvDetails": { - "credentialsKeyVaultUri": "str", - "secretName": "str", - "userAssignedIdentity": "str", - }, + "certificateAkvDetails": {"certificateKeyVaultUri": "str", "certificateName": "str"}, + "credentialsAkvDetails": {"credentialsKeyVaultUri": "str", "secretName": "str"}, }, "fileSystemUser": {"cifsUser": {"username": "str"}, "nfsUser": {"groupId": 0, "userId": 0}}, "permissions": "str", diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations.py deleted file mode 100644 index 8c04a6f2050a..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticAccountsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_accounts_get(self, resource_group): - response = self.client.elastic_accounts.get( - resource_group_name=resource_group.name, - account_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_accounts_begin_create_or_update(self, resource_group): - response = self.client.elastic_accounts.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "encryption": { - "identity": {"federatedClientId": "str", "principalId": "str", "userAssignedIdentity": "str"}, - "keySource": "str", - "keyVaultProperties": { - "keyName": "str", - "keyVaultResourceId": "str", - "keyVaultUri": "str", - "status": "str", - }, - }, - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_accounts_begin_update(self, resource_group): - response = self.client.elastic_accounts.begin_update( - resource_group_name=resource_group.name, - account_name="str", - body={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "encryption": { - "identity": {"federatedClientId": "str", "principalId": "str", "userAssignedIdentity": "str"}, - "keySource": "str", - "keyVaultProperties": { - "keyName": "str", - "keyVaultResourceId": "str", - "keyVaultUri": "str", - "status": "str", - }, - } - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_accounts_begin_delete(self, resource_group): - response = self.client.elastic_accounts.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_accounts_list_by_resource_group(self, resource_group): - response = self.client.elastic_accounts.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_accounts_list_by_subscription(self, resource_group): - response = self.client.elastic_accounts.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations_async.py deleted file mode 100644 index f70e3d724df8..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_accounts_operations_async.py +++ /dev/null @@ -1,152 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticAccountsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_accounts_get(self, resource_group): - response = await self.client.elastic_accounts.get( - resource_group_name=resource_group.name, - account_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_accounts_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_accounts.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "encryption": { - "identity": { - "federatedClientId": "str", - "principalId": "str", - "userAssignedIdentity": "str", - }, - "keySource": "str", - "keyVaultProperties": { - "keyName": "str", - "keyVaultResourceId": "str", - "keyVaultUri": "str", - "status": "str", - }, - }, - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_accounts_begin_update(self, resource_group): - response = await ( - await self.client.elastic_accounts.begin_update( - resource_group_name=resource_group.name, - account_name="str", - body={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "encryption": { - "identity": { - "federatedClientId": "str", - "principalId": "str", - "userAssignedIdentity": "str", - }, - "keySource": "str", - "keyVaultProperties": { - "keyName": "str", - "keyVaultResourceId": "str", - "keyVaultUri": "str", - "status": "str", - }, - } - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_accounts_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_accounts.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_accounts_list_by_resource_group(self, resource_group): - response = self.client.elastic_accounts.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_accounts_list_by_subscription(self, resource_group): - response = self.client.elastic_accounts.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations.py deleted file mode 100644 index 2a5975f76da1..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticBackupPoliciesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_policies_get(self, resource_group): - response = self.client.elastic_backup_policies.get( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_policies_begin_create_or_update(self, resource_group): - response = self.client.elastic_backup_policies.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "assignedVolumesCount": 0, - "dailyBackupsToKeep": 0, - "monthlyBackupsToKeep": 0, - "policyState": "str", - "provisioningState": "str", - "weeklyBackupsToKeep": 0, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_policies_begin_update(self, resource_group): - response = self.client.elastic_backup_policies.begin_update( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - body={ - "properties": { - "dailyBackupsToKeep": 0, - "monthlyBackupsToKeep": 0, - "policyState": "str", - "weeklyBackupsToKeep": 0, - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_policies_begin_delete(self, resource_group): - response = self.client.elastic_backup_policies.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_policies_list_by_elastic_account(self, resource_group): - response = self.client.elastic_backup_policies.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations_async.py deleted file mode 100644 index c3111a40262a..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_policies_operations_async.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticBackupPoliciesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_policies_get(self, resource_group): - response = await self.client.elastic_backup_policies.get( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_policies_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_backup_policies.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "assignedVolumesCount": 0, - "dailyBackupsToKeep": 0, - "monthlyBackupsToKeep": 0, - "policyState": "str", - "provisioningState": "str", - "weeklyBackupsToKeep": 0, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_policies_begin_update(self, resource_group): - response = await ( - await self.client.elastic_backup_policies.begin_update( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - body={ - "properties": { - "dailyBackupsToKeep": 0, - "monthlyBackupsToKeep": 0, - "policyState": "str", - "weeklyBackupsToKeep": 0, - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_policies_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_backup_policies.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - backup_policy_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_policies_list_by_elastic_account(self, resource_group): - response = self.client.elastic_backup_policies.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations.py deleted file mode 100644 index 89de70ca5ea6..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticBackupVaultsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_vaults_get(self, resource_group): - response = self.client.elastic_backup_vaults.get( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_vaults_begin_create_or_update(self, resource_group): - response = self.client.elastic_backup_vaults.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_vaults_begin_update(self, resource_group): - response = self.client.elastic_backup_vaults.begin_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - body={"tags": {"str": "str"}}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_vaults_begin_delete(self, resource_group): - response = self.client.elastic_backup_vaults.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backup_vaults_list_by_elastic_account(self, resource_group): - response = self.client.elastic_backup_vaults.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations_async.py deleted file mode 100644 index 432076357ee9..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backup_vaults_operations_async.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticBackupVaultsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_vaults_get(self, resource_group): - response = await self.client.elastic_backup_vaults.get( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_vaults_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_backup_vaults.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_vaults_begin_update(self, resource_group): - response = await ( - await self.client.elastic_backup_vaults.begin_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - body={"tags": {"str": "str"}}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_vaults_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_backup_vaults.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backup_vaults_list_by_elastic_account(self, resource_group): - response = self.client.elastic_backup_vaults.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations.py deleted file mode 100644 index aca78bdf7488..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticBackupsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backups_get(self, resource_group): - response = self.client.elastic_backups.get( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backups_begin_create_or_update(self, resource_group): - response = self.client.elastic_backups.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - body={ - "id": "str", - "name": "str", - "properties": { - "elasticVolumeResourceId": "str", - "backupType": "str", - "completionDate": "2020-02-20 00:00:00", - "creationDate": "2020-02-20 00:00:00", - "elasticBackupPolicyResourceId": "str", - "elasticSnapshotResourceId": "str", - "failureReason": "str", - "label": "str", - "provisioningState": "str", - "size": 0, - "snapshotCreationDate": "2020-02-20 00:00:00", - "snapshotUsage": "str", - "volumeSize": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backups_begin_update(self, resource_group): - response = self.client.elastic_backups.begin_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - body={ - "id": "str", - "name": "str", - "properties": { - "elasticVolumeResourceId": "str", - "backupType": "str", - "completionDate": "2020-02-20 00:00:00", - "creationDate": "2020-02-20 00:00:00", - "elasticBackupPolicyResourceId": "str", - "elasticSnapshotResourceId": "str", - "failureReason": "str", - "label": "str", - "provisioningState": "str", - "size": 0, - "snapshotCreationDate": "2020-02-20 00:00:00", - "snapshotUsage": "str", - "volumeSize": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backups_begin_delete(self, resource_group): - response = self.client.elastic_backups.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_backups_list_by_vault(self, resource_group): - response = self.client.elastic_backups.list_by_vault( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations_async.py deleted file mode 100644 index 9449eb50fcc7..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_backups_operations_async.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticBackupsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backups_get(self, resource_group): - response = await self.client.elastic_backups.get( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backups_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_backups.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - body={ - "id": "str", - "name": "str", - "properties": { - "elasticVolumeResourceId": "str", - "backupType": "str", - "completionDate": "2020-02-20 00:00:00", - "creationDate": "2020-02-20 00:00:00", - "elasticBackupPolicyResourceId": "str", - "elasticSnapshotResourceId": "str", - "failureReason": "str", - "label": "str", - "provisioningState": "str", - "size": 0, - "snapshotCreationDate": "2020-02-20 00:00:00", - "snapshotUsage": "str", - "volumeSize": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backups_begin_update(self, resource_group): - response = await ( - await self.client.elastic_backups.begin_update( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - body={ - "id": "str", - "name": "str", - "properties": { - "elasticVolumeResourceId": "str", - "backupType": "str", - "completionDate": "2020-02-20 00:00:00", - "creationDate": "2020-02-20 00:00:00", - "elasticBackupPolicyResourceId": "str", - "elasticSnapshotResourceId": "str", - "failureReason": "str", - "label": "str", - "provisioningState": "str", - "size": 0, - "snapshotCreationDate": "2020-02-20 00:00:00", - "snapshotUsage": "str", - "volumeSize": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backups_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_backups.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - backup_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_backups_list_by_vault(self, resource_group): - response = self.client.elastic_backups.list_by_vault( - resource_group_name=resource_group.name, - account_name="str", - backup_vault_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations.py deleted file mode 100644 index e07a93fc8f9d..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticCapacityPoolsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_get(self, resource_group): - response = self.client.elastic_capacity_pools.get( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_begin_create_or_update(self, resource_group): - response = self.client.elastic_capacity_pools.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "serviceLevel": "str", - "size": 0, - "subnetResourceId": "str", - "activeDirectoryConfigResourceId": "str", - "availabilityStatus": "str", - "currentZone": "str", - "encryption": {"elasticPoolEncryptionKeySource": "str", "keyVaultPrivateEndpointResourceId": "str"}, - "provisioningState": "str", - "totalThroughputMibps": 0.0, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - "zones": ["str"], - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_begin_update(self, resource_group): - response = self.client.elastic_capacity_pools.begin_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={ - "properties": { - "activeDirectoryConfigResourceId": "str", - "encryption": {"elasticPoolEncryptionKeySource": "str", "keyVaultPrivateEndpointResourceId": "str"}, - "size": 0, - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_begin_delete(self, resource_group): - response = self.client.elastic_capacity_pools.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_list_by_elastic_account(self, resource_group): - response = self.client.elastic_capacity_pools.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_begin_change_zone(self, resource_group): - response = self.client.elastic_capacity_pools.begin_change_zone( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={"newZone": "str"}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_capacity_pools_check_volume_file_path_availability(self, resource_group): - response = self.client.elastic_capacity_pools.check_volume_file_path_availability( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={"filePath": "str"}, - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations_async.py deleted file mode 100644 index 464803929ce1..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_capacity_pools_operations_async.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticCapacityPoolsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_get(self, resource_group): - response = await self.client.elastic_capacity_pools.get( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_capacity_pools.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "serviceLevel": "str", - "size": 0, - "subnetResourceId": "str", - "activeDirectoryConfigResourceId": "str", - "availabilityStatus": "str", - "currentZone": "str", - "encryption": { - "elasticPoolEncryptionKeySource": "str", - "keyVaultPrivateEndpointResourceId": "str", - }, - "provisioningState": "str", - "totalThroughputMibps": 0.0, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - "zones": ["str"], - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_begin_update(self, resource_group): - response = await ( - await self.client.elastic_capacity_pools.begin_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={ - "properties": { - "activeDirectoryConfigResourceId": "str", - "encryption": { - "elasticPoolEncryptionKeySource": "str", - "keyVaultPrivateEndpointResourceId": "str", - }, - "size": 0, - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_capacity_pools.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_list_by_elastic_account(self, resource_group): - response = self.client.elastic_capacity_pools.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_begin_change_zone(self, resource_group): - response = await ( - await self.client.elastic_capacity_pools.begin_change_zone( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={"newZone": "str"}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_capacity_pools_check_volume_file_path_availability(self, resource_group): - response = await self.client.elastic_capacity_pools.check_volume_file_path_availability( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - body={"filePath": "str"}, - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations.py deleted file mode 100644 index 786cf72f5f52..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticSnapshotPoliciesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshot_policies_get(self, resource_group): - response = self.client.elastic_snapshot_policies.get( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshot_policies_begin_create_or_update(self, resource_group): - response = self.client.elastic_snapshot_policies.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "dailySchedule": {"hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "hourlySchedule": {"minute": 0, "snapshotsToKeep": 0}, - "monthlySchedule": {"daysOfMonth": [0], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "policyStatus": "str", - "provisioningState": "str", - "weeklySchedule": {"days": ["str"], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshot_policies_begin_update(self, resource_group): - response = self.client.elastic_snapshot_policies.begin_update( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - body={ - "properties": { - "dailySchedule": {"hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "hourlySchedule": {"minute": 0, "snapshotsToKeep": 0}, - "monthlySchedule": {"daysOfMonth": [0], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "policyStatus": "str", - "weeklySchedule": {"days": ["str"], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshot_policies_begin_delete(self, resource_group): - response = self.client.elastic_snapshot_policies.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshot_policies_list_by_elastic_account(self, resource_group): - response = self.client.elastic_snapshot_policies.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshot_policies_list_elastic_volumes(self, resource_group): - response = self.client.elastic_snapshot_policies.list_elastic_volumes( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations_async.py deleted file mode 100644 index c891e271a4be..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshot_policies_operations_async.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticSnapshotPoliciesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshot_policies_get(self, resource_group): - response = await self.client.elastic_snapshot_policies.get( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshot_policies_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_snapshot_policies.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "dailySchedule": {"hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "hourlySchedule": {"minute": 0, "snapshotsToKeep": 0}, - "monthlySchedule": {"daysOfMonth": [0], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "policyStatus": "str", - "provisioningState": "str", - "weeklySchedule": {"days": ["str"], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshot_policies_begin_update(self, resource_group): - response = await ( - await self.client.elastic_snapshot_policies.begin_update( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - body={ - "properties": { - "dailySchedule": {"hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "hourlySchedule": {"minute": 0, "snapshotsToKeep": 0}, - "monthlySchedule": {"daysOfMonth": [0], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - "policyStatus": "str", - "weeklySchedule": {"days": ["str"], "hour": 0, "minute": 0, "snapshotsToKeep": 0}, - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshot_policies_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_snapshot_policies.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshot_policies_list_by_elastic_account(self, resource_group): - response = self.client.elastic_snapshot_policies.list_by_elastic_account( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshot_policies_list_elastic_volumes(self, resource_group): - response = self.client.elastic_snapshot_policies.list_elastic_volumes( - resource_group_name=resource_group.name, - account_name="str", - snapshot_policy_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations.py deleted file mode 100644 index 9ec309a1ac18..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticSnapshotsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshots_get(self, resource_group): - response = self.client.elastic_snapshots.get( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - snapshot_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshots_begin_create_or_update(self, resource_group): - response = self.client.elastic_snapshots.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - snapshot_name="str", - body={ - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshots_begin_delete(self, resource_group): - response = self.client.elastic_snapshots.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - snapshot_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_snapshots_list_by_elastic_volume(self, resource_group): - response = self.client.elastic_snapshots.list_by_elastic_volume( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations_async.py deleted file mode 100644 index b191f7f9e9c9..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_snapshots_operations_async.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticSnapshotsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshots_get(self, resource_group): - response = await self.client.elastic_snapshots.get( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - snapshot_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshots_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_snapshots.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - snapshot_name="str", - body={ - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshots_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_snapshots.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - snapshot_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_snapshots_list_by_elastic_volume(self, resource_group): - response = self.client.elastic_snapshots.list_by_elastic_volume( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations.py deleted file mode 100644 index 89d83270afc8..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations.py +++ /dev/null @@ -1,175 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticVolumesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_volumes_get(self, resource_group): - response = self.client.elastic_volumes.get( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_volumes_begin_create_or_update(self, resource_group): - response = self.client.elastic_volumes.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "filePath": "str", - "protocolTypes": ["str"], - "size": 0, - "availabilityStatus": "str", - "backupResourceId": "str", - "dataProtection": { - "backup": { - "elasticBackupPolicyResourceId": "str", - "elasticBackupVaultResourceId": "str", - "policyEnforcement": "str", - }, - "snapshot": {"snapshotPolicyResourceId": "str"}, - }, - "exportPolicy": { - "rules": [ - { - "allowedClients": ["str"], - "nfsv3": "str", - "nfsv4": "str", - "rootAccess": "str", - "ruleIndex": 0, - "unixAccessRule": "str", - } - ] - }, - "mountTargets": [{"ipAddress": "str", "smbServerFqdn": "str"}], - "provisioningState": "str", - "restorationState": "str", - "smbProperties": {"smbEncryption": "str"}, - "snapshotDirectoryVisibility": "str", - "snapshotResourceId": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - "zones": ["str"], - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_volumes_begin_update(self, resource_group): - response = self.client.elastic_volumes.begin_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - body={ - "properties": { - "dataProtection": { - "backup": { - "elasticBackupPolicyResourceId": "str", - "elasticBackupVaultResourceId": "str", - "policyEnforcement": "str", - }, - "snapshot": {"snapshotPolicyResourceId": "str"}, - }, - "exportPolicy": { - "rules": [ - { - "allowedClients": ["str"], - "nfsv3": "str", - "nfsv4": "str", - "rootAccess": "str", - "ruleIndex": 0, - "unixAccessRule": "str", - } - ] - }, - "size": 0, - "smbProperties": {"smbEncryption": "str"}, - "snapshotDirectoryVisibility": "str", - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_volumes_begin_delete(self, resource_group): - response = self.client.elastic_volumes.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_volumes_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_volumes.list_by_elastic_pool( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_volumes_begin_revert(self, resource_group): - response = self.client.elastic_volumes.begin_revert( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - body={"snapshotResourceId": "str"}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations_async.py deleted file mode 100644 index 0e7a23ba2dde..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_elastic_volumes_operations_async.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.netapp.aio import NetAppManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestNetAppManagementElasticVolumesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(NetAppManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_volumes_get(self, resource_group): - response = await self.client.elastic_volumes.get( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_volumes_begin_create_or_update(self, resource_group): - response = await ( - await self.client.elastic_volumes.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - body={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": { - "filePath": "str", - "protocolTypes": ["str"], - "size": 0, - "availabilityStatus": "str", - "backupResourceId": "str", - "dataProtection": { - "backup": { - "elasticBackupPolicyResourceId": "str", - "elasticBackupVaultResourceId": "str", - "policyEnforcement": "str", - }, - "snapshot": {"snapshotPolicyResourceId": "str"}, - }, - "exportPolicy": { - "rules": [ - { - "allowedClients": ["str"], - "nfsv3": "str", - "nfsv4": "str", - "rootAccess": "str", - "ruleIndex": 0, - "unixAccessRule": "str", - } - ] - }, - "mountTargets": [{"ipAddress": "str", "smbServerFqdn": "str"}], - "provisioningState": "str", - "restorationState": "str", - "smbProperties": {"smbEncryption": "str"}, - "snapshotDirectoryVisibility": "str", - "snapshotResourceId": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - "zones": ["str"], - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_volumes_begin_update(self, resource_group): - response = await ( - await self.client.elastic_volumes.begin_update( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - body={ - "properties": { - "dataProtection": { - "backup": { - "elasticBackupPolicyResourceId": "str", - "elasticBackupVaultResourceId": "str", - "policyEnforcement": "str", - }, - "snapshot": {"snapshotPolicyResourceId": "str"}, - }, - "exportPolicy": { - "rules": [ - { - "allowedClients": ["str"], - "nfsv3": "str", - "nfsv4": "str", - "rootAccess": "str", - "ruleIndex": 0, - "unixAccessRule": "str", - } - ] - }, - "size": 0, - "smbProperties": {"smbEncryption": "str"}, - "snapshotDirectoryVisibility": "str", - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_volumes_begin_delete(self, resource_group): - response = await ( - await self.client.elastic_volumes.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_volumes_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_volumes.list_by_elastic_pool( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_volumes_begin_revert(self, resource_group): - response = await ( - await self.client.elastic_volumes.begin_revert( - resource_group_name=resource_group.name, - account_name="str", - pool_name="str", - volume_name="str", - body={"snapshotResourceId": "str"}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations.py index fa7b11b561e5..ed1c6dc1efe2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations.py @@ -138,10 +138,7 @@ def test_volume_groups_begin_create(self, resource_group): "isRestoring": bool, "kerberosEnabled": bool, "keyVaultPrivateEndpointResourceId": "str", - "language": "str", - "largeVolumeType": "str", "ldapEnabled": bool, - "ldapServerType": "str", "maximumNumberOfFiles": 0, "mountTargets": [ { diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations_async.py index e9c6c1e9013e..e85958487a49 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations_async.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volume_groups_operations_async.py @@ -144,10 +144,7 @@ async def test_volume_groups_begin_create(self, resource_group): "isRestoring": bool, "kerberosEnabled": bool, "keyVaultPrivateEndpointResourceId": "str", - "language": "str", - "largeVolumeType": "str", "ldapEnabled": bool, - "ldapServerType": "str", "maximumNumberOfFiles": 0, "mountTargets": [ { diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations.py index c246e210b195..6cccb58d08f0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations.py @@ -118,10 +118,7 @@ def test_volumes_begin_create_or_update(self, resource_group): "isRestoring": bool, "kerberosEnabled": bool, "keyVaultPrivateEndpointResourceId": "str", - "language": "str", - "largeVolumeType": "str", "ldapEnabled": bool, - "ldapServerType": "str", "maximumNumberOfFiles": 0, "mountTargets": [ {"fileSystemId": "str", "ipAddress": "str", "mountTargetId": "str", "smbServerFqdn": "str"} diff --git a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations_async.py b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations_async.py index 4ff5a7f6cc0a..2047229e6eda 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations_async.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_tests/test_net_app_management_volumes_operations_async.py @@ -120,10 +120,7 @@ async def test_volumes_begin_create_or_update(self, resource_group): "isRestoring": bool, "kerberosEnabled": bool, "keyVaultPrivateEndpointResourceId": "str", - "language": "str", - "largeVolumeType": "str", "ldapEnabled": bool, - "ldapServerType": "str", "maximumNumberOfFiles": 0, "mountTargets": [ {"fileSystemId": "str", "ipAddress": "str", "mountTargetId": "str", "smbServerFqdn": "str"} diff --git a/sdk/netapp/azure-mgmt-netapp/pyproject.toml b/sdk/netapp/azure-mgmt-netapp/pyproject.toml index 6738596cfaad..d89eeae0a296 100644 --- a/sdk/netapp/azure-mgmt-netapp/pyproject.toml +++ b/sdk/netapp/azure-mgmt-netapp/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Netapp Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -78,7 +78,7 @@ verifytypes = false package_name = "azure-mgmt-netapp" package_pprint_name = "NetApp Files Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true title = "NetAppManagementClient" package_nspkg = "azure-mgmt-nspkg" diff --git a/sdk/netapp/azure-mgmt-netapp/tsp-location.yaml b/sdk/netapp/azure-mgmt-netapp/tsp-location.yaml index f6c1047ff703..3ccb9ec4bec0 100644 --- a/sdk/netapp/azure-mgmt-netapp/tsp-location.yaml +++ b/sdk/netapp/azure-mgmt-netapp/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/netapp/resource-manager/Microsoft.NetApp/NetApp -commit: 7b37a9458cffc3977f2c84f487fcb3ccc429f8a7 +commit: 2371f14ab26ab99500de46ac5c507476a8e0fc61 repo: Azure/azure-rest-api-specs additionalDirectories: From f7bfe0bd72b962271f5fc42f89c57775ac65461b Mon Sep 17 00:00:00 2001 From: aprilk-ms <55356546+aprilk-ms@users.noreply.github.com> Date: Thu, 22 Oct 2026 22:49:36 -0700 Subject: [PATCH 30/35] [azure-ai-evaluation] Release 1.18.10 (#49664) Set the 1.18.10 release date to 2026-10-22 and remove the empty Breaking Changes section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2f098480-98df-4b3c-ac40-169bb0a87291 --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index db64a8f93f67..9ac425a5d204 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.18.10 (Unreleased) +## 1.18.10 (2026-10-22) ### Features Added @@ -12,8 +12,6 @@ - Decision HTTP errors include the provider's nested `error.code` when it starts with an ASCII letter and contains only letters, digits, dots, underscores, or hyphens, up to 128 characters. This is provider-controlled diagnostic text, not a guarantee that the code is free of sensitive data. Messages, details, and raw response bodies are not exposed. - Decision native async HTTP supports overall deadlines and cancellation during response body reads. TLS uses Python/OpenSSL trust settings such as `SSL_CERT_FILE`, not `REQUESTS_CA_BUNDLE`; shared Prompty transport behavior is unchanged. -### Breaking Changes - ### Bugs Fixed - Retained known earlier-turn Decision usage and model metadata when an asynchronous split evaluation is cancelled directly, while preserving `CancelledError` and existing callback cancellation behavior. From 335c8fa63eddf7b3720e4fa1b3838f4bad94c434 Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:18:15 -0400 Subject: [PATCH 31/35] [AutoPR azure-mgmt-redhatopenshifthcp]-generated-from-SDK Generation - Python-6992251 (#49640) * Configurations: 'specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/hcpopenshiftclusters/tspconfig.yaml', and CommitSHA: '322d99debcab19ffe9f41bfbd44631b9ba0de3b3' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6984422 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Configurations: 'specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/hcpopenshiftclusters/tspconfig.yaml', and CommitSHA: 'a2de2d1a53d195c987a30184b2ddd378417ff44e' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6992251 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: azure-sdk --- .../CHANGELOG.md | 18 ++ .../_metadata.json | 10 +- .../azure-mgmt-redhatopenshifthcp/api.md | 104 +++++-- .../api.metadata.yml | 6 +- .../apiview-properties.json | 10 +- .../azure/mgmt/redhatopenshifthcp/_client.py | 7 +- .../mgmt/redhatopenshifthcp/_configuration.py | 9 +- .../azure/mgmt/redhatopenshifthcp/_version.py | 2 +- .../mgmt/redhatopenshifthcp/aio/_client.py | 7 +- .../redhatopenshifthcp/aio/_configuration.py | 9 +- .../aio/operations/_operations.py | 4 +- .../redhatopenshifthcp/models/__init__.py | 16 +- .../mgmt/redhatopenshifthcp/models/_enums.py | 13 +- .../mgmt/redhatopenshifthcp/models/_models.py | 267 +++++++++++++----- .../operations/_operations.py | 50 ++-- .../azure/mgmt/redhatopenshifthcp/types.py | 235 ++++++++++----- ..._auths_create_or_update_maximum_set_gen.py | 2 +- .../external_auths_delete_maximum_set_gen.py | 2 +- .../external_auths_get_maximum_set_gen.py | 2 +- ...al_auths_list_by_parent_maximum_set_gen.py | 2 +- .../external_auths_update_maximum_set_gen.py | 2 +- ...usters_create_or_update_maximum_set_gen.py | 2 +- ...n_shift_clusters_delete_maximum_set_gen.py | 2 +- ...open_shift_clusters_get_maximum_set_gen.py | 2 +- ..._list_by_resource_group_maximum_set_gen.py | 2 +- ...rs_list_by_subscription_maximum_set_gen.py | 2 +- ...equest_admin_credential_maximum_set_gen.py | 2 +- ...ters_revoke_credentials_maximum_set_gen.py | 2 +- ...n_shift_clusters_update_maximum_set_gen.py | 2 +- ...open_shift_versions_get_maximum_set_gen.py | 2 +- ...pen_shift_versions_list_maximum_set_gen.py | 2 +- ..._identity_role_sets_get_maximum_set_gen.py | 2 +- ...identity_role_sets_list_maximum_set_gen.py | 2 +- ..._pools_create_or_update_maximum_set_gen.py | 2 +- .../node_pools_delete_maximum_set_gen.py | 2 +- .../node_pools_get_maximum_set_gen.py | 2 +- ...de_pools_list_by_parent_maximum_set_gen.py | 2 +- .../node_pools_update_maximum_set_gen.py | 2 +- .../operations_list_maximum_set_gen.py | 2 +- .../operations_list_minimum_set_gen.py | 2 +- ...mgmt_hcp_open_shift_clusters_operations.py | 10 +- ...cp_open_shift_clusters_operations_async.py | 10 +- ...en_shift_hcp_mgmt_node_pools_operations.py | 6 +- ...ft_hcp_mgmt_node_pools_operations_async.py | 6 +- .../pyproject.toml | 4 +- .../tsp-location.yaml | 2 +- 46 files changed, 612 insertions(+), 241 deletions(-) diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/CHANGELOG.md b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/CHANGELOG.md index 51dca1e5bc70..a56fe2b319a6 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/CHANGELOG.md +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 1.0.0 (2026-10-23) + +### Features Added + + - Model `KmsEncryptionProfile` added property `key_vault_type` + - Model `PlatformProfile` added property `container_registry` + - Added model `ClusterActiveVersion` + - Added model `ClusterResourceStatus` + - Added model `ContainerRegistryProfile` + - Added model `ExternalAuthResourceStatus` + - Added enum `KmsKeyVaultType` + - Added model `NodePoolActiveVersion` + - Added model `NodePoolResourceStatus` + +### Breaking Changes + + - Deleted or renamed model `ResourceStatus` + ## 1.0.0b1 (2026-09-04) ### Other Changes diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/_metadata.json b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/_metadata.json index decbb732a015..30ab34f5a439 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/_metadata.json +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/_metadata.json @@ -1,11 +1,11 @@ { - "apiVersion": "2026-09-01-preview", + "apiVersion": "2026-10-01", "apiVersions": { - "Microsoft.RedHatOpenShift": "2026-09-01-preview" + "Microsoft.RedHatOpenShift": "2026-10-01" }, - "commit": "635384bb61bd0ec32bbc5b8787ad49777effd903", + "commit": "a2de2d1a53d195c987a30184b2ddd378417ff44e", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/hcpopenshiftclusters", - "emitterVersion": "0.63.5", - "httpClientPythonVersion": "^0.36.0" + "emitterVersion": "0.63.10", + "httpClientPythonVersion": "0.39.0" } \ No newline at end of file diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.md b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.md index dcb8d59a7bbe..d57c56c9c404 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.md +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.md @@ -506,6 +506,10 @@ namespace azure.mgmt.redhatopenshifthcp.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.redhatopenshifthcp.models.ClusterActiveVersion(_Model): + version: str + + class azure.mgmt.redhatopenshifthcp.models.ClusterAutoscalingProfile(_Model): max_node_provision_time_seconds: Optional[int] max_nodes_total: Optional[int] @@ -545,6 +549,11 @@ namespace azure.mgmt.redhatopenshifthcp.models ENABLED = "Enabled" + class azure.mgmt.redhatopenshifthcp.models.ClusterResourceStatus(_Model): + active_versions: Optional[list[ClusterActiveVersion]] + conditions: Optional[list[Condition]] + + class azure.mgmt.redhatopenshifthcp.models.Condition(_Model): last_transition_time: datetime message: str @@ -563,6 +572,20 @@ namespace azure.mgmt.redhatopenshifthcp.models url: str + class azure.mgmt.redhatopenshifthcp.models.ContainerRegistryProfile(_Model): + managed_identity: Optional[str] + + @overload + def __init__( + self, + *, + managed_identity: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.mgmt.redhatopenshifthcp.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): APPLICATION = "Application" KEY = "Key" @@ -763,7 +786,7 @@ namespace azure.mgmt.redhatopenshifthcp.models clients: Optional[list[ExternalAuthClientProfile]] issuer: TokenIssuerProfile provisioning_state: Optional[Union[str, ExternalAuthProvisioningState]] - status: Optional[ResourceStatus] + status: Optional[ExternalAuthResourceStatus] @overload def __init__( @@ -789,6 +812,10 @@ namespace azure.mgmt.redhatopenshifthcp.models UPDATING = "Updating" + class azure.mgmt.redhatopenshifthcp.models.ExternalAuthResourceStatus(_Model): + conditions: Optional[list[Condition]] + + class azure.mgmt.redhatopenshifthcp.models.GroupClaimProfile(_Model): claim: str prefix: Optional[str] @@ -862,7 +889,7 @@ namespace azure.mgmt.redhatopenshifthcp.models node_drain_timeout_minutes: Optional[int] platform: PlatformProfile provisioning_state: Optional[Union[str, ProvisioningState]] - status: Optional[ResourceStatus] + status: Optional[ClusterResourceStatus] version: VersionProfile @overload @@ -1000,6 +1027,7 @@ namespace azure.mgmt.redhatopenshifthcp.models class azure.mgmt.redhatopenshifthcp.models.KmsEncryptionProfile(_Model): active_key: KmsKey + key_vault_type: Optional[Union[str, KmsKeyVaultType]] vault_name: str visibility: Union[str, KeyVaultVisibility] @@ -1008,6 +1036,7 @@ namespace azure.mgmt.redhatopenshifthcp.models self, *, active_key: KmsKey, + key_vault_type: Optional[Union[str, KmsKeyVaultType]] = ..., vault_name: str, visibility: Union[str, KeyVaultVisibility] ) -> None: ... @@ -1032,6 +1061,11 @@ namespace azure.mgmt.redhatopenshifthcp.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.redhatopenshifthcp.models.KmsKeyVaultType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + KEY_VAULT = "KeyVault" + MANAGED_HSM = "ManagedHSM" + + class azure.mgmt.redhatopenshifthcp.models.Label(_Model): key: str value: Optional[str] @@ -1124,6 +1158,10 @@ namespace azure.mgmt.redhatopenshifthcp.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.redhatopenshifthcp.models.NodePoolActiveVersion(_Model): + version: str + + class azure.mgmt.redhatopenshifthcp.models.NodePoolAutoScaling(_Model): max: Optional[int] min: Optional[int] @@ -1170,7 +1208,7 @@ namespace azure.mgmt.redhatopenshifthcp.models platform: NodePoolPlatformProfile provisioning_state: Optional[Union[str, ProvisioningState]] replicas: Optional[int] - status: Optional[ResourceStatus] + status: Optional[NodePoolResourceStatus] taints: Optional[list[Taint]] version: Optional[NodePoolVersionProfile] @@ -1192,6 +1230,11 @@ namespace azure.mgmt.redhatopenshifthcp.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.redhatopenshifthcp.models.NodePoolResourceStatus(_Model): + active_versions: Optional[list[NodePoolActiveVersion]] + conditions: Optional[list[Condition]] + + class azure.mgmt.redhatopenshifthcp.models.NodePoolVersionProfile(_Model): channel_group: Optional[str] id: str @@ -1306,6 +1349,7 @@ namespace azure.mgmt.redhatopenshifthcp.models class azure.mgmt.redhatopenshifthcp.models.PlatformProfile(_Model): + container_registry: Optional[ContainerRegistryProfile] issuer_url: str managed_resource_group: Optional[str] network_security_group_id: str @@ -1318,6 +1362,7 @@ namespace azure.mgmt.redhatopenshifthcp.models def __init__( self, *, + container_registry: Optional[ContainerRegistryProfile] = ..., managed_resource_group: Optional[str] = ..., network_security_group_id: str, operators_authentication: OperatorsAuthenticationProfile, @@ -1354,10 +1399,6 @@ namespace azure.mgmt.redhatopenshifthcp.models type: Optional[str] - class azure.mgmt.redhatopenshifthcp.models.ResourceStatus(_Model): - conditions: Optional[list[Condition]] - - class azure.mgmt.redhatopenshifthcp.models.RoleDefinition(_Model): name: str resource_id: str @@ -2008,6 +2049,11 @@ namespace azure.mgmt.redhatopenshifthcp.types visibility: Union[str, Visibility] + class azure.mgmt.redhatopenshifthcp.types.ClusterActiveVersion(TypedDict, total=False): + key "version": Required[str] + version: str + + class azure.mgmt.redhatopenshifthcp.types.ClusterAutoscalingProfile(TypedDict, total=False): key "maxNodeProvisionTimeSeconds": int key "maxNodesTotal": int @@ -2024,6 +2070,11 @@ namespace azure.mgmt.redhatopenshifthcp.types state: Union[str, ClusterImageRegistryState] + class azure.mgmt.redhatopenshifthcp.types.ClusterResourceStatus(TypedDict, total=False): + activeVersions: list[ClusterActiveVersion] + conditions: list[Condition] + + class azure.mgmt.redhatopenshifthcp.types.Condition(TypedDict, total=False): key "lastTransitionTime": Required[str] key "message": Required[str] @@ -2042,6 +2093,11 @@ namespace azure.mgmt.redhatopenshifthcp.types url: str + class azure.mgmt.redhatopenshifthcp.types.ContainerRegistryProfile(TypedDict, total=False): + key "managedIdentity": str + managedIdentity: str + + class azure.mgmt.redhatopenshifthcp.types.CustomerManagedEncryptionProfile(TypedDict, total=False): key "encryptionType": Union[str, CustomerManagedEncryptionType] key "kms": ForwardRef('KmsEncryptionProfile', module='types') @@ -2108,12 +2164,16 @@ namespace azure.mgmt.redhatopenshifthcp.types key "claim": Required[ExternalAuthClaimProfile] key "issuer": Required[TokenIssuerProfile] key "provisioningState": Union[str, ExternalAuthProvisioningState] - key "status": ForwardRef('ResourceStatus', module='types') + key "status": ForwardRef('ExternalAuthResourceStatus', module='types') claim: ExternalAuthClaimProfile clients: list[ExternalAuthClientProfile] issuer: TokenIssuerProfile provisioningState: Union[str, ExternalAuthProvisioningState] - status: ResourceStatus + status: ExternalAuthResourceStatus + + + class azure.mgmt.redhatopenshifthcp.types.ExternalAuthResourceStatus(TypedDict, total=False): + conditions: list[Condition] class azure.mgmt.redhatopenshifthcp.types.GroupClaimProfile(TypedDict, total=False): @@ -2159,7 +2219,7 @@ namespace azure.mgmt.redhatopenshifthcp.types key "nodeDrainTimeoutMinutes": int key "platform": Required[PlatformProfile] key "provisioningState": Union[str, ProvisioningState] - key "status": ForwardRef('ResourceStatus', module='types') + key "status": ForwardRef('ClusterResourceStatus', module='types') key "version": Required[VersionProfile] api: ApiProfile autoscaling: ClusterAutoscalingProfile @@ -2174,7 +2234,7 @@ namespace azure.mgmt.redhatopenshifthcp.types nodeDrainTimeoutMinutes: int platform: PlatformProfile provisioningState: Union[str, ProvisioningState] - status: ResourceStatus + status: ClusterResourceStatus version: VersionProfile @@ -2192,9 +2252,11 @@ namespace azure.mgmt.redhatopenshifthcp.types class azure.mgmt.redhatopenshifthcp.types.KmsEncryptionProfile(TypedDict, total=False): key "activeKey": Required[KmsKey] + key "keyVaultType": Union[str, KmsKeyVaultType] key "vaultName": Required[str] key "visibility": Required[Union[str, KeyVaultVisibility]] activeKey: KmsKey + keyVaultType: Union[str, KmsKeyVaultType] vaultName: str visibility: Union[str, KeyVaultVisibility] @@ -2254,6 +2316,11 @@ namespace azure.mgmt.redhatopenshifthcp.types type: str + class azure.mgmt.redhatopenshifthcp.types.NodePoolActiveVersion(TypedDict, total=False): + key "version": Required[str] + version: str + + class azure.mgmt.redhatopenshifthcp.types.NodePoolAutoScaling(TypedDict, total=False): key "max": int key "min": int @@ -2281,7 +2348,7 @@ namespace azure.mgmt.redhatopenshifthcp.types key "platform": Required[NodePoolPlatformProfile] key "provisioningState": Union[str, ProvisioningState] key "replicas": int - key "status": ForwardRef('ResourceStatus', module='types') + key "status": ForwardRef('NodePoolResourceStatus', module='types') key "version": ForwardRef('NodePoolVersionProfile', module='types') autoRepair: bool autoScaling: NodePoolAutoScaling @@ -2290,11 +2357,16 @@ namespace azure.mgmt.redhatopenshifthcp.types platform: NodePoolPlatformProfile provisioningState: Union[str, ProvisioningState] replicas: int - status: ResourceStatus + status: NodePoolResourceStatus taints: list[Taint] version: NodePoolVersionProfile + class azure.mgmt.redhatopenshifthcp.types.NodePoolResourceStatus(TypedDict, total=False): + activeVersions: list[NodePoolActiveVersion] + conditions: list[Condition] + + class azure.mgmt.redhatopenshifthcp.types.NodePoolVersionProfile(TypedDict, total=False): key "channelGroup": str key "id": Required[str] @@ -2319,6 +2391,7 @@ namespace azure.mgmt.redhatopenshifthcp.types class azure.mgmt.redhatopenshifthcp.types.PlatformProfile(TypedDict, total=False): + key "containerRegistry": ForwardRef('ContainerRegistryProfile', module='types') key "issuerUrl": Required[str] key "managedResourceGroup": str key "networkSecurityGroupId": Required[str] @@ -2326,6 +2399,7 @@ namespace azure.mgmt.redhatopenshifthcp.types key "outboundType": Union[str, OutboundType] key "subnetId": Required[str] key "vnetIntegrationSubnetId": Required[str] + containerRegistry: ContainerRegistryProfile issuerUrl: str managedResourceGroup: str networkSecurityGroupId: str @@ -2357,10 +2431,6 @@ namespace azure.mgmt.redhatopenshifthcp.types type: str - class azure.mgmt.redhatopenshifthcp.types.ResourceStatus(TypedDict, total=False): - conditions: list[Condition] - - class azure.mgmt.redhatopenshifthcp.types.SystemData(TypedDict, total=False): key "createdAt": str key "createdBy": str diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.metadata.yml b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.metadata.yml index 44abda4da804..0bdca18bb640 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.metadata.yml +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: 4d2f92084344ba28edb0573c0e3df80f9ea5d606e10b2584ffea78a35958e20d -packageVersion: 1.0.0b1 +apiHash: 6d4591b817de13ab93f315eb37d2e2f711c71e4e4d0b7f0c42e12ad168cbf4b4 +packageVersion: 1.0.0 parserVersion: 0.3.31 -pythonVersion: 3.13.15 +pythonVersion: 3.13.16 diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/apiview-properties.json b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/apiview-properties.json index 49ab8d59c599..264ccdfe7772 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/apiview-properties.json +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/apiview-properties.json @@ -2,10 +2,13 @@ "CrossLanguagePackageId": "Microsoft.RedHatOpenShift", "CrossLanguageDefinitionId": { "azure.mgmt.redhatopenshifthcp.models.ApiProfile": "Microsoft.RedHatOpenShift.ApiProfile", + "azure.mgmt.redhatopenshifthcp.models.ClusterActiveVersion": "Microsoft.RedHatOpenShift.ClusterActiveVersion", "azure.mgmt.redhatopenshifthcp.models.ClusterAutoscalingProfile": "Microsoft.RedHatOpenShift.ClusterAutoscalingProfile", "azure.mgmt.redhatopenshifthcp.models.ClusterImageRegistryProfile": "Microsoft.RedHatOpenShift.ClusterImageRegistryProfile", + "azure.mgmt.redhatopenshifthcp.models.ClusterResourceStatus": "Microsoft.RedHatOpenShift.ClusterResourceStatus", "azure.mgmt.redhatopenshifthcp.models.Condition": "Microsoft.RedHatOpenShift.Condition", "azure.mgmt.redhatopenshifthcp.models.ConsoleProfile": "Microsoft.RedHatOpenShift.ConsoleProfile", + "azure.mgmt.redhatopenshifthcp.models.ContainerRegistryProfile": "Microsoft.RedHatOpenShift.ContainerRegistryProfile", "azure.mgmt.redhatopenshifthcp.models.CustomerManagedEncryptionProfile": "Microsoft.RedHatOpenShift.CustomerManagedEncryptionProfile", "azure.mgmt.redhatopenshifthcp.models.DnsProfile": "Microsoft.RedHatOpenShift.DnsProfile", "azure.mgmt.redhatopenshifthcp.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", @@ -20,6 +23,7 @@ "azure.mgmt.redhatopenshifthcp.models.ExternalAuthClientComponentProfile": "Microsoft.RedHatOpenShift.ExternalAuthClientComponentProfile", "azure.mgmt.redhatopenshifthcp.models.ExternalAuthClientProfile": "Microsoft.RedHatOpenShift.ExternalAuthClientProfile", "azure.mgmt.redhatopenshifthcp.models.ExternalAuthProperties": "Microsoft.RedHatOpenShift.ExternalAuthProperties", + "azure.mgmt.redhatopenshifthcp.models.ExternalAuthResourceStatus": "Microsoft.RedHatOpenShift.ExternalAuthResourceStatus", "azure.mgmt.redhatopenshifthcp.models.GroupClaimProfile": "Microsoft.RedHatOpenShift.GroupClaimProfile", "azure.mgmt.redhatopenshifthcp.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.redhatopenshifthcp.models.HcpOpenShiftCluster": "Microsoft.RedHatOpenShift.HcpOpenShiftCluster", @@ -38,9 +42,11 @@ "azure.mgmt.redhatopenshifthcp.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", "azure.mgmt.redhatopenshifthcp.models.NetworkProfile": "Microsoft.RedHatOpenShift.NetworkProfile", "azure.mgmt.redhatopenshifthcp.models.NodePool": "Microsoft.RedHatOpenShift.NodePool", + "azure.mgmt.redhatopenshifthcp.models.NodePoolActiveVersion": "Microsoft.RedHatOpenShift.NodePoolActiveVersion", "azure.mgmt.redhatopenshifthcp.models.NodePoolAutoScaling": "Microsoft.RedHatOpenShift.NodePoolAutoScaling", "azure.mgmt.redhatopenshifthcp.models.NodePoolPlatformProfile": "Microsoft.RedHatOpenShift.NodePoolPlatformProfile", "azure.mgmt.redhatopenshifthcp.models.NodePoolProperties": "Microsoft.RedHatOpenShift.NodePoolProperties", + "azure.mgmt.redhatopenshifthcp.models.NodePoolResourceStatus": "Microsoft.RedHatOpenShift.NodePoolResourceStatus", "azure.mgmt.redhatopenshifthcp.models.NodePoolVersionProfile": "Microsoft.RedHatOpenShift.NodePoolVersionProfile", "azure.mgmt.redhatopenshifthcp.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.redhatopenshifthcp.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", @@ -48,7 +54,6 @@ "azure.mgmt.redhatopenshifthcp.models.OperatorsAuthenticationProfile": "Microsoft.RedHatOpenShift.OperatorsAuthenticationProfile", "azure.mgmt.redhatopenshifthcp.models.OsDiskProfile": "Microsoft.RedHatOpenShift.OsDiskProfile", "azure.mgmt.redhatopenshifthcp.models.PlatformProfile": "Microsoft.RedHatOpenShift.PlatformProfile", - "azure.mgmt.redhatopenshifthcp.models.ResourceStatus": "Microsoft.RedHatOpenShift.ResourceStatus", "azure.mgmt.redhatopenshifthcp.models.RoleDefinition": "Microsoft.RedHatOpenShift.RoleDefinition", "azure.mgmt.redhatopenshifthcp.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.redhatopenshifthcp.models.Taint": "Microsoft.RedHatOpenShift.Taint", @@ -71,6 +76,7 @@ "azure.mgmt.redhatopenshifthcp.models.EtcdDataEncryptionKeyManagementModeType": "Microsoft.RedHatOpenShift.EtcdDataEncryptionKeyManagementModeType", "azure.mgmt.redhatopenshifthcp.models.CustomerManagedEncryptionType": "Microsoft.RedHatOpenShift.CustomerManagedEncryptionType", "azure.mgmt.redhatopenshifthcp.models.KeyVaultVisibility": "Microsoft.RedHatOpenShift.KeyVaultVisibility", + "azure.mgmt.redhatopenshifthcp.models.KmsKeyVaultType": "Microsoft.RedHatOpenShift.KmsKeyVaultType", "azure.mgmt.redhatopenshifthcp.models.ClusterImageRegistryState": "Microsoft.RedHatOpenShift.ClusterImageRegistryState", "azure.mgmt.redhatopenshifthcp.models.ConditionType": "Microsoft.RedHatOpenShift.ConditionType", "azure.mgmt.redhatopenshifthcp.models.StatusType": "Microsoft.RedHatOpenShift.StatusType", @@ -131,5 +137,5 @@ "azure.mgmt.redhatopenshifthcp.operations.HcpOperatorIdentityRoleSetsOperations.get": "Microsoft.RedHatOpenShift.HcpOperatorIdentityRoleSets.get", "azure.mgmt.redhatopenshifthcp.aio.operations.HcpOperatorIdentityRoleSetsOperations.get": "Microsoft.RedHatOpenShift.HcpOperatorIdentityRoleSets.get" }, - "CrossLanguageVersion": "1f776ff90d3f" + "CrossLanguageVersion": "06d177f774d6" } \ No newline at end of file diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_client.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_client.py index 37cbcf295be1..59dc882096e5 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_client.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_client.py @@ -65,10 +65,9 @@ class RedHatOpenShiftHcpMgmtClient: # pylint: disable=docstring-keyword-should- :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-10-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_configuration.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_configuration.py index 2e2522c61210..fabaef17a9fe 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_configuration.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_configuration.py @@ -34,10 +34,9 @@ class RedHatOpenShiftHcpMgmtClientConfiguration: # pylint: disable=too-many-ins :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-10-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-09-01-preview") + api_version: str = kwargs.pop("api_version", "2026-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_version.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_version.py index be71c81bd282..0ec13ea52bbf 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_version.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_client.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_client.py index df3dbb48ecdb..532e7ec6124b 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_client.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_client.py @@ -65,10 +65,9 @@ class RedHatOpenShiftHcpMgmtClient: # pylint: disable=docstring-keyword-should- :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-10-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_configuration.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_configuration.py index 0bcb30768407..eb0e5f6e19c0 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_configuration.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/_configuration.py @@ -34,10 +34,9 @@ class RedHatOpenShiftHcpMgmtClientConfiguration: # pylint: disable=too-many-ins :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-10-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-09-01-preview") + api_version: str = kwargs.pop("api_version", "2026-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/operations/_operations.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/operations/_operations.py index 8115409c7947..40f4a7521a94 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/operations/_operations.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/aio/operations/_operations.py @@ -1079,7 +1079,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-09-01-preview"], + api_versions_list=["2026-09-01-preview", "2026-10-01"], ) async def _request_admin_credential_initial( self, @@ -1260,7 +1260,7 @@ async def begin_request_admin_credential( "accept", ] }, - api_versions_list=["2026-09-01-preview"], + api_versions_list=["2026-09-01-preview", "2026-10-01"], ) async def begin_request_admin_credential( self, diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/__init__.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/__init__.py index 8da6941e434b..e4c74ea24ae7 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/__init__.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/__init__.py @@ -15,10 +15,13 @@ from ._models import ( # type: ignore ApiProfile, + ClusterActiveVersion, ClusterAutoscalingProfile, ClusterImageRegistryProfile, + ClusterResourceStatus, Condition, ConsoleProfile, + ContainerRegistryProfile, CustomerManagedEncryptionProfile, DnsProfile, ErrorAdditionalInfo, @@ -31,6 +34,7 @@ ExternalAuthClientComponentProfile, ExternalAuthClientProfile, ExternalAuthProperties, + ExternalAuthResourceStatus, GroupClaimProfile, HcpOpenShiftCluster, HcpOpenShiftClusterAdminCredential, @@ -48,9 +52,11 @@ ManagedServiceIdentity, NetworkProfile, NodePool, + NodePoolActiveVersion, NodePoolAutoScaling, NodePoolPlatformProfile, NodePoolProperties, + NodePoolResourceStatus, NodePoolVersionProfile, Operation, OperationDisplay, @@ -60,7 +66,6 @@ PlatformProfile, ProxyResource, Resource, - ResourceStatus, RoleDefinition, SystemData, Taint, @@ -89,6 +94,7 @@ ExternalAuthProvisioningState, IngressType, KeyVaultVisibility, + KmsKeyVaultType, ManagedServiceIdentityType, NetworkType, OperatorIdentityRequired, @@ -107,10 +113,13 @@ __all__ = [ "ApiProfile", + "ClusterActiveVersion", "ClusterAutoscalingProfile", "ClusterImageRegistryProfile", + "ClusterResourceStatus", "Condition", "ConsoleProfile", + "ContainerRegistryProfile", "CustomerManagedEncryptionProfile", "DnsProfile", "ErrorAdditionalInfo", @@ -123,6 +132,7 @@ "ExternalAuthClientComponentProfile", "ExternalAuthClientProfile", "ExternalAuthProperties", + "ExternalAuthResourceStatus", "GroupClaimProfile", "HcpOpenShiftCluster", "HcpOpenShiftClusterAdminCredential", @@ -140,9 +150,11 @@ "ManagedServiceIdentity", "NetworkProfile", "NodePool", + "NodePoolActiveVersion", "NodePoolAutoScaling", "NodePoolPlatformProfile", "NodePoolProperties", + "NodePoolResourceStatus", "NodePoolVersionProfile", "Operation", "OperationDisplay", @@ -152,7 +164,6 @@ "PlatformProfile", "ProxyResource", "Resource", - "ResourceStatus", "RoleDefinition", "SystemData", "Taint", @@ -178,6 +189,7 @@ "ExternalAuthProvisioningState", "IngressType", "KeyVaultVisibility", + "KmsKeyVaultType", "ManagedServiceIdentityType", "NetworkType", "OperatorIdentityRequired", diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_enums.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_enums.py index 3ce71f946cfc..5ffeebc002e7 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_enums.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_enums.py @@ -11,7 +11,7 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. """ @@ -151,6 +151,15 @@ class KeyVaultVisibility(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The keyvault is not visible from the internet.""" +class KmsKeyVaultType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of keyvault used for KMS encryption.""" + + KEY_VAULT = "KeyVault" + """Standard Azure Key Vault.""" + MANAGED_HSM = "ManagedHSM" + """Azure Managed Hardware Security Module.""" + + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -187,7 +196,7 @@ class OperatorIdentityRequired(str, Enum, metaclass=CaseInsensitiveEnumMeta): class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". + logs UX. Default value is \"user,system\". """ USER = "user" diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_models.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_models.py index 972736a82f94..3673467b0cf4 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_models.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/models/_models.py @@ -57,16 +57,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ClusterActiveVersion(_Model): + """ClusterActiveVersion represents a version of a resource. + + :ivar version: The version of the resource. Specified in major.minor, same as the input. + Required. + :vartype version: str + """ + + version: str = rest_field(visibility=["read"]) + """The version of the resource. Specified in major.minor, same as the input. Required.""" + + class ClusterAutoscalingProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ClusterAutoscaling specifies auto-scaling behavior that applies to all NodePools associated with a control plane. - :ivar max_nodes_total: maxNodesTotal is the maximum allowable number of nodes for the - Autoscaler scale out to be operational. The autoscaler will not grow the cluster beyond this - number. If omitted, the autoscaler will not have a maximum limit. + :ivar max_nodes_total: maxNodesTotal is the maximum allowable number of nodes. The autoscaler + will not grow the cluster beyond this number. If omitted, the autoscaler will not have a + maximum limit. :vartype max_nodes_total: int - :ivar max_pod_grace_period_seconds: maxPodGracePeriod is the maximum seconds to wait for - graceful pod termination before scaling down a NodePool. The default is 600 seconds. + :ivar max_pod_grace_period_seconds: maxPodGracePeriodSeconds is the maximum amount of time in + seconds to wait for graceful pod termination before scaling down a NodePool. The default is 600 + seconds. :vartype max_pod_grace_period_seconds: int :ivar max_node_provision_time_seconds: maxNodeProvisionTimeSeconds is the maximum time to wait for node provisioning before considering the provisioning to be unsuccessful. The default is @@ -83,14 +96,13 @@ class ClusterAutoscalingProfile(_Model): # pylint: disable=docstring-keyword-sh max_nodes_total: Optional[int] = rest_field( name="maxNodesTotal", visibility=["read", "create", "update", "delete", "query"] ) - """maxNodesTotal is the maximum allowable number of nodes for the Autoscaler scale out to be - operational. The autoscaler will not grow the cluster beyond this number. If omitted, the - autoscaler will not have a maximum limit.""" + """maxNodesTotal is the maximum allowable number of nodes. The autoscaler will not grow the + cluster beyond this number. If omitted, the autoscaler will not have a maximum limit.""" max_pod_grace_period_seconds: Optional[int] = rest_field( name="maxPodGracePeriodSeconds", visibility=["read", "create", "update", "delete", "query"] ) - """maxPodGracePeriod is the maximum seconds to wait for graceful pod termination before scaling - down a NodePool. The default is 600 seconds.""" + """maxPodGracePeriodSeconds is the maximum amount of time in seconds to wait for graceful pod + termination before scaling down a NodePool. The default is 600 seconds.""" max_node_provision_time_seconds: Optional[int] = rest_field( name="maxNodeProvisionTimeSeconds", visibility=["read", "create", "update", "delete", "query"] ) @@ -162,6 +174,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ClusterResourceStatus(_Model): + """ClusterResourceStatus represents the observed status of the cluster resource. + + :ivar conditions: The conditions on the resource. + :vartype conditions: list[~azure.mgmt.redhatopenshifthcp.models.Condition] + :ivar active_versions: The observed active versions of the cluster. During upgrades, both the + previous and target versions may be active simultaneously until the rollout completes, so this + array can contain more than one entry. The ordering of entries has no meaning. + :vartype active_versions: list[~azure.mgmt.redhatopenshifthcp.models.ClusterActiveVersion] + """ + + conditions: Optional[list["_models.Condition"]] = rest_field(visibility=["read"]) + """The conditions on the resource.""" + active_versions: Optional[list["_models.ClusterActiveVersion"]] = rest_field( + name="activeVersions", visibility=["read"] + ) + """The observed active versions of the cluster. During upgrades, both the previous and target + versions may be active simultaneously until the rollout completes, so this array can contain + more than one entry. The ordering of entries has no meaning.""" + + class Condition(_Model): """Condition represents an observation of a resource's state. @@ -210,6 +243,36 @@ class ConsoleProfile(_Model): """The cluster web console URL endpoint. Required.""" +class ContainerRegistryProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure Container Registry configuration for a cluster. Configures how worker nodes authenticate + container image pulls from Azure Container Registry (ACR). + + :ivar managed_identity: The user-assigned managed identity used for container registry image + pulls. + :vartype managed_identity: str + """ + + managed_identity: Optional[str] = rest_field(name="managedIdentity", visibility=["read", "create", "update"]) + """The user-assigned managed identity used for container registry image pulls.""" + + @overload + def __init__( + self, + *, + managed_identity: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class CustomerManagedEncryptionProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Customer managed encryption key profile. @@ -255,18 +318,17 @@ class DnsProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyw :ivar base_domain: BaseDomain is the base DNS domain of the cluster. :vartype base_domain: str - :ivar base_domain_prefix: BaseDomainPrefix is the unique name of the cluster representing the - OpenShift's cluster name. BaseDomainPrefix is the name that will appear in the cluster's DNS, - provisioned cloud providers resources. + :ivar base_domain_prefix: BaseDomainPrefix is the base domain prefix for the cluster ingress. + It will be used to configure ingress in the cluster through the subdomain + "BaseDomainPrefix.BaseDomain". :vartype base_domain_prefix: str """ base_domain: Optional[str] = rest_field(name="baseDomain", visibility=["read"]) """BaseDomain is the base DNS domain of the cluster.""" base_domain_prefix: Optional[str] = rest_field(name="baseDomainPrefix", visibility=["read", "create"]) - """BaseDomainPrefix is the unique name of the cluster representing the OpenShift's cluster name. - BaseDomainPrefix is the name that will appear in the cluster's DNS, provisioned cloud providers - resources.""" + """BaseDomainPrefix is the base domain prefix for the cluster ingress. It will be used to + configure ingress in the cluster through the subdomain \"BaseDomainPrefix.BaseDomain\".""" @overload def __init__( @@ -676,7 +738,7 @@ class ExternalAuthProperties(_Model): # pylint: disable=docstring-keyword-shoul :vartype provisioning_state: str or ~azure.mgmt.redhatopenshifthcp.models.ExternalAuthProvisioningState :ivar status: Status of the external auth resource. - :vartype status: ~azure.mgmt.redhatopenshifthcp.models.ResourceStatus + :vartype status: ~azure.mgmt.redhatopenshifthcp.models.ExternalAuthResourceStatus :ivar issuer: Token Issuer profile. Required. :vartype issuer: ~azure.mgmt.redhatopenshifthcp.models.TokenIssuerProfile :ivar clients: External Auth OIDC clients There must not be more than 20 entries and entries @@ -692,7 +754,7 @@ class ExternalAuthProperties(_Model): # pylint: disable=docstring-keyword-shoul ) """Provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", \"Deleting\", \"Provisioning\", \"Updating\", and \"AwaitingSecret\".""" - status: Optional["_models.ResourceStatus"] = rest_field(visibility=["read"]) + status: Optional["_models.ExternalAuthResourceStatus"] = rest_field(visibility=["read"]) """Status of the external auth resource.""" issuer: "_models.TokenIssuerProfile" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Token Issuer profile. Required.""" @@ -724,6 +786,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ExternalAuthResourceStatus(_Model): + """ExternalAuthResourceStatus represents the observed status of the external auth resource. + + :ivar conditions: The conditions on the resource. + :vartype conditions: list[~azure.mgmt.redhatopenshifthcp.models.Condition] + """ + + conditions: Optional[list["_models.Condition"]] = rest_field(visibility=["read"]) + """The conditions on the resource.""" + + class GroupClaimProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """External Auth claim profile This configures how the groups of a cluster identity should be constructed @@ -736,7 +809,7 @@ class GroupClaimProfile(_Model): # pylint: disable=docstring-keyword-should-mat :ivar claim: Claim name of the external profile. Required. :vartype claim: str - :ivar prefix: Prefix for the claim external profile If this is specified prefixPolicy will be + :ivar prefix: Prefix for the claim external profile. If this is specified, prefixPolicy will be set to "Prefix" by default. :vartype prefix: str """ @@ -744,7 +817,7 @@ class GroupClaimProfile(_Model): # pylint: disable=docstring-keyword-should-mat claim: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Claim name of the external profile. Required.""" prefix: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Prefix for the claim external profile If this is specified prefixPolicy will be set to + """Prefix for the claim external profile. If this is specified, prefixPolicy will be set to \"Prefix\" by default.""" @overload @@ -953,14 +1026,14 @@ class HcpOpenShiftClusterProperties(_Model): # pylint: disable=docstring-keywor Valid values are in minutes and from 0 to 10080 minutes (1 week). 0 means that the MachinePool can be drained without any time limitation. - This is the value is used a default for all NodePools. It can be overridden + This value is used as a default for all NodePools. It can be overridden by specifying nodeDrainTimeoutMinutes for a given NodePool. :vartype node_drain_timeout_minutes: int :ivar cluster_image_registry: OpenShift internal image registry. :vartype cluster_image_registry: ~azure.mgmt.redhatopenshifthcp.models.ClusterImageRegistryProfile :ivar status: Status of the cluster resource. - :vartype status: ~azure.mgmt.redhatopenshifthcp.models.ResourceStatus + :vartype status: ~azure.mgmt.redhatopenshifthcp.models.ClusterResourceStatus :ivar crypto_restrictions: Cryptographic restrictions for kernel and userspace libraries. Known values are: "None" and "FIPS". :vartype crypto_restrictions: str or ~azure.mgmt.redhatopenshifthcp.models.CryptoRestrictions @@ -979,7 +1052,7 @@ class HcpOpenShiftClusterProperties(_Model): # pylint: disable=docstring-keywor """Cluster network configuration.""" console: Optional["_models.ConsoleProfile"] = rest_field(visibility=["read"]) """Shows the cluster web console information.""" - api: Optional["_models.ApiProfile"] = rest_field(visibility=["read", "create"]) + api: Optional["_models.ApiProfile"] = rest_field(visibility=["read", "create", "update"]) """Shows the cluster API server profile.""" ingress: Optional["_models.IngressProfile"] = rest_field(visibility=["read", "create"]) """The cluster ingress configuration.""" @@ -1009,13 +1082,13 @@ class HcpOpenShiftClusterProperties(_Model): # pylint: disable=docstring-keywor Valid values are in minutes and from 0 to 10080 minutes (1 week). 0 means that the MachinePool can be drained without any time limitation. - This is the value is used a default for all NodePools. It can be overridden + This value is used as a default for all NodePools. It can be overridden by specifying nodeDrainTimeoutMinutes for a given NodePool.""" cluster_image_registry: Optional["_models.ClusterImageRegistryProfile"] = rest_field( name="clusterImageRegistry", visibility=["read", "create"] ) """OpenShift internal image registry.""" - status: Optional["_models.ResourceStatus"] = rest_field(visibility=["read"]) + status: Optional["_models.ClusterResourceStatus"] = rest_field(visibility=["read"]) """Status of the cluster resource.""" crypto_restrictions: Optional[Union[str, "_models.CryptoRestrictions"]] = rest_field( name="cryptoRestrictions", visibility=["read", "create"] @@ -1365,6 +1438,9 @@ class KmsEncryptionProfile(_Model): # pylint: disable=docstring-keyword-should- :vartype visibility: str or ~azure.mgmt.redhatopenshifthcp.models.KeyVaultVisibility :ivar active_key: The details of the active key. Required. :vartype active_key: ~azure.mgmt.redhatopenshifthcp.models.KmsKey + :ivar key_vault_type: The type of keyvault used for KMS encryption. Defaults to KeyVault when + absent. Known values are: "KeyVault" and "ManagedHSM". + :vartype key_vault_type: str or ~azure.mgmt.redhatopenshifthcp.models.KmsKeyVaultType """ vault_name: str = rest_field(name="vaultName", visibility=["read", "create"]) @@ -1374,6 +1450,11 @@ class KmsEncryptionProfile(_Model): # pylint: disable=docstring-keyword-should- \"Private\".""" active_key: "_models.KmsKey" = rest_field(name="activeKey", visibility=["read", "create", "update"]) """The details of the active key. Required.""" + key_vault_type: Optional[Union[str, "_models.KmsKeyVaultType"]] = rest_field( + name="keyVaultType", visibility=["read", "create"] + ) + """The type of keyvault used for KMS encryption. Defaults to KeyVault when absent. Known values + are: \"KeyVault\" and \"ManagedHSM\".""" @overload def __init__( @@ -1382,6 +1463,7 @@ def __init__( vault_name: str, visibility: Union[str, "_models.KeyVaultVisibility"], active_key: "_models.KmsKey", + key_vault_type: Optional[Union[str, "_models.KmsKeyVaultType"]] = None, ) -> None: ... @overload @@ -1620,6 +1702,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class NodePoolActiveVersion(_Model): + """NodePoolActiveVersion represents a version of a resource. + + :ivar version: The version of the resource. Specified in major.minor.patch, same as the input. + Required. + :vartype version: str + """ + + version: str = rest_field(visibility=["read"]) + """The version of the resource. Specified in major.minor.patch, same as the input. Required.""" + + class NodePoolAutoScaling(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Node pool autoscaling. @@ -1672,8 +1766,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class NodePoolPlatformProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure node pool platform configuration. - :ivar subnet_id: The Azure resource ID of the worker subnet Note that a subnet cannot be reused - between ARO-HCP Clusters, however the same subnet can be used for NodePools of the same + :ivar subnet_id: The Azure resource ID of the worker subnet. Note that a subnet cannot be + reused between ARO-HCP Clusters, however the same subnet can be used for NodePools of the same cluster. :vartype subnet_id: str :ivar vm_size: The VM size according to the documentation: @@ -1695,7 +1789,7 @@ class NodePoolPlatformProfile(_Model): # pylint: disable=docstring-keyword-shou """ subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read", "create"]) - """The Azure resource ID of the worker subnet Note that a subnet cannot be reused between ARO-HCP + """The Azure resource ID of the worker subnet. Note that a subnet cannot be reused between ARO-HCP Clusters, however the same subnet can be used for NodePools of the same cluster.""" vm_size: str = rest_field(name="vmSize", visibility=["read", "create"]) """The VM size according to the documentation: @@ -1753,12 +1847,17 @@ class NodePoolProperties(_Model): # pylint: disable=docstring-keyword-should-ma * Maximum: 200 (only when availabilityZone is not specified) * No maximum when availabilityZone is specified. :vartype replicas: int - :ivar auto_repair: Auto-repair. + :ivar auto_repair: autoRepair specifies whether health checks should be enabled for machines in + the NodePool. Enabling this feature will cause the controller to automatically delete unhealthy + machines. The unhealthy criteria are determined by checking the Node Ready condition and a + timeout that might vary depending on the platform provider. autoRepair will not take action + when more than 2 Nodes are unhealthy at the same time, giving time for the cluster to stabilize + or for the user to manually intervene. :vartype auto_repair: bool :ivar auto_scaling: Representation of a autoscaling in a node pool. :vartype auto_scaling: ~azure.mgmt.redhatopenshifthcp.models.NodePoolAutoScaling - :ivar labels: Kubernetes labels to propagate to the NodePool Nodes Note that when the labels - are updated this is only applied to newly create nodes in the Nodepool, existing node labels + :ivar labels: Kubernetes labels to propagate to the NodePool Nodes. Note that when the labels + are updated this is only applied to newly created nodes in the NodePool, existing node labels remain unchanged. :vartype labels: list[~azure.mgmt.redhatopenshifthcp.models.Label] :ivar taints: Taints for the nodes. @@ -1776,7 +1875,7 @@ class NodePoolProperties(_Model): # pylint: disable=docstring-keyword-should-ma If unset the cluster nodeDrainTimeoutMinutes value is used as a default. :vartype node_drain_timeout_minutes: int :ivar status: Status of the node pool resource. - :vartype status: ~azure.mgmt.redhatopenshifthcp.models.ResourceStatus + :vartype status: ~azure.mgmt.redhatopenshifthcp.models.NodePoolResourceStatus """ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -1795,14 +1894,20 @@ class NodePoolProperties(_Model): # pylint: disable=docstring-keyword-should-ma * Maximum: 200 (only when availabilityZone is not specified) * No maximum when availabilityZone is specified.""" auto_repair: Optional[bool] = rest_field(name="autoRepair", visibility=["read", "create"]) - """Auto-repair.""" + """autoRepair specifies whether health checks should be enabled for machines in the NodePool. + Enabling this feature will cause the controller to automatically delete unhealthy machines. The + unhealthy criteria are determined by checking the Node Ready condition and a timeout that might + vary depending on the platform provider. autoRepair will not take action when more than 2 Nodes + are unhealthy at the same time, giving time for the cluster to stabilize or for the user to + manually intervene.""" auto_scaling: Optional["_models.NodePoolAutoScaling"] = rest_field( name="autoScaling", visibility=["read", "create", "update"] ) """Representation of a autoscaling in a node pool.""" labels: Optional[list["_models.Label"]] = rest_field(visibility=["read", "create", "update"]) - """Kubernetes labels to propagate to the NodePool Nodes Note that when the labels are updated this - is only applied to newly create nodes in the Nodepool, existing node labels remain unchanged.""" + """Kubernetes labels to propagate to the NodePool Nodes. Note that when the labels are updated + this is only applied to newly created nodes in the NodePool, existing node labels remain + unchanged.""" taints: Optional[list["_models.Taint"]] = rest_field(visibility=["read", "create", "update"]) """Taints for the nodes.""" node_drain_timeout_minutes: Optional[int] = rest_field( @@ -1819,7 +1924,7 @@ class NodePoolProperties(_Model): # pylint: disable=docstring-keyword-should-ma 0 means that the NodePool can be drained without any time limitation. If unset the cluster nodeDrainTimeoutMinutes value is used as a default.""" - status: Optional["_models.ResourceStatus"] = rest_field(visibility=["read"]) + status: Optional["_models.NodePoolResourceStatus"] = rest_field(visibility=["read"]) """Status of the node pool resource.""" @overload @@ -1847,6 +1952,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class NodePoolResourceStatus(_Model): + """NodePoolResourceStatus represents the observed status of the nodepool resource. + + :ivar conditions: The conditions on the resource. + :vartype conditions: list[~azure.mgmt.redhatopenshifthcp.models.Condition] + :ivar active_versions: The observed active versions of the node pool. During upgrades, it is + common for multiple versions to be active at the same time while old nodes are drained and + replaced. The ordering of entries has no meaning. + :vartype active_versions: list[~azure.mgmt.redhatopenshifthcp.models.NodePoolActiveVersion] + """ + + conditions: Optional[list["_models.Condition"]] = rest_field(visibility=["read"]) + """The conditions on the resource.""" + active_versions: Optional[list["_models.NodePoolActiveVersion"]] = rest_field( + name="activeVersions", visibility=["read"] + ) + """The observed active versions of the node pool. During upgrades, it is common for multiple + versions to be active at the same time while old nodes are drained and replaced. The ordering + of entries has no meaning.""" + + class NodePoolVersionProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Versions represents an OpenShift version. @@ -1856,6 +1982,9 @@ class NodePoolVersionProfile(_Model): # pylint: disable=docstring-keyword-shoul Each version belongs to only a single set. If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after node pool creation is rejected. :vartype channel_group: str """ @@ -1865,7 +1994,10 @@ class NodePoolVersionProfile(_Model): # pylint: disable=docstring-keyword-shoul """ChannelGroup is the name of the set to which this version belongs. Each version belongs to only a single set. - If not specified, the default value is 'stable'.""" + If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after node pool creation is rejected.""" @overload def __init__( @@ -2138,7 +2270,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class PlatformProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure specific configuration. - :ivar managed_resource_group: Resource group name to put cluster resources + :ivar managed_resource_group: The name of the resource group to put cluster resources in. If not specified then a unique name is generated from the following pattern @@ -2149,8 +2281,8 @@ class PlatformProfile(_Model): # pylint: disable=docstring-keyword-should-match (up to 45 characters) followed by a 16-byte universally unique identifier per RFC 4122. :vartype managed_resource_group: str - :ivar subnet_id: The Azure resource ID of the worker subnet Note that a subnet cannot be reused - between ARO-HCP Clusters. Required. + :ivar subnet_id: The Azure resource ID of the worker subnet. Note that a subnet cannot be + reused between ARO-HCP Clusters. Required. :vartype subnet_id: str :ivar vnet_integration_subnet_id: The Azure resource ID of a subnet that enables direct, private network connectivity between the hosted control plane and your cluster's nodes. This @@ -2168,13 +2300,16 @@ class PlatformProfile(_Model): # pylint: disable=docstring-keyword-should-match authenticate to Azure. Required. :vartype operators_authentication: ~azure.mgmt.redhatopenshifthcp.models.OperatorsAuthenticationProfile + :ivar container_registry: Azure Container Registry configuration for authenticating image pulls + on the cluster's worker nodes. + :vartype container_registry: ~azure.mgmt.redhatopenshifthcp.models.ContainerRegistryProfile :ivar issuer_url: URL for the OIDC provider to be used for authentication to authenticate against user Azure cloud account. Required. :vartype issuer_url: str """ managed_resource_group: Optional[str] = rest_field(name="managedResourceGroup", visibility=["read", "create"]) - """Resource group name to put cluster resources + """The name of the resource group to put cluster resources in. If not specified then a unique name is generated from the following pattern @@ -2185,7 +2320,7 @@ class PlatformProfile(_Model): # pylint: disable=docstring-keyword-should-match (up to 45 characters) followed by a 16-byte universally unique identifier per RFC 4122.""" subnet_id: str = rest_field(name="subnetId", visibility=["read", "create"]) - """The Azure resource ID of the worker subnet Note that a subnet cannot be reused between ARO-HCP + """The Azure resource ID of the worker subnet. Note that a subnet cannot be reused between ARO-HCP Clusters. Required.""" vnet_integration_subnet_id: str = rest_field(name="vnetIntegrationSubnetId", visibility=["read", "create"]) """The Azure resource ID of a subnet that enables direct, private network connectivity between the @@ -2203,6 +2338,11 @@ class PlatformProfile(_Model): # pylint: disable=docstring-keyword-should-match name="operatorsAuthentication", visibility=["read", "create", "update"] ) """The configuration that the operators of the cluster have to authenticate to Azure. Required.""" + container_registry: Optional["_models.ContainerRegistryProfile"] = rest_field( + name="containerRegistry", visibility=["read", "create", "update"] + ) + """Azure Container Registry configuration for authenticating image pulls on the cluster's worker + nodes.""" issuer_url: str = rest_field(name="issuerUrl", visibility=["read"]) """URL for the OIDC provider to be used for authentication to authenticate against user Azure cloud account. Required.""" @@ -2217,6 +2357,7 @@ def __init__( operators_authentication: "_models.OperatorsAuthenticationProfile", managed_resource_group: Optional[str] = None, outbound_type: Optional[Union[str, "_models.OutboundType"]] = None, + container_registry: Optional["_models.ContainerRegistryProfile"] = None, ) -> None: ... @overload @@ -2230,17 +2371,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResourceStatus(_Model): - """ResourceStatus represents the observed status of the resource. - - :ivar conditions: The conditions on the resource. - :vartype conditions: list[~azure.mgmt.redhatopenshifthcp.models.Condition] - """ - - conditions: Optional[list["_models.Condition"]] = rest_field(visibility=["read"]) - """The conditions on the resource.""" - - class RoleDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A single role definition required by a given operator. @@ -2465,13 +2595,13 @@ class TokenIssuerProfile(_Model): # pylint: disable=docstring-keyword-should-ma issuerURL must use the 'https' scheme. Required. :vartype url: str - :ivar audiences: This configures the acceptable audiences the JWT token, issued by the identity - provider, must be issued to. At least one of the entries must match the - 'aud' claim in the JWT token. + :ivar audiences: This configures the acceptable audiences for JWT tokens issued by the identity + provider. + At least one of the entries must match the 'aud' claim in the JWT token. - audiences must contain at least one entry and must not exceed ten entries. Required. + Audiences must contain at least one entry and must not exceed ten entries. Required. :vartype audiences: list[str] - :ivar ca: The issuer of the token + :ivar ca: The issuer of the token. Certificate bundle to use to validate server certificates for the configured URL. It must be PEM encoded and when not specified, the system trust is used. @@ -2485,13 +2615,12 @@ class TokenIssuerProfile(_Model): # pylint: disable=docstring-keyword-should-ma issuerURL must use the 'https' scheme. Required.""" audiences: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """This configures the acceptable audiences the JWT token, issued by the identity - provider, must be issued to. At least one of the entries must match the - 'aud' claim in the JWT token. + """This configures the acceptable audiences for JWT tokens issued by the identity provider. + At least one of the entries must match the 'aud' claim in the JWT token. - audiences must contain at least one entry and must not exceed ten entries. Required.""" + Audiences must contain at least one entry and must not exceed ten entries. Required.""" ca: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The issuer of the token + """The issuer of the token. Certificate bundle to use to validate server certificates for the configured URL. It must be PEM encoded and when not specified, the system trust is used.""" @@ -2629,7 +2758,7 @@ class UsernameClaimProfile(_Model): # pylint: disable=docstring-keyword-should- :ivar claim: Claim name of the external profile. Required. :vartype claim: str - :ivar prefix: Prefix for the claim external profile Must be set when the prefixPolicy field is + :ivar prefix: Prefix for the claim external profile. Must be set when the prefixPolicy field is set to 'Prefix' and must be unset otherwise. :vartype prefix: str :ivar prefix_policy: Prefix policy is an optional field that configures how a prefix should be @@ -2659,7 +2788,7 @@ class UsernameClaimProfile(_Model): # pylint: disable=docstring-keyword-should- claim: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Claim name of the external profile. Required.""" prefix: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Prefix for the claim external profile Must be set when the prefixPolicy field is set to + """Prefix for the claim external profile. Must be set when the prefixPolicy field is set to 'Prefix' and must be unset otherwise.""" prefix_policy: Optional[Union[str, "_models.UsernameClaimPrefixPolicy"]] = rest_field( name="prefixPolicy", visibility=["read", "create", "update", "delete", "query"] @@ -2715,6 +2844,9 @@ class VersionProfile(_Model): # pylint: disable=docstring-keyword-should-match- Each version belongs to only a single set. If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after cluster creation is rejected. :vartype channel_group: str """ @@ -2724,7 +2856,10 @@ class VersionProfile(_Model): # pylint: disable=docstring-keyword-should-match- """ChannelGroup is the name of the set to which this version belongs. Each version belongs to only a single set. - If not specified, the default value is 'stable'.""" + If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after cluster creation is rejected.""" @overload def __init__( diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/operations/_operations.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/operations/_operations.py index 7508a3fc99ee..ce3d4a7cabf0 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/operations/_operations.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/operations/_operations.py @@ -50,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_hcp_open_shift_clusters_get_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_hcp_open_shift_clusters_create_or_update_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_hcp_open_shift_clusters_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +160,7 @@ def build_hcp_open_shift_clusters_delete_request( # pylint: disable=name-too-lo ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}" path_format_arguments = { @@ -183,7 +183,7 @@ def build_hcp_open_shift_clusters_list_by_resource_group_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +210,7 @@ def build_hcp_open_shift_clusters_list_by_subscription_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +237,7 @@ def build_hcp_open_shift_clusters_request_admin_credential_request( # pylint: d _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -266,7 +266,7 @@ def build_hcp_open_shift_clusters_revoke_credentials_request( # pylint: disable ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/revokeCredentials" path_format_arguments = { @@ -289,7 +289,7 @@ def build_node_pools_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +319,7 @@ def build_node_pools_create_or_update_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -351,7 +351,7 @@ def build_node_pools_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -381,7 +381,7 @@ def build_node_pools_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}" path_format_arguments = { @@ -405,7 +405,7 @@ def build_node_pools_list_by_parent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -437,7 +437,7 @@ def build_external_auths_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -471,7 +471,7 @@ def build_external_auths_create_or_update_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -507,7 +507,7 @@ def build_external_auths_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -541,7 +541,7 @@ def build_external_auths_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}" path_format_arguments = { @@ -565,7 +565,7 @@ def build_external_auths_list_by_parent_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -593,7 +593,7 @@ def build_hcp_open_shift_versions_get_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -621,7 +621,7 @@ def build_hcp_open_shift_versions_list_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -650,7 +650,7 @@ def build_hcp_operator_identity_role_sets_list_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -677,7 +677,7 @@ def build_hcp_operator_identity_role_sets_get_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1708,7 +1708,7 @@ def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-09-01-preview"], + api_versions_list=["2026-09-01-preview", "2026-10-01"], ) def _request_admin_credential_initial( self, @@ -1889,7 +1889,7 @@ def begin_request_admin_credential( "accept", ] }, - api_versions_list=["2026-09-01-preview"], + api_versions_list=["2026-09-01-preview", "2026-10-01"], ) def begin_request_admin_credential( self, diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/types.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/types.py index 847647db00aa..e31aefb9b01a 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/types.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/types.py @@ -24,6 +24,7 @@ ExternalAuthProvisioningState, IngressType, KeyVaultVisibility, + KmsKeyVaultType, ManagedServiceIdentityType, NetworkType, OsDiskType, @@ -58,16 +59,29 @@ class ApiProfile(TypedDict, total=False): """The list of authorized IPv4 CIDR blocks allowed to access the API server. Maximum 500 entries.""" +class ClusterActiveVersion(TypedDict, total=False): + """ClusterActiveVersion represents a version of a resource. + + :ivar version: The version of the resource. Specified in major.minor, same as the input. + Required. + :vartype version: str + """ + + version: Required[str] + """The version of the resource. Specified in major.minor, same as the input. Required.""" + + class ClusterAutoscalingProfile(TypedDict, total=False): """ClusterAutoscaling specifies auto-scaling behavior that applies to all NodePools associated with a control plane. - :ivar maxNodesTotal: maxNodesTotal is the maximum allowable number of nodes for the Autoscaler - scale out to be operational. The autoscaler will not grow the cluster beyond this number. If - omitted, the autoscaler will not have a maximum limit. + :ivar maxNodesTotal: maxNodesTotal is the maximum allowable number of nodes. The autoscaler + will not grow the cluster beyond this number. If omitted, the autoscaler will not have a + maximum limit. :vartype maxNodesTotal: int - :ivar maxPodGracePeriodSeconds: maxPodGracePeriod is the maximum seconds to wait for graceful - pod termination before scaling down a NodePool. The default is 600 seconds. + :ivar maxPodGracePeriodSeconds: maxPodGracePeriodSeconds is the maximum amount of time in + seconds to wait for graceful pod termination before scaling down a NodePool. The default is 600 + seconds. :vartype maxPodGracePeriodSeconds: int :ivar maxNodeProvisionTimeSeconds: maxNodeProvisionTimeSeconds is the maximum time to wait for node provisioning before considering the provisioning to be unsuccessful. The default is 900 @@ -82,12 +96,11 @@ class ClusterAutoscalingProfile(TypedDict, total=False): """ maxNodesTotal: int - """maxNodesTotal is the maximum allowable number of nodes for the Autoscaler scale out to be - operational. The autoscaler will not grow the cluster beyond this number. If omitted, the - autoscaler will not have a maximum limit.""" + """maxNodesTotal is the maximum allowable number of nodes. The autoscaler will not grow the + cluster beyond this number. If omitted, the autoscaler will not have a maximum limit.""" maxPodGracePeriodSeconds: int - """maxPodGracePeriod is the maximum seconds to wait for graceful pod termination before scaling - down a NodePool. The default is 600 seconds.""" + """maxPodGracePeriodSeconds is the maximum amount of time in seconds to wait for graceful pod + termination before scaling down a NodePool. The default is 600 seconds.""" maxNodeProvisionTimeSeconds: int """maxNodeProvisionTimeSeconds is the maximum time to wait for node provisioning before considering the provisioning to be unsuccessful. The default is 900 seconds, or 15 minutes.""" @@ -118,6 +131,25 @@ class ClusterImageRegistryProfile(TypedDict, total=False): default is Enabled. Known values are: \"Enabled\" and \"Disabled\".""" +class ClusterResourceStatus(TypedDict, total=False): + """ClusterResourceStatus represents the observed status of the cluster resource. + + :ivar conditions: The conditions on the resource. + :vartype conditions: list["Condition"] + :ivar activeVersions: The observed active versions of the cluster. During upgrades, both the + previous and target versions may be active simultaneously until the rollout completes, so this + array can contain more than one entry. The ordering of entries has no meaning. + :vartype activeVersions: list["ClusterActiveVersion"] + """ + + conditions: list["Condition"] + """The conditions on the resource.""" + activeVersions: list["ClusterActiveVersion"] + """The observed active versions of the cluster. During upgrades, both the previous and target + versions may be active simultaneously until the rollout completes, so this array can contain + more than one entry. The ordering of entries has no meaning.""" + + class Condition(TypedDict, total=False): """Condition represents an observation of a resource's state. @@ -164,6 +196,19 @@ class ConsoleProfile(TypedDict, total=False): """The cluster web console URL endpoint. Required.""" +class ContainerRegistryProfile(TypedDict, total=False): + """Azure Container Registry configuration for a cluster. Configures how worker nodes authenticate + container image pulls from Azure Container Registry (ACR). + + :ivar managedIdentity: The user-assigned managed identity used for container registry image + pulls. + :vartype managedIdentity: str + """ + + managedIdentity: str + """The user-assigned managed identity used for container registry image pulls.""" + + class CustomerManagedEncryptionProfile(TypedDict, total=False): """Customer managed encryption key profile. @@ -188,18 +233,17 @@ class DnsProfile(TypedDict, total=False): :ivar baseDomain: BaseDomain is the base DNS domain of the cluster. :vartype baseDomain: str - :ivar baseDomainPrefix: BaseDomainPrefix is the unique name of the cluster representing the - OpenShift's cluster name. BaseDomainPrefix is the name that will appear in the cluster's DNS, - provisioned cloud providers resources. + :ivar baseDomainPrefix: BaseDomainPrefix is the base domain prefix for the cluster ingress. It + will be used to configure ingress in the cluster through the subdomain + "BaseDomainPrefix.BaseDomain". :vartype baseDomainPrefix: str """ baseDomain: str """BaseDomain is the base DNS domain of the cluster.""" baseDomainPrefix: str - """BaseDomainPrefix is the unique name of the cluster representing the OpenShift's cluster name. - BaseDomainPrefix is the name that will appear in the cluster's DNS, provisioned cloud providers - resources.""" + """BaseDomainPrefix is the base domain prefix for the cluster ingress. It will be used to + configure ingress in the cluster through the subdomain \"BaseDomainPrefix.BaseDomain\".""" class EtcdDataEncryptionProfile(TypedDict, total=False): @@ -389,7 +433,7 @@ class ExternalAuthProperties(TypedDict, total=False): "Canceled", "Accepted", "Deleting", "Provisioning", "Updating", and "AwaitingSecret". :vartype provisioningState: Union[str, "ExternalAuthProvisioningState"] :ivar status: Status of the external auth resource. - :vartype status: "ResourceStatus" + :vartype status: "ExternalAuthResourceStatus" :ivar issuer: Token Issuer profile. Required. :vartype issuer: "TokenIssuerProfile" :ivar clients: External Auth OIDC clients There must not be more than 20 entries and entries @@ -403,7 +447,7 @@ class ExternalAuthProperties(TypedDict, total=False): provisioningState: Union[str, "ExternalAuthProvisioningState"] """Provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", \"Deleting\", \"Provisioning\", \"Updating\", and \"AwaitingSecret\".""" - status: "ResourceStatus" + status: "ExternalAuthResourceStatus" """Status of the external auth resource.""" issuer: Required["TokenIssuerProfile"] """Token Issuer profile. Required.""" @@ -414,6 +458,17 @@ class ExternalAuthProperties(TypedDict, total=False): """External Auth claim This configures how claims are validated and applied. Required.""" +class ExternalAuthResourceStatus(TypedDict, total=False): + """ExternalAuthResourceStatus represents the observed status of the external auth resource. + + :ivar conditions: The conditions on the resource. + :vartype conditions: list["Condition"] + """ + + conditions: list["Condition"] + """The conditions on the resource.""" + + class GroupClaimProfile(TypedDict, total=False): """External Auth claim profile This configures how the groups of a cluster identity should be constructed @@ -426,7 +481,7 @@ class GroupClaimProfile(TypedDict, total=False): :ivar claim: Claim name of the external profile. Required. :vartype claim: str - :ivar prefix: Prefix for the claim external profile If this is specified prefixPolicy will be + :ivar prefix: Prefix for the claim external profile. If this is specified, prefixPolicy will be set to "Prefix" by default. :vartype prefix: str """ @@ -434,7 +489,7 @@ class GroupClaimProfile(TypedDict, total=False): claim: Required[str] """Claim name of the external profile. Required.""" prefix: str - """Prefix for the claim external profile If this is specified prefixPolicy will be set to + """Prefix for the claim external profile. If this is specified, prefixPolicy will be set to \"Prefix\" by default.""" @@ -544,13 +599,13 @@ class HcpOpenShiftClusterProperties(TypedDict, total=False): Valid values are in minutes and from 0 to 10080 minutes (1 week). 0 means that the MachinePool can be drained without any time limitation. - This is the value is used a default for all NodePools. It can be overridden + This value is used as a default for all NodePools. It can be overridden by specifying nodeDrainTimeoutMinutes for a given NodePool. :vartype nodeDrainTimeoutMinutes: int :ivar clusterImageRegistry: OpenShift internal image registry. :vartype clusterImageRegistry: "ClusterImageRegistryProfile" :ivar status: Status of the cluster resource. - :vartype status: "ResourceStatus" + :vartype status: "ClusterResourceStatus" :ivar cryptoRestrictions: Cryptographic restrictions for kernel and userspace libraries. Known values are: "None" and "FIPS". :vartype cryptoRestrictions: Union[str, "CryptoRestrictions"] @@ -593,11 +648,11 @@ class HcpOpenShiftClusterProperties(TypedDict, total=False): Valid values are in minutes and from 0 to 10080 minutes (1 week). 0 means that the MachinePool can be drained without any time limitation. - This is the value is used a default for all NodePools. It can be overridden + This value is used as a default for all NodePools. It can be overridden by specifying nodeDrainTimeoutMinutes for a given NodePool.""" clusterImageRegistry: "ClusterImageRegistryProfile" """OpenShift internal image registry.""" - status: "ResourceStatus" + status: "ClusterResourceStatus" """Status of the cluster resource.""" cryptoRestrictions: Union[str, "CryptoRestrictions"] """Cryptographic restrictions for kernel and userspace libraries. Known values are: \"None\" and @@ -714,6 +769,9 @@ class KmsEncryptionProfile(TypedDict, total=False): :vartype visibility: Union[str, "KeyVaultVisibility"] :ivar activeKey: The details of the active key. Required. :vartype activeKey: "KmsKey" + :ivar keyVaultType: The type of keyvault used for KMS encryption. Defaults to KeyVault when + absent. Known values are: "KeyVault" and "ManagedHSM". + :vartype keyVaultType: Union[str, "KmsKeyVaultType"] """ vaultName: Required[str] @@ -723,6 +781,9 @@ class KmsEncryptionProfile(TypedDict, total=False): \"Private\".""" activeKey: Required["KmsKey"] """The details of the active key. Required.""" + keyVaultType: Union[str, "KmsKeyVaultType"] + """The type of keyvault used for KMS encryption. Defaults to KeyVault when absent. Known values + are: \"KeyVault\" and \"ManagedHSM\".""" class KmsKey(TypedDict, total=False): @@ -844,6 +905,18 @@ class NodePool(TrackedResource): """The managed service identities assigned to this resource.""" +class NodePoolActiveVersion(TypedDict, total=False): + """NodePoolActiveVersion represents a version of a resource. + + :ivar version: The version of the resource. Specified in major.minor.patch, same as the input. + Required. + :vartype version: str + """ + + version: Required[str] + """The version of the resource. Specified in major.minor.patch, same as the input. Required.""" + + class NodePoolAutoScaling(TypedDict, total=False): """Node pool autoscaling. @@ -878,7 +951,7 @@ class NodePoolAutoScaling(TypedDict, total=False): class NodePoolPlatformProfile(TypedDict, total=False): """Azure node pool platform configuration. - :ivar subnetId: The Azure resource ID of the worker subnet Note that a subnet cannot be reused + :ivar subnetId: The Azure resource ID of the worker subnet. Note that a subnet cannot be reused between ARO-HCP Clusters, however the same subnet can be used for NodePools of the same cluster. :vartype subnetId: str @@ -901,7 +974,7 @@ class NodePoolPlatformProfile(TypedDict, total=False): """ subnetId: str - """The Azure resource ID of the worker subnet Note that a subnet cannot be reused between ARO-HCP + """The Azure resource ID of the worker subnet. Note that a subnet cannot be reused between ARO-HCP Clusters, however the same subnet can be used for NodePools of the same cluster.""" vmSize: Required[str] """The VM size according to the documentation: @@ -938,12 +1011,17 @@ class NodePoolProperties(TypedDict, total=False): * Maximum: 200 (only when availabilityZone is not specified) * No maximum when availabilityZone is specified. :vartype replicas: int - :ivar autoRepair: Auto-repair. + :ivar autoRepair: autoRepair specifies whether health checks should be enabled for machines in + the NodePool. Enabling this feature will cause the controller to automatically delete unhealthy + machines. The unhealthy criteria are determined by checking the Node Ready condition and a + timeout that might vary depending on the platform provider. autoRepair will not take action + when more than 2 Nodes are unhealthy at the same time, giving time for the cluster to stabilize + or for the user to manually intervene. :vartype autoRepair: bool :ivar autoScaling: Representation of a autoscaling in a node pool. :vartype autoScaling: "NodePoolAutoScaling" - :ivar labels: Kubernetes labels to propagate to the NodePool Nodes Note that when the labels - are updated this is only applied to newly create nodes in the Nodepool, existing node labels + :ivar labels: Kubernetes labels to propagate to the NodePool Nodes. Note that when the labels + are updated this is only applied to newly created nodes in the NodePool, existing node labels remain unchanged. :vartype labels: list["Label"] :ivar taints: Taints for the nodes. @@ -961,7 +1039,7 @@ class NodePoolProperties(TypedDict, total=False): If unset the cluster nodeDrainTimeoutMinutes value is used as a default. :vartype nodeDrainTimeoutMinutes: int :ivar status: Status of the node pool resource. - :vartype status: "ResourceStatus" + :vartype status: "NodePoolResourceStatus" """ provisioningState: Union[str, "ProvisioningState"] @@ -978,12 +1056,18 @@ class NodePoolProperties(TypedDict, total=False): * Maximum: 200 (only when availabilityZone is not specified) * No maximum when availabilityZone is specified.""" autoRepair: bool - """Auto-repair.""" + """autoRepair specifies whether health checks should be enabled for machines in the NodePool. + Enabling this feature will cause the controller to automatically delete unhealthy machines. The + unhealthy criteria are determined by checking the Node Ready condition and a timeout that might + vary depending on the platform provider. autoRepair will not take action when more than 2 Nodes + are unhealthy at the same time, giving time for the cluster to stabilize or for the user to + manually intervene.""" autoScaling: "NodePoolAutoScaling" """Representation of a autoscaling in a node pool.""" labels: list["Label"] - """Kubernetes labels to propagate to the NodePool Nodes Note that when the labels are updated this - is only applied to newly create nodes in the Nodepool, existing node labels remain unchanged.""" + """Kubernetes labels to propagate to the NodePool Nodes. Note that when the labels are updated + this is only applied to newly created nodes in the NodePool, existing node labels remain + unchanged.""" taints: list["Taint"] """Taints for the nodes.""" nodeDrainTimeoutMinutes: int @@ -998,10 +1082,29 @@ class NodePoolProperties(TypedDict, total=False): 0 means that the NodePool can be drained without any time limitation. If unset the cluster nodeDrainTimeoutMinutes value is used as a default.""" - status: "ResourceStatus" + status: "NodePoolResourceStatus" """Status of the node pool resource.""" +class NodePoolResourceStatus(TypedDict, total=False): + """NodePoolResourceStatus represents the observed status of the nodepool resource. + + :ivar conditions: The conditions on the resource. + :vartype conditions: list["Condition"] + :ivar activeVersions: The observed active versions of the node pool. During upgrades, it is + common for multiple versions to be active at the same time while old nodes are drained and + replaced. The ordering of entries has no meaning. + :vartype activeVersions: list["NodePoolActiveVersion"] + """ + + conditions: list["Condition"] + """The conditions on the resource.""" + activeVersions: list["NodePoolActiveVersion"] + """The observed active versions of the node pool. During upgrades, it is common for multiple + versions to be active at the same time while old nodes are drained and replaced. The ordering + of entries has no meaning.""" + + class NodePoolVersionProfile(TypedDict, total=False): """Versions represents an OpenShift version. @@ -1011,6 +1114,9 @@ class NodePoolVersionProfile(TypedDict, total=False): Each version belongs to only a single set. If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after node pool creation is rejected. :vartype channelGroup: str """ @@ -1020,7 +1126,10 @@ class NodePoolVersionProfile(TypedDict, total=False): """ChannelGroup is the name of the set to which this version belongs. Each version belongs to only a single set. - If not specified, the default value is 'stable'.""" + If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after node pool creation is rejected.""" class OperatorsAuthenticationProfile(TypedDict, total=False): @@ -1098,7 +1207,7 @@ class OsDiskProfile(TypedDict, total=False): class PlatformProfile(TypedDict, total=False): """Azure specific configuration. - :ivar managedResourceGroup: Resource group name to put cluster resources + :ivar managedResourceGroup: The name of the resource group to put cluster resources in. If not specified then a unique name is generated from the following pattern @@ -1109,7 +1218,7 @@ class PlatformProfile(TypedDict, total=False): (up to 45 characters) followed by a 16-byte universally unique identifier per RFC 4122. :vartype managedResourceGroup: str - :ivar subnetId: The Azure resource ID of the worker subnet Note that a subnet cannot be reused + :ivar subnetId: The Azure resource ID of the worker subnet. Note that a subnet cannot be reused between ARO-HCP Clusters. Required. :vartype subnetId: str :ivar vnetIntegrationSubnetId: The Azure resource ID of a subnet that enables direct, private @@ -1127,13 +1236,16 @@ class PlatformProfile(TypedDict, total=False): :ivar operatorsAuthentication: The configuration that the operators of the cluster have to authenticate to Azure. Required. :vartype operatorsAuthentication: "OperatorsAuthenticationProfile" + :ivar containerRegistry: Azure Container Registry configuration for authenticating image pulls + on the cluster's worker nodes. + :vartype containerRegistry: "ContainerRegistryProfile" :ivar issuerUrl: URL for the OIDC provider to be used for authentication to authenticate against user Azure cloud account. Required. :vartype issuerUrl: str """ managedResourceGroup: str - """Resource group name to put cluster resources + """The name of the resource group to put cluster resources in. If not specified then a unique name is generated from the following pattern @@ -1144,7 +1256,7 @@ class PlatformProfile(TypedDict, total=False): (up to 45 characters) followed by a 16-byte universally unique identifier per RFC 4122.""" subnetId: Required[str] - """The Azure resource ID of the worker subnet Note that a subnet cannot be reused between ARO-HCP + """The Azure resource ID of the worker subnet. Note that a subnet cannot be reused between ARO-HCP Clusters. Required.""" vnetIntegrationSubnetId: Required[str] """The Azure resource ID of a subnet that enables direct, private network connectivity between the @@ -1158,22 +1270,14 @@ class PlatformProfile(TypedDict, total=False): Note that NSGs cannot be reused for other ARO-HCP clusters. Required.""" operatorsAuthentication: Required["OperatorsAuthenticationProfile"] """The configuration that the operators of the cluster have to authenticate to Azure. Required.""" + containerRegistry: "ContainerRegistryProfile" + """Azure Container Registry configuration for authenticating image pulls on the cluster's worker + nodes.""" issuerUrl: Required[str] """URL for the OIDC provider to be used for authentication to authenticate against user Azure cloud account. Required.""" -class ResourceStatus(TypedDict, total=False): - """ResourceStatus represents the observed status of the resource. - - :ivar conditions: The conditions on the resource. - :vartype conditions: list["Condition"] - """ - - conditions: list["Condition"] - """The conditions on the resource.""" - - class SystemData(TypedDict, total=False): """Metadata pertaining to creation and last modification of the resource. @@ -1272,13 +1376,13 @@ class TokenIssuerProfile(TypedDict, total=False): issuerURL must use the 'https' scheme. Required. :vartype url: str - :ivar audiences: This configures the acceptable audiences the JWT token, issued by the identity - provider, must be issued to. At least one of the entries must match the - 'aud' claim in the JWT token. + :ivar audiences: This configures the acceptable audiences for JWT tokens issued by the identity + provider. + At least one of the entries must match the 'aud' claim in the JWT token. - audiences must contain at least one entry and must not exceed ten entries. Required. + Audiences must contain at least one entry and must not exceed ten entries. Required. :vartype audiences: list[str] - :ivar ca: The issuer of the token + :ivar ca: The issuer of the token. Certificate bundle to use to validate server certificates for the configured URL. It must be PEM encoded and when not specified, the system trust is used. @@ -1292,13 +1396,12 @@ class TokenIssuerProfile(TypedDict, total=False): issuerURL must use the 'https' scheme. Required.""" audiences: Required[list[str]] - """This configures the acceptable audiences the JWT token, issued by the identity - provider, must be issued to. At least one of the entries must match the - 'aud' claim in the JWT token. + """This configures the acceptable audiences for JWT tokens issued by the identity provider. + At least one of the entries must match the 'aud' claim in the JWT token. - audiences must contain at least one entry and must not exceed ten entries. Required.""" + Audiences must contain at least one entry and must not exceed ten entries. Required.""" ca: str - """The issuer of the token + """The issuer of the token. Certificate bundle to use to validate server certificates for the configured URL. It must be PEM encoded and when not specified, the system trust is used.""" @@ -1376,7 +1479,7 @@ class UsernameClaimProfile(TypedDict, total=False): :ivar claim: Claim name of the external profile. Required. :vartype claim: str - :ivar prefix: Prefix for the claim external profile Must be set when the prefixPolicy field is + :ivar prefix: Prefix for the claim external profile. Must be set when the prefixPolicy field is set to 'Prefix' and must be unset otherwise. :vartype prefix: str :ivar prefixPolicy: Prefix policy is an optional field that configures how a prefix should be @@ -1406,7 +1509,7 @@ class UsernameClaimProfile(TypedDict, total=False): claim: Required[str] """Claim name of the external profile. Required.""" prefix: str - """Prefix for the claim external profile Must be set when the prefixPolicy field is set to + """Prefix for the claim external profile. Must be set when the prefixPolicy field is set to 'Prefix' and must be unset otherwise.""" prefixPolicy: Union[str, "UsernameClaimPrefixPolicy"] """Prefix policy is an optional field that configures how a prefix should be @@ -1441,6 +1544,9 @@ class VersionProfile(TypedDict, total=False): Each version belongs to only a single set. If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after cluster creation is rejected. :vartype channelGroup: str """ @@ -1450,4 +1556,7 @@ class VersionProfile(TypedDict, total=False): """ChannelGroup is the name of the set to which this version belongs. Each version belongs to only a single set. - If not specified, the default value is 'stable'.""" + If not specified, the default value is 'stable'. + + This property is intended to be updateable, but that support is not yet + complete. Until then, changing this value after cluster creation is rejected.""" diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_create_or_update_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_create_or_update_maximum_set_gen.py index 9542bbf95b51..21b36565e467 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_create_or_update_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_create_or_update_maximum_set_gen.py @@ -75,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/ExternalAuths_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/ExternalAuths_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_delete_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_delete_maximum_set_gen.py index ba89f441187f..878bf1ebe3a6 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_delete_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-01-preview/ExternalAuths_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/ExternalAuths_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_get_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_get_maximum_set_gen.py index b3d5c93945ef..d7564c2ec06c 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_get_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/ExternalAuths_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/ExternalAuths_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_list_by_parent_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_list_by_parent_maximum_set_gen.py index e84a953e2e95..b8bb6d7976d2 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_list_by_parent_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_list_by_parent_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/ExternalAuths_ListByParent_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/ExternalAuths_ListByParent_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_update_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_update_maximum_set_gen.py index c8e00e71310e..f120d65f6060 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_update_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/external_auths_update_maximum_set_gen.py @@ -75,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/ExternalAuths_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/ExternalAuths_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_create_or_update_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_create_or_update_maximum_set_gen.py index bf6239ad69b1..b3f25f12c715 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_create_or_update_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_create_or_update_maximum_set_gen.py @@ -105,6 +105,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_delete_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_delete_maximum_set_gen.py index 4db43a199870..32d97493bea1 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_delete_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_get_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_get_maximum_set_gen.py index 93cc9069ebd3..0f5c44c550ba 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_get_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_resource_group_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_resource_group_maximum_set_gen.py index 9a4f11382b39..e30b729dce99 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_resource_group_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_resource_group_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_subscription_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_subscription_maximum_set_gen.py index 4a70698c5e12..709db94fba1f 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_subscription_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_list_by_subscription_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_request_admin_credential_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_request_admin_credential_maximum_set_gen.py index b1213c739542..3ed17a2abe0a 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_request_admin_credential_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_request_admin_credential_maximum_set_gen.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_RequestAdminCredential_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_RequestAdminCredential_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_revoke_credentials_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_revoke_credentials_maximum_set_gen.py index ab9c1c08a1c8..cac4d3ce047d 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_revoke_credentials_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_revoke_credentials_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_RevokeCredentials_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_RevokeCredentials_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_update_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_update_maximum_set_gen.py index 7ffe9bccdb47..e22d4c51f0c9 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_update_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_clusters_update_maximum_set_gen.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftClusters_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftClusters_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_get_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_get_maximum_set_gen.py index bdabf4dbab69..92f5c1c068d6 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_get_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftVersions_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftVersions_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_list_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_list_maximum_set_gen.py index 8c155f41fcc7..2a5aeec7ad3c 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_list_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_open_shift_versions_list_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/HcpOpenShiftVersions_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOpenShiftVersions_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_get_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_get_maximum_set_gen.py index 97bcf184f162..764c5093e6fe 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_get_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/HcpOperatorIdentityRoleSets_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOperatorIdentityRoleSets_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_list_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_list_maximum_set_gen.py index 2b1f42044304..471699ce86ed 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_list_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/hcp_operator_identity_role_sets_list_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/HcpOperatorIdentityRoleSets_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/HcpOperatorIdentityRoleSets_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_create_or_update_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_create_or_update_maximum_set_gen.py index afe2f606fd2f..128465aed008 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_create_or_update_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_create_or_update_maximum_set_gen.py @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/NodePools_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/NodePools_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_delete_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_delete_maximum_set_gen.py index ab301d1974a1..d42f9c23135a 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_delete_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-01-preview/NodePools_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/NodePools_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_get_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_get_maximum_set_gen.py index 58a25c4bf37e..e317e43b7ddf 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_get_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/NodePools_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/NodePools_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_list_by_parent_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_list_by_parent_maximum_set_gen.py index 26c5b3dbf9c0..7be291bf6f34 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_list_by_parent_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_list_by_parent_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/NodePools_ListByParent_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/NodePools_ListByParent_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_update_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_update_maximum_set_gen.py index 4cbebb293d0b..c363f93a54f3 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_update_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/node_pools_update_maximum_set_gen.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-01-preview/NodePools_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/NodePools_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_maximum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_maximum_set_gen.py index 14784a631f3a..91dc3c71374e 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-10-01/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_minimum_set_gen.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_minimum_set_gen.py index 0c25ebca9e93..d89521bb6b1a 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_minimum_set_gen.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_samples/operations_list_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-01-preview/Operations_List_MinimumSet_Gen.json +# x-ms-original-file: 2026-10-01/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations.py index bd7e21720ca6..1a0963ea4d7e 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations.py @@ -58,6 +58,7 @@ def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_group): }, "subnetId": "str", "vnetIntegrationSubnetId": "str", + "containerRegistry": {"managedIdentity": "str"}, "managedResourceGroup": "str", "outboundType": "str", }, @@ -82,6 +83,7 @@ def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_group): "activeKey": {"name": "str", "version": "str"}, "vaultName": "str", "visibility": "str", + "keyVaultType": "str", }, }, } @@ -98,6 +100,7 @@ def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_group): "nodeDrainTimeoutMinutes": 0, "provisioningState": "str", "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -106,7 +109,7 @@ def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, }, "systemData": { @@ -154,6 +157,7 @@ def test_hcp_open_shift_clusters_begin_update(self, resource_group): }, "subnetId": "str", "vnetIntegrationSubnetId": "str", + "containerRegistry": {"managedIdentity": "str"}, "managedResourceGroup": "str", "outboundType": "str", }, @@ -178,6 +182,7 @@ def test_hcp_open_shift_clusters_begin_update(self, resource_group): "activeKey": {"name": "str", "version": "str"}, "vaultName": "str", "visibility": "str", + "keyVaultType": "str", }, }, } @@ -194,6 +199,7 @@ def test_hcp_open_shift_clusters_begin_update(self, resource_group): "nodeDrainTimeoutMinutes": 0, "provisioningState": "str", "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -202,7 +208,7 @@ def test_hcp_open_shift_clusters_begin_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, }, "systemData": { diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations_async.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations_async.py index da950a7cc94d..1c5843fb94cc 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations_async.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_hcp_open_shift_clusters_operations_async.py @@ -60,6 +60,7 @@ async def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_gro }, "subnetId": "str", "vnetIntegrationSubnetId": "str", + "containerRegistry": {"managedIdentity": "str"}, "managedResourceGroup": "str", "outboundType": "str", }, @@ -84,6 +85,7 @@ async def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_gro "activeKey": {"name": "str", "version": "str"}, "vaultName": "str", "visibility": "str", + "keyVaultType": "str", }, }, } @@ -100,6 +102,7 @@ async def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_gro "nodeDrainTimeoutMinutes": 0, "provisioningState": "str", "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -108,7 +111,7 @@ async def test_hcp_open_shift_clusters_begin_create_or_update(self, resource_gro "status": "str", "type": "str", } - ] + ], }, }, "systemData": { @@ -158,6 +161,7 @@ async def test_hcp_open_shift_clusters_begin_update(self, resource_group): }, "subnetId": "str", "vnetIntegrationSubnetId": "str", + "containerRegistry": {"managedIdentity": "str"}, "managedResourceGroup": "str", "outboundType": "str", }, @@ -182,6 +186,7 @@ async def test_hcp_open_shift_clusters_begin_update(self, resource_group): "activeKey": {"name": "str", "version": "str"}, "vaultName": "str", "visibility": "str", + "keyVaultType": "str", }, }, } @@ -198,6 +203,7 @@ async def test_hcp_open_shift_clusters_begin_update(self, resource_group): "nodeDrainTimeoutMinutes": 0, "provisioningState": "str", "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -206,7 +212,7 @@ async def test_hcp_open_shift_clusters_begin_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, }, "systemData": { diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations.py index b51504c6fc45..d8a73a55f273 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations.py @@ -67,6 +67,7 @@ def test_node_pools_begin_create_or_update(self, resource_group): "provisioningState": "str", "replicas": 0, "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -75,7 +76,7 @@ def test_node_pools_begin_create_or_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, "taints": [{"effect": "str", "key": "str", "value": "str"}], "version": {"id": "str", "channelGroup": "str"}, @@ -133,6 +134,7 @@ def test_node_pools_begin_update(self, resource_group): "provisioningState": "str", "replicas": 0, "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -141,7 +143,7 @@ def test_node_pools_begin_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, "taints": [{"effect": "str", "key": "str", "value": "str"}], "version": {"id": "str", "channelGroup": "str"}, diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations_async.py b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations_async.py index 5da807ae2250..9d72f009a619 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations_async.py +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/generated_tests/test_red_hat_open_shift_hcp_mgmt_node_pools_operations_async.py @@ -69,6 +69,7 @@ async def test_node_pools_begin_create_or_update(self, resource_group): "provisioningState": "str", "replicas": 0, "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -77,7 +78,7 @@ async def test_node_pools_begin_create_or_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, "taints": [{"effect": "str", "key": "str", "value": "str"}], "version": {"id": "str", "channelGroup": "str"}, @@ -137,6 +138,7 @@ async def test_node_pools_begin_update(self, resource_group): "provisioningState": "str", "replicas": 0, "status": { + "activeVersions": [{"version": "str"}], "conditions": [ { "lastTransitionTime": "2020-02-20 00:00:00", @@ -145,7 +147,7 @@ async def test_node_pools_begin_update(self, resource_group): "status": "str", "type": "str", } - ] + ], }, "taints": [{"effect": "str", "key": "str", "value": "str"}], "version": {"id": "str", "channelGroup": "str"}, diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/pyproject.toml b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/pyproject.toml index 29925c8ef466..b3af016c06b2 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/pyproject.toml +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Redhatopenshifthcp Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -77,7 +77,7 @@ package_name = "azure-mgmt-redhatopenshifthcp" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Redhatopenshifthcp Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/tsp-location.yaml b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/tsp-location.yaml index 5e37766f9ab7..a330ec64adde 100644 --- a/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/tsp-location.yaml +++ b/sdk/redhatopenshifthcp/azure-mgmt-redhatopenshifthcp/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/hcpopenshiftclusters -commit: 635384bb61bd0ec32bbc5b8787ad49777effd903 +commit: a2de2d1a53d195c987a30184b2ddd378417ff44e repo: Azure/azure-rest-api-specs additionalDirectories: From 0131b83c1c636a42197e42f29f4f77888650e3cc Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 10:36:38 -0400 Subject: [PATCH 32/35] [AutoPR azure-mgmt-datatransfer]-generated-from-SDK Generation - Python-6971921 (#49564) * Configurations: 'specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/AzureDataTransfer/tspconfig.yaml', API Version: 2026-02-06-preview, SDK Release Type: beta, and CommitSHA: 'd218330c5a3b727df9504ba852e97259479e8fef' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6962950 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Configurations: 'specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/AzureDataTransfer/tspconfig.yaml', API Version: 2026-02-06-preview, SDK Release Type: beta, and CommitSHA: '9969c2f086105356220a370bb316291fd26d87af' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6971921 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: azure-sdk --- .../azure-mgmt-datatransfer/CHANGELOG.md | 7 + .../azure-mgmt-datatransfer/LICENSE | 21 + .../azure-mgmt-datatransfer/MANIFEST.in | 7 + .../azure-mgmt-datatransfer/README.md | 61 + .../azure-mgmt-datatransfer/_metadata.json | 11 + .../azure-mgmt-datatransfer/api.md | 4283 ++++++++ .../azure-mgmt-datatransfer/api.metadata.yml | 4 + .../apiview-properties.json | 204 + .../azure-mgmt-datatransfer/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/datatransfer/__init__.py | 32 + .../azure/mgmt/datatransfer/_client.py | 164 + .../azure/mgmt/datatransfer/_configuration.py | 82 + .../azure/mgmt/datatransfer/_patch.py | 20 + .../mgmt/datatransfer/_utils/__init__.py | 6 + .../mgmt/datatransfer/_utils/model_base.py | 1805 ++++ .../mgmt/datatransfer/_utils/serialization.py | 2179 ++++ .../azure/mgmt/datatransfer/_validation.py | 66 + .../azure/mgmt/datatransfer/_version.py | 9 + .../azure/mgmt/datatransfer/aio/__init__.py | 29 + .../azure/mgmt/datatransfer/aio/_client.py | 169 + .../mgmt/datatransfer/aio/_configuration.py | 82 + .../azure/mgmt/datatransfer/aio/_patch.py | 20 + .../datatransfer/aio/operations/__init__.py | 35 + .../aio/operations/_operations.py | 7687 ++++++++++++++ .../datatransfer/aio/operations/_patch.py | 20 + .../mgmt/datatransfer/models/__init__.py | 236 + .../azure/mgmt/datatransfer/models/_enums.py | 404 + .../azure/mgmt/datatransfer/models/_models.py | 3806 +++++++ .../azure/mgmt/datatransfer/models/_patch.py | 20 + .../mgmt/datatransfer/operations/__init__.py | 35 + .../datatransfer/operations/_operations.py | 8942 +++++++++++++++++ .../mgmt/datatransfer/operations/_patch.py | 20 + .../azure/mgmt/datatransfer/py.typed | 1 + .../azure/mgmt/datatransfer/types.py | 1573 +++ .../dev_requirements.txt | 5 + .../generated_samples/approve_connection.py | 47 + ...sfer_list_flow_profiles_maximum_set_gen.py | 41 + ...re_data_transfer_list_pipeline_metadata.py | 41 + .../create_or_update_connection.py | 68 + .../create_or_update_flow.py | 63 + .../create_or_update_flow_profile.py | 77 + .../create_or_update_pipeline.py | 43 + .../generated_samples/delete_connection.py | 41 + .../generated_samples/delete_flow.py | 42 + .../generated_samples/delete_flow_profile.py | 42 + .../generated_samples/delete_pipeline.py | 41 + .../generated_samples/disable_flow.py | 43 + .../generated_samples/enable_flow.py | 43 + .../generated_samples/execute_action.py | 50 + .../generate_flow_passphrase.py | 43 + .../generated_samples/get_connection.py | 42 + .../generated_samples/get_flow.py | 43 + .../get_flow_destination_endpoint_ports.py | 43 + .../get_flow_destination_endpoints.py | 43 + .../generated_samples/get_flow_profile.py | 43 + .../get_flow_source_addresses.py | 43 + .../generated_samples/get_pipeline.py | 42 + .../get_stream_connection_string.py | 43 + .../generated_samples/link_connection.py | 46 + .../generated_samples/link_flow.py | 47 + .../list_connections_by_resource_group.py | 42 + .../list_connections_by_subscription.py | 40 + .../list_flow_profiles_by_pipeline.py | 43 + .../list_flows_by_connection.py | 43 + .../list_flows_by_pipeline.py | 42 + .../generated_samples/list_operations.py | 40 + .../list_pending_connections.py | 43 + .../generated_samples/list_pending_flows.py | 43 + .../list_pipelines_by_resource_group.py | 42 + .../list_pipelines_by_subscription.py | 40 + .../generated_samples/list_schemas.py | 47 + .../generated_samples/patch_connection.py | 50 + .../generated_samples/patch_flow.py | 52 + .../generated_samples/patch_flow_profile.py | 70 + .../generated_samples/patch_pipeline.py | 51 + .../post_list_approved_schemas.py | 41 + .../generated_samples/post_validate_schema.py | 41 + .../generated_samples/reject_connection.py | 47 + .../set_flow_destination_endpoint_ports.py | 44 + .../set_flow_destination_endpoints.py | 44 + .../generated_samples/set_flow_passphrase.py | 44 + .../set_flow_source_addresses.py | 44 + .../generated_tests/conftest.py | 35 + ...fer_mgmt_azure_data_transfer_operations.py | 68 + ...mt_azure_data_transfer_operations_async.py | 69 + ...ta_transfer_mgmt_connections_operations.py | 189 + ...nsfer_mgmt_connections_operations_async.py | 198 + ..._transfer_mgmt_flow_profiles_operations.py | 146 + ...fer_mgmt_flow_profiles_operations_async.py | 153 + ...est_data_transfer_mgmt_flows_operations.py | 343 + ...ta_transfer_mgmt_flows_operations_async.py | 372 + .../test_data_transfer_mgmt_operations.py | 27 + ...est_data_transfer_mgmt_operations_async.py | 28 + ...data_transfer_mgmt_pipelines_operations.py | 216 + ...ransfer_mgmt_pipelines_operations_async.py | 229 + .../azure-mgmt-datatransfer/pyproject.toml | 86 + .../azure-mgmt-datatransfer/tsp-location.yaml | 4 + sdk/azuredatatransfer/ci.yml | 34 + 99 files changed, 36397 insertions(+) create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/CHANGELOG.md create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/LICENSE create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/MANIFEST.in create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/README.md create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/_metadata.json create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/api.md create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/api.metadata.yml create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/apiview-properties.json create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_client.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_configuration.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_patch.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/model_base.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/serialization.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_validation.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_version.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_client.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_configuration.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_patch.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_patch.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_enums.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_models.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_patch.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/__init__.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_patch.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/py.typed create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/types.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/dev_requirements.txt create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/approve_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_flow_profiles_maximum_set_gen.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_pipeline_metadata.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow_profile.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_pipeline.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow_profile.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_pipeline.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/disable_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/enable_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/execute_action.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/generate_flow_passphrase.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoint_ports.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoints.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_profile.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_source_addresses.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_pipeline.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_stream_connection_string.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_resource_group.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_subscription.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flow_profiles_by_pipeline.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_pipeline.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_connections.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_flows.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_resource_group.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_subscription.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_schemas.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow_profile.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_pipeline.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_list_approved_schemas.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_validate_schema.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/reject_connection.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoint_ports.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoints.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_passphrase.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_source_addresses.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/conftest.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations_async.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations_async.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations_async.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations_async.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations_async.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations_async.py create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/pyproject.toml create mode 100644 sdk/azuredatatransfer/azure-mgmt-datatransfer/tsp-location.yaml create mode 100644 sdk/azuredatatransfer/ci.yml diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/CHANGELOG.md b/sdk/azuredatatransfer/azure-mgmt-datatransfer/CHANGELOG.md new file mode 100644 index 000000000000..fee9dac9f766 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0b1 (2026-10-19) + +### Other Changes + + - Initial version \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/LICENSE b/sdk/azuredatatransfer/azure-mgmt-datatransfer/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/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/azuredatatransfer/azure-mgmt-datatransfer/MANIFEST.in b/sdk/azuredatatransfer/azure-mgmt-datatransfer/MANIFEST.in new file mode 100644 index 000000000000..9b10ac41133a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include azure/mgmt/datatransfer/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/README.md b/sdk/azuredatatransfer/azure-mgmt-datatransfer/README.md new file mode 100644 index 000000000000..c2a8c2ee7fcc --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/README.md @@ -0,0 +1,61 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure Datatransfer Management Client Library. +This package has been tested with Python 3.10+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + +## _Disclaimer_ + +_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ + +## Getting started + +### Prerequisites + +- Python 3.10+ is required to use this package. +- [Azure subscription](https://azure.microsoft.com/free/) + +### Install the package + +```bash +pip install azure-mgmt-datatransfer +pip install azure-identity +``` + +### Authentication + +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` for Azure client secret. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, client can be authenticated by following code: + +```python +from azure.identity import DefaultAzureCredential +from azure.mgmt.datatransfer import DataTransferMgmtClient +import os + +sub_id = os.getenv("AZURE_SUBSCRIPTION_ID") +client = DataTransferMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id) +``` + +## Examples + +Code samples for this package can be found at: +- [Search Datatransfer Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com +- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +## Troubleshooting + +## Next steps + +## Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/_metadata.json b/sdk/azuredatatransfer/azure-mgmt-datatransfer/_metadata.json new file mode 100644 index 000000000000..bda868942b5f --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/_metadata.json @@ -0,0 +1,11 @@ +{ + "apiVersion": "2026-02-06-preview", + "apiVersions": { + "Microsoft.AzureDataTransfer": "2026-02-06-preview" + }, + "commit": "9969c2f086105356220a370bb316291fd26d87af", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/AzureDataTransfer", + "emitterVersion": "0.63.10", + "httpClientPythonVersion": "0.39.0" +} \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/api.md b/sdk/azuredatatransfer/azure-mgmt-datatransfer/api.md new file mode 100644 index 000000000000..6edd934bda73 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/api.md @@ -0,0 +1,4283 @@ +```py +namespace azure.mgmt.datatransfer + + class azure.mgmt.datatransfer.DataTransferMgmtClient: implements ContextManager + azure_data_transfer: AzureDataTransferOperations + connections: ConnectionsOperations + flow_profiles: FlowProfilesOperations + flows: FlowsOperations + operations: Operations + pipelines: PipelinesOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.datatransfer.aio + + class azure.mgmt.datatransfer.aio.DataTransferMgmtClient: implements AsyncContextManager + azure_data_transfer: AzureDataTransferOperations + connections: ConnectionsOperations + flow_profiles: FlowProfilesOperations + flows: FlowsOperations + operations: Operations + pipelines: PipelinesOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.datatransfer.aio.operations + + class azure.mgmt.datatransfer.aio.operations.AzureDataTransferOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def list_approved_schemas( + self, + pipeline: ListApprovedSchemasRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + async def list_approved_schemas( + self, + pipeline: ListApprovedSchemasRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + async def list_approved_schemas( + self, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + async def list_flow_profiles( + self, + body: ListFlowProfilesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> FlowProfilesListResult: ... + + @overload + async def list_flow_profiles( + self, + body: ListFlowProfilesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> FlowProfilesListResult: ... + + @overload + async def list_flow_profiles( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> FlowProfilesListResult: ... + + @overload + async def list_pipeline_metadata( + self, + body: ListPipelineMetadataRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListPipelineMetadataResult: ... + + @overload + async def list_pipeline_metadata( + self, + body: ListPipelineMetadataRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListPipelineMetadataResult: ... + + @overload + async def list_pipeline_metadata( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListPipelineMetadataResult: ... + + @overload + async def validate_schema( + self, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidateSchemaResult: ... + + @overload + async def validate_schema( + self, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidateSchemaResult: ... + + @overload + async def validate_schema( + self, + schema: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidateSchemaResult: ... + + + class azure.mgmt.datatransfer.aio.operations.ConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PendingConnection]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Connection]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Connection]: ... + + @distributed_trace + def list_pending_flows_list( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PendingFlow]: ... + + + class azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FlowProfile]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FlowProfile]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FlowProfile]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-05-30-preview', params_added_on={'2025-05-30-preview': ['api_version', 'subscription_id', 'resource_group_name', 'pipeline_name', 'flow_profile_name']}, api_versions_list=['2025-05-30-preview', '2025-10-10-preview', '2026-02-06-preview']) + async def begin_delete( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FlowProfile]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FlowProfile]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FlowProfile]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-05-30-preview', params_added_on={'2025-05-30-preview': ['api_version', 'subscription_id', 'resource_group_name', 'pipeline_name', 'flow_profile_name', 'accept']}, api_versions_list=['2025-05-30-preview', '2025-10-10-preview', '2026-02-06-preview']) + async def get( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + **kwargs: Any + ) -> FlowProfile: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-05-30-preview', params_added_on={'2025-05-30-preview': ['api_version', 'subscription_id', 'resource_group_name', 'pipeline_name', 'accept']}, api_versions_list=['2025-05-30-preview', '2025-10-10-preview', '2026-02-06-preview']) + def list_by_pipeline( + self, + resource_group_name: str, + pipeline_name: str, + **kwargs: Any + ) -> AsyncItemPaged[FlowProfile]: ... + + + class azure.mgmt.datatransfer.aio.operations.FlowsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Flow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Flow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def begin_disable( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @distributed_trace_async + async def begin_enable( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @distributed_trace_async + async def begin_generate_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Flow]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> Flow: ... + + @distributed_trace_async + async def get_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> GetDestinationEndpointPortsResult: ... + + @distributed_trace_async + async def get_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> GetDestinationEndpointsResult: ... + + @distributed_trace_async + async def get_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> StreamSourceAddresses: ... + + @distributed_trace_async + async def get_stream_connection_string( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> GetStreamConnectionStringResult: ... + + @distributed_trace + def list_by_connection( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Flow]: ... + + + class azure.mgmt.datatransfer.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.datatransfer.aio.operations.PipelinesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pipeline]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pipeline]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pipeline]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + pipeline_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: Action, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pipeline]: ... + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: Action, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pipeline]: ... + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Pipeline]: ... + + @overload + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Connection]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + pipeline_name: str, + **kwargs: Any + ) -> Pipeline: ... + + @overload + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListFlowsByPipelineResult: ... + + @overload + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListFlowsByPipelineResult: ... + + @overload + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListFlowsByPipelineResult: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Pipeline]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Pipeline]: ... + + @overload + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + +namespace azure.mgmt.datatransfer.models + + class azure.mgmt.datatransfer.models.Action(_Model): + action_type: Union[str, DateTransferActionType] + justification: Optional[str] + target_type: Union[str, TargetType] + targets: Optional[list[str]] + + @overload + def __init__( + self, + *, + action_type: Union[str, DateTransferActionType], + justification: Optional[str] = ..., + target_type: Union[str, TargetType], + targets: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.datatransfer.models.AntivirusRuleset(_Model): + av_solutions: Optional[list[Union[str, AntivirusSolutions]]] + + @overload + def __init__( + self, + *, + av_solutions: Optional[list[Union[str, AntivirusSolutions]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.AntivirusSolutions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLAM_AV = "ClamAv" + DEFENDER = "Defender" + + + class azure.mgmt.datatransfer.models.ApiFlowOptions(_Model): + api_mode: Optional[Union[str, ApiMode]] + audience_override: Optional[str] + authentication: Optional[list[Authentication]] + cname: Optional[str] + identity_translation: Optional[Union[str, IdentityTranslation]] + remote_calling_mode_client_id: Optional[str] + remote_endpoint: Optional[str] + remote_endpoint_settings: Optional[RemoteEndpointSettings] + sender_client_id: Optional[str] + + @overload + def __init__( + self, + *, + api_mode: Optional[Union[str, ApiMode]] = ..., + audience_override: Optional[str] = ..., + authentication: Optional[list[Authentication]] = ..., + cname: Optional[str] = ..., + identity_translation: Optional[Union[str, IdentityTranslation]] = ..., + remote_calling_mode_client_id: Optional[str] = ..., + remote_endpoint: Optional[str] = ..., + remote_endpoint_settings: Optional[RemoteEndpointSettings] = ..., + sender_client_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ApiMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ENDPOINT = "Endpoint" + SDK = "SDK" + + + class azure.mgmt.datatransfer.models.ArchiveRuleset(_Model): + maximum_compression_ratio_limit: Optional[float] + maximum_depth_limit: Optional[int] + maximum_expansion_size_limit: Optional[int] + minimum_size_for_expansion: Optional[int] + + @overload + def __init__( + self, + *, + maximum_compression_ratio_limit: Optional[float] = ..., + maximum_depth_limit: Optional[int] = ..., + maximum_expansion_size_limit: Optional[int] = ..., + minimum_size_for_expansion: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Authentication(_Model): + application_ids: Optional[list[str]] + audience: Optional[str] + authority: Optional[str] + client_id_override: Optional[str] + identity_translation: Optional[Union[str, IdentityTranslation]] + instance: Optional[str] + tenant_id: Optional[str] + type: Optional[Union[str, AuthenticationType]] + + @overload + def __init__( + self, + *, + application_ids: Optional[list[str]] = ..., + audience: Optional[str] = ..., + authority: Optional[str] = ..., + client_id_override: Optional[str] = ..., + identity_translation: Optional[Union[str, IdentityTranslation]] = ..., + instance: Optional[str] = ..., + tenant_id: Optional[str] = ..., + type: Optional[Union[str, AuthenticationType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.AuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JWT = "JWT" + NONE = "None" + + + class azure.mgmt.datatransfer.models.Casing(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INSENSITIVE = "Insensitive" + SENSITIVE = "Sensitive" + + + class azure.mgmt.datatransfer.models.Connection(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[ConnectionProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[ConnectionProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ConnectionIdList(_Model): + value: Optional[list[str]] + + @overload + def __init__( + self, + *, + value: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ConnectionProperties(_Model): + api_hostname: Optional[str] + approver: Optional[str] + date_submitted: Optional[datetime] + direction: Optional[Union[str, Direction]] + flow_profile_list: Optional[list[FlowProfileMetadata]] + flow_types: Optional[list[Union[str, FlowType]]] + force_disabled_status: Optional[list[Union[str, ForceDisabledStatus]]] + justification: Optional[str] + link_status: Optional[Union[str, LinkStatus]] + linked_connection_id: Optional[str] + pin: Optional[str] + pipeline: str + policies: Optional[list[str]] + primary_contact: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + remote_subscription_id: Optional[str] + requirement_id: Optional[str] + schema_uris: Optional[list[str]] + schemas: Optional[list[Schema]] + secondary_contacts: Optional[list[str]] + status: Optional[Union[str, ConnectionStatus]] + status_reason: Optional[str] + + @overload + def __init__( + self, + *, + api_hostname: Optional[str] = ..., + direction: Optional[Union[str, Direction]] = ..., + flow_profile_list: Optional[list[FlowProfileMetadata]] = ..., + flow_types: Optional[list[Union[str, FlowType]]] = ..., + justification: Optional[str] = ..., + pin: Optional[str] = ..., + pipeline: str, + policies: Optional[list[str]] = ..., + primary_contact: Optional[str] = ..., + remote_subscription_id: Optional[str] = ..., + requirement_id: Optional[str] = ..., + schema_uris: Optional[list[str]] = ..., + schemas: Optional[list[Schema]] = ..., + secondary_contacts: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + APPROVED = "Approved" + IN_REVIEW = "InReview" + REJECTED = "Rejected" + + + class azure.mgmt.datatransfer.models.ConnectionsPatch(_Model): + identity: Optional[ManagedServiceIdentity] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.datatransfer.models.DataClass(str, Enum, metaclass=CaseInsensitiveEnumMeta): + API_ENDPOINT = "ApiEndpoint" + API_SDK = "ApiSDK" + BLOB = "Blob" + EVENT_HUB = "EventHub" + SERVICE_BUS = "ServiceBus" + TABLE = "Table" + VIDEO = "Video" + + + class azure.mgmt.datatransfer.models.DataClassType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + API = "API" + COMPLEX = "Complex" + FILES = "Files" + MESSAGING = "Messaging" + SOFTWARE_ARTIFACTS = "SoftwareArtifacts" + STREAM = "Stream" + + + class azure.mgmt.datatransfer.models.DataSizeRuleset(_Model): + maximum: Optional[int] + minimum: Optional[int] + + @overload + def __init__( + self, + *, + maximum: Optional[int] = ..., + minimum: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB = "Blob" + TABLE = "Table" + + + class azure.mgmt.datatransfer.models.DateTransferActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOW_UPDATES = "AllowUpdates" + FORCE_DISABLE = "ForceDisable" + + + class azure.mgmt.datatransfer.models.Direction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RECEIVE = "Receive" + SEND = "Send" + + + class azure.mgmt.datatransfer.models.DirectionSettings(_Model): + complete_linking: Union[str, EnablementStatus] + connection_approvals: Union[str, EnablementStatus] + flow_approvals: Optional[Union[str, EnablementStatus]] + flow_profile_data_classes_available: Optional[list[Union[str, DataClassType]]] + flow_types_available: Optional[list[Union[str, FlowType]]] + messaging_flow_type_schema_validation: Optional[Union[str, EnablementStatus]] + messaging_flows_pricing_options: Optional[list[Union[str, FlowBillingTier]]] + + @overload + def __init__( + self, + *, + complete_linking: Union[str, EnablementStatus], + connection_approvals: Union[str, EnablementStatus], + flow_approvals: Optional[Union[str, EnablementStatus]] = ..., + flow_profile_data_classes_available: Optional[list[Union[str, DataClassType]]] = ..., + flow_types_available: Optional[list[Union[str, FlowType]]] = ..., + messaging_flow_type_schema_validation: Optional[Union[str, EnablementStatus]] = ..., + messaging_flows_pricing_options: Optional[list[Union[str, FlowBillingTier]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.EnablementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.datatransfer.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.datatransfer.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.datatransfer.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOW = "Allow" + DENY = "Deny" + + + class azure.mgmt.datatransfer.models.Flow(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + plan: Optional[Plan] + properties: Optional[FlowProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + plan: Optional[Plan] = ..., + properties: Optional[FlowProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowBillingTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_TRANSPORT = "BlobTransport" + PREMIUM = "Premium" + STANDARD = "Standard" + + + class azure.mgmt.datatransfer.models.FlowProfile(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[FlowProfileProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[FlowProfileProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProfileMetadata(_Model): + description: str + flow_profile_id: str + name: str + pipeline: str + replication_scenario: Union[str, DataClassType] + status: Union[str, FlowProfileStatus] + + @overload + def __init__( + self, + *, + description: str, + flow_profile_id: str, + name: str, + pipeline: str, + replication_scenario: Union[str, DataClassType], + status: Union[str, FlowProfileStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProfilePatch(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[FlowProfilePatchProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[FlowProfilePatchProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProfilePatchProperties(_Model): + description: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + rulesets: Optional[FlowProfileRulesets] + status: Optional[Union[str, FlowProfileStatus]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + rulesets: Optional[FlowProfileRulesets] = ..., + status: Optional[Union[str, FlowProfileStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProfileProperties(_Model): + description: str + flow_profile_id: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + replication_scenario: Union[str, DataClassType] + rulesets: Optional[FlowProfileRulesets] + status: Union[str, FlowProfileStatus] + + @overload + def __init__( + self, + *, + description: str, + replication_scenario: Union[str, DataClassType], + rulesets: Optional[FlowProfileRulesets] = ..., + status: Union[str, FlowProfileStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProfileRulesets(_Model): + antivirus: Optional[AntivirusRuleset] + archives: Optional[ArchiveRuleset] + data_size: Optional[DataSizeRuleset] + mime_filters: Optional[MimeFilterRuleset] + text_matching: Optional[TextMatchingRuleset] + xml_filters: Optional[XmlFilterRuleset] + + @overload + def __init__( + self, + *, + antivirus: Optional[AntivirusRuleset] = ..., + archives: Optional[ArchiveRuleset] = ..., + data_size: Optional[DataSizeRuleset] = ..., + mime_filters: Optional[MimeFilterRuleset] = ..., + text_matching: Optional[TextMatchingRuleset] = ..., + xml_filters: Optional[XmlFilterRuleset] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProfileStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + OBSOLETE = "Obsolete" + + + class azure.mgmt.datatransfer.models.FlowProfilesListResult(_Model): + value: Optional[list[FlowProfileMetadata]] + + @overload + def __init__( + self, + *, + value: Optional[list[FlowProfileMetadata]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowProperties(_Model): + api_flow_options: Optional[ApiFlowOptions] + connection: Optional[SelectedResource] + consumer_group: Optional[str] + customer_managed_key_vault_uri: Optional[str] + data_type: Optional[Union[str, DataType]] + destination_endpoint_ports: Optional[list[int]] + destination_endpoints: Optional[list[str]] + event_hub_id: Optional[str] + flow_data_type: Optional[Union[str, DataClass]] + flow_id: Optional[str] + flow_profile: Optional[FlowProfileMetadata] + flow_type: Optional[Union[str, FlowType]] + force_disabled_status: Optional[list[Union[str, ForceDisabledStatus]]] + key_vault_uri: Optional[str] + link_status: Optional[Union[str, LinkStatus]] + linked_flow_id: Optional[str] + messaging_options: Optional[MessagingOptions] + passphrase: Optional[str] + policies: Optional[list[str]] + provisioning_state: Optional[Union[str, ProvisioningState]] + schema: Optional[Schema] + service_bus_queue_id: Optional[str] + source_addresses: Optional[StreamSourceAddresses] + status: Optional[Union[str, FlowStatus]] + storage_account_id: Optional[str] + storage_account_name: Optional[str] + storage_container_name: Optional[str] + storage_table_name: Optional[str] + stream_id: Optional[str] + stream_latency: Optional[int] + stream_protocol: Optional[Union[str, StreamProtocol]] + + @overload + def __init__( + self, + *, + api_flow_options: Optional[ApiFlowOptions] = ..., + connection: Optional[SelectedResource] = ..., + consumer_group: Optional[str] = ..., + customer_managed_key_vault_uri: Optional[str] = ..., + data_type: Optional[Union[str, DataType]] = ..., + destination_endpoint_ports: Optional[list[int]] = ..., + destination_endpoints: Optional[list[str]] = ..., + event_hub_id: Optional[str] = ..., + flow_data_type: Optional[Union[str, DataClass]] = ..., + flow_profile: Optional[FlowProfileMetadata] = ..., + flow_type: Optional[Union[str, FlowType]] = ..., + key_vault_uri: Optional[str] = ..., + messaging_options: Optional[MessagingOptions] = ..., + passphrase: Optional[str] = ..., + policies: Optional[list[str]] = ..., + schema: Optional[Schema] = ..., + service_bus_queue_id: Optional[str] = ..., + source_addresses: Optional[StreamSourceAddresses] = ..., + status: Optional[Union[str, FlowStatus]] = ..., + storage_account_id: Optional[str] = ..., + storage_account_name: Optional[str] = ..., + storage_container_name: Optional[str] = ..., + storage_table_name: Optional[str] = ..., + stream_id: Optional[str] = ..., + stream_latency: Optional[int] = ..., + stream_protocol: Optional[Union[str, StreamProtocol]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.datatransfer.models.FlowType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + API = "API" + BASIC_FILES = "BasicFiles" + COMPLEX = "Complex" + DATA = "Data" + DEV_SEC_OPS = "DevSecOps" + DISK_IMAGES = "DiskImages" + MESSAGING = "Messaging" + MICROSOFT_INTERNAL = "MicrosoftInternal" + MISSION = "Mission" + MISSION_OPAQUE_XML = "MissionOpaqueXML" + OPAQUE = "Opaque" + STANDARD = "Standard" + STREAMING_VIDEO = "StreamingVideo" + UNKNOWN = "Unknown" + + + class azure.mgmt.datatransfer.models.FlowsPatch(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[FlowsPatchProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[FlowsPatchProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.FlowsPatchProperties(_Model): + passphrase: Optional[str] + stream_id: Optional[str] + stream_latency: Optional[int] + stream_protocol: Optional[Union[str, StreamProtocol]] + + @overload + def __init__( + self, + *, + passphrase: Optional[str] = ..., + stream_id: Optional[str] = ..., + stream_latency: Optional[int] = ..., + stream_protocol: Optional[Union[str, StreamProtocol]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ForceDisabledStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONNECTION_FORCE_DISABLED = "ConnectionForceDisabled" + FLOW_PROFILE_FORCE_DISABLED = "FlowProfileForceDisabled" + FLOW_TYPE_FORCE_DISABLED = "FlowTypeForceDisabled" + PIPELINE_FORCE_DISABLED = "PipelineForceDisabled" + + + class azure.mgmt.datatransfer.models.GetDestinationEndpointPortsResult(_Model): + ports: Optional[list[int]] + + @overload + def __init__( + self, + *, + ports: Optional[list[int]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.GetDestinationEndpointsResult(_Model): + endpoints: Optional[list[str]] + + @overload + def __init__( + self, + *, + endpoints: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.GetStreamConnectionStringResult(_Model): + connection_string: Optional[str] + + @overload + def __init__( + self, + *, + connection_string: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.IdentityTranslation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SERVICE_IDENTITY = "ServiceIdentity" + USER_IDENTITY = "UserIdentity" + + + class azure.mgmt.datatransfer.models.InternalMetadataProperties(_Model): + operation_status: Optional[OperationStatusProperties] + status_set_by: Optional[str] + + + class azure.mgmt.datatransfer.models.LinkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LINKED = "Linked" + UNLINKED = "Unlinked" + + + class azure.mgmt.datatransfer.models.ListApprovedSchemasRequest(_Model): + direction: Optional[Union[str, Direction]] + pipeline: Optional[str] + + @overload + def __init__( + self, + *, + direction: Optional[Union[str, Direction]] = ..., + pipeline: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ListFlowProfilesRequest(_Model): + pipeline: Optional[str] + + @overload + def __init__( + self, + *, + pipeline: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ListFlowsByPipelineConnection(_Model): + flows: Optional[list[Flow]] + id: Optional[str] + + @overload + def __init__( + self, + *, + flows: Optional[list[Flow]] = ..., + id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ListFlowsByPipelineResult(_Model): + value: Optional[list[ListFlowsByPipelineConnection]] + + @overload + def __init__( + self, + *, + value: Optional[list[ListFlowsByPipelineConnection]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ListParameterBody(_Model): + connections: Optional[ConnectionIdList] + + @overload + def __init__( + self, + *, + connections: Optional[ConnectionIdList] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ListPipelineMetadataRequest(_Model): + pipeline: str + + @overload + def __init__( + self, + *, + pipeline: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ListPipelineMetadataResult(_Model): + receive: Optional[DirectionSettings] + send: Optional[DirectionSettings] + + @overload + def __init__( + self, + *, + receive: Optional[DirectionSettings] = ..., + send: Optional[DirectionSettings] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.datatransfer.models.MatchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETE = "Complete" + PARTIAL = "Partial" + + + class azure.mgmt.datatransfer.models.MessagingOptions(_Model): + billing_tier: Optional[Union[str, FlowBillingTier]] + performance_priority: Optional[Union[str, EnablementStatus]] + + @overload + def __init__( + self, + *, + billing_tier: Optional[Union[str, FlowBillingTier]] = ..., + performance_priority: Optional[Union[str, EnablementStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.MimeFilterRuleset(_Model): + filters: Optional[list[MimeTypeFilter]] + type: Optional[Union[str, FilterType]] + + @overload + def __init__( + self, + *, + filters: Optional[list[MimeTypeFilter]] = ..., + type: Optional[Union[str, FilterType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.MimeTypeFilter(_Model): + extensions: Optional[list[str]] + media: Optional[str] + + @overload + def __init__( + self, + *, + extensions: Optional[list[str]] = ..., + media: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.datatransfer.models.OperationStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.datatransfer.models.OperationStatusProperties(_Model): + id: Optional[str] + message: Optional[str] + status: Optional[Union[str, OperationStatusEnum]] + + + class azure.mgmt.datatransfer.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.datatransfer.models.PendingConnection(_Model): + api_hostname: Optional[str] + approver: Optional[str] + date_submitted: Optional[datetime] + direction: Optional[Union[str, Direction]] + flow_profile_list: Optional[list[FlowProfileMetadata]] + flow_types: Optional[list[Union[str, FlowType]]] + force_disabled_status: Optional[list[Union[str, ForceDisabledStatus]]] + id: Optional[str] + justification: Optional[str] + link_status: Optional[Union[str, LinkStatus]] + linked_connection_id: Optional[str] + location: str + name: Optional[str] + pin: Optional[str] + pipeline: str + policies: Optional[list[str]] + primary_contact: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + remote_subscription_id: Optional[str] + requirement_id: Optional[str] + schema_uris: Optional[list[str]] + schemas: Optional[list[Schema]] + secondary_contacts: Optional[list[str]] + status: Optional[Union[str, ConnectionStatus]] + status_reason: Optional[str] + subscription_id: Optional[str] + system_data: Optional[SystemData] + tags: Optional[dict[str, str]] + type: Optional[str] + + @overload + def __init__( + self, + *, + api_hostname: Optional[str] = ..., + direction: Optional[Union[str, Direction]] = ..., + flow_profile_list: Optional[list[FlowProfileMetadata]] = ..., + flow_types: Optional[list[Union[str, FlowType]]] = ..., + justification: Optional[str] = ..., + location: str, + pin: Optional[str] = ..., + pipeline: str, + policies: Optional[list[str]] = ..., + primary_contact: Optional[str] = ..., + remote_subscription_id: Optional[str] = ..., + requirement_id: Optional[str] = ..., + schema_uris: Optional[list[str]] = ..., + schemas: Optional[list[Schema]] = ..., + secondary_contacts: Optional[list[str]] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.PendingFlow(_Model): + api_flow_options: Optional[ApiFlowOptions] + connection: Optional[SelectedResource] + connection_id: Optional[str] + consumer_group: Optional[str] + customer_managed_key_vault_uri: Optional[str] + data_type: Optional[Union[str, DataType]] + destination_endpoint_ports: Optional[list[int]] + destination_endpoints: Optional[list[str]] + event_hub_id: Optional[str] + flow_data_type: Optional[Union[str, DataClass]] + flow_id: Optional[str] + flow_profile: Optional[FlowProfileMetadata] + flow_type: Optional[Union[str, FlowType]] + force_disabled_status: Optional[list[Union[str, ForceDisabledStatus]]] + id: Optional[str] + key_vault_uri: Optional[str] + link_status: Optional[Union[str, LinkStatus]] + linked_flow_id: Optional[str] + location: str + messaging_options: Optional[MessagingOptions] + name: Optional[str] + passphrase: Optional[str] + policies: Optional[list[str]] + provisioning_state: Optional[Union[str, ProvisioningState]] + schema: Optional[Schema] + service_bus_queue_id: Optional[str] + source_addresses: Optional[StreamSourceAddresses] + status: Optional[Union[str, FlowStatus]] + storage_account_id: Optional[str] + storage_account_name: Optional[str] + storage_container_name: Optional[str] + storage_table_name: Optional[str] + stream_id: Optional[str] + stream_latency: Optional[int] + stream_protocol: Optional[Union[str, StreamProtocol]] + subscription_id: Optional[str] + system_data: Optional[SystemData] + tags: Optional[dict[str, str]] + type: Optional[str] + + @overload + def __init__( + self, + *, + api_flow_options: Optional[ApiFlowOptions] = ..., + connection: Optional[SelectedResource] = ..., + consumer_group: Optional[str] = ..., + customer_managed_key_vault_uri: Optional[str] = ..., + data_type: Optional[Union[str, DataType]] = ..., + destination_endpoint_ports: Optional[list[int]] = ..., + destination_endpoints: Optional[list[str]] = ..., + event_hub_id: Optional[str] = ..., + flow_data_type: Optional[Union[str, DataClass]] = ..., + flow_profile: Optional[FlowProfileMetadata] = ..., + flow_type: Optional[Union[str, FlowType]] = ..., + key_vault_uri: Optional[str] = ..., + location: str, + messaging_options: Optional[MessagingOptions] = ..., + passphrase: Optional[str] = ..., + policies: Optional[list[str]] = ..., + schema: Optional[Schema] = ..., + service_bus_queue_id: Optional[str] = ..., + source_addresses: Optional[StreamSourceAddresses] = ..., + status: Optional[Union[str, FlowStatus]] = ..., + storage_account_id: Optional[str] = ..., + storage_account_name: Optional[str] = ..., + storage_container_name: Optional[str] = ..., + storage_table_name: Optional[str] = ..., + stream_id: Optional[str] = ..., + stream_latency: Optional[int] = ..., + stream_protocol: Optional[Union[str, StreamProtocol]] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Pipeline(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[PipelineProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[PipelineProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.PipelineConnectionProperties(_Model): + internal_metadata: Optional[InternalMetadataProperties] + + + class azure.mgmt.datatransfer.models.PipelineProperties(_Model): + connections: Optional[list[ReadPipelineConnection]] + disabled_data_class: Optional[list[Union[str, DataClass]]] + disabled_flow_types: Optional[list[Union[str, FlowType]]] + display_name: Optional[str] + flow_types: Optional[list[Union[str, FlowType]]] + policies: Optional[list[str]] + provisioning_state: Optional[Union[str, ProvisioningState]] + quarantine_download_storage_account: Optional[str] + quarantine_download_storage_container: Optional[str] + remote_cloud: str + status: Optional[Union[str, PipelineStatus]] + subscribers: Optional[list[Subscriber]] + + @overload + def __init__( + self, + *, + disabled_data_class: Optional[list[Union[str, DataClass]]] = ..., + disabled_flow_types: Optional[list[Union[str, FlowType]]] = ..., + display_name: Optional[str] = ..., + flow_types: Optional[list[Union[str, FlowType]]] = ..., + policies: Optional[list[str]] = ..., + quarantine_download_storage_account: Optional[str] = ..., + quarantine_download_storage_container: Optional[str] = ..., + remote_cloud: str, + status: Optional[Union[str, PipelineStatus]] = ..., + subscribers: Optional[list[Subscriber]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.PipelineStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.datatransfer.models.PipelinesPatch(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[PipelinesPatchProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[PipelinesPatchProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.PipelinesPatchProperties(_Model): + flow_types: Optional[list[Union[str, FlowType]]] + + @overload + def __init__( + self, + *, + flow_types: Optional[list[Union[str, FlowType]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Plan(_Model): + name: str + product: str + promotion_code: Optional[str] + publisher: str + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + product: str, + promotion_code: Optional[str] = ..., + publisher: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.datatransfer.models.ReadPipelineConnection(_Model): + etag: Optional[str] + id: str + location: Optional[str] + name: Optional[str] + properties: Optional[PipelineConnectionProperties] + system_data: Optional[SystemData] + type: Optional[str] + + @overload + def __init__( + self, + *, + etag: Optional[str] = ..., + id: str, + location: Optional[str] = ..., + name: Optional[str] = ..., + properties: Optional[PipelineConnectionProperties] = ..., + system_data: Optional[SystemData] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.RemoteEndpointSettings(_Model): + authentication: Optional[list[Authentication]] + endpoint: str + + @overload + def __init__( + self, + *, + authentication: Optional[list[Authentication]] = ..., + endpoint: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.datatransfer.models.ResourceBody(_Model): + id: str + status_reason: Optional[str] + + @overload + def __init__( + self, + *, + id: str, + status_reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Schema(_Model): + connection_id: Optional[str] + content: Optional[str] + direction: Optional[Union[str, Direction]] + id: Optional[str] + name: Optional[str] + schema_type: Optional[Union[str, SchemaType]] + schema_uri: Optional[str] + status: Optional[Union[str, SchemaStatus]] + + @overload + def __init__( + self, + *, + connection_id: Optional[str] = ..., + content: Optional[str] = ..., + direction: Optional[Union[str, Direction]] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + schema_type: Optional[Union[str, SchemaType]] = ..., + schema_uri: Optional[str] = ..., + status: Optional[Union[str, SchemaStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SchemaStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + NEW = "New" + + + class azure.mgmt.datatransfer.models.SchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + XSD = "Xsd" + ZIP = "Zip" + + + class azure.mgmt.datatransfer.models.SchemasListResult(_Model): + value: Optional[list[Schema]] + + @overload + def __init__( + self, + *, + value: Optional[list[Schema]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SelectedResource(_Model): + id: str + location: Optional[str] + name: Optional[str] + subscription_name: Optional[str] + + @overload + def __init__( + self, + *, + id: str, + location: Optional[str] = ..., + name: Optional[str] = ..., + subscription_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SetDestinationEndpointPorts(_Model): + ports: Optional[list[int]] + + @overload + def __init__( + self, + *, + ports: Optional[list[int]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SetDestinationEndpoints(_Model): + endpoints: Optional[list[str]] + + @overload + def __init__( + self, + *, + endpoints: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SetSourceAddresses(_Model): + values_property: Optional[list[str]] + + @overload + def __init__( + self, + *, + values_property: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SetStreamPassphrase(_Model): + value: Optional[str] + + @overload + def __init__( + self, + *, + value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.StreamProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RTP = "RTP" + SRT = "SRT" + UDP = "UDP" + + + class azure.mgmt.datatransfer.models.StreamSourceAddresses(_Model): + source_addresses: Optional[list[str]] + + @overload + def __init__( + self, + *, + source_addresses: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.Subscriber(_Model): + email: Optional[str] + notifications: Optional[int] + + @overload + def __init__( + self, + *, + email: Optional[str] = ..., + notifications: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.TargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONNECTION = "Connection" + FLOW_PROFILE = "FlowProfile" + FLOW_TYPE = "FlowType" + PIPELINE = "Pipeline" + + + class azure.mgmt.datatransfer.models.TextMatchingRuleset(_Model): + deny: Optional[list[TextMatchingRulesetDeny]] + + @overload + def __init__( + self, + *, + deny: Optional[list[TextMatchingRulesetDeny]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.TextMatchingRulesetDeny(_Model): + case_sensitivity: Union[str, Casing] + match_type: Union[str, MatchType] + text: str + + @overload + def __init__( + self, + *, + case_sensitivity: Union[str, Casing], + match_type: Union[str, MatchType], + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.datatransfer.models.ValidateSchemaResult(_Model): + message: Optional[str] + status: Optional[Union[str, ValidateSchemaStatus]] + + @overload + def __init__( + self, + *, + message: Optional[str] = ..., + status: Optional[Union[str, ValidateSchemaStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.ValidateSchemaStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.datatransfer.models.XmlFilterRuleset(_Model): + default_namespace: Optional[str] + reference: Optional[Union[str, XmlReferenceType]] + schema: Optional[str] + + @overload + def __init__( + self, + *, + default_namespace: Optional[str] = ..., + reference: Optional[Union[str, XmlReferenceType]] = ..., + schema: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.datatransfer.models.XmlReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "Inline" + + +namespace azure.mgmt.datatransfer.operations + + class azure.mgmt.datatransfer.operations.AzureDataTransferOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def list_approved_schemas( + self, + pipeline: ListApprovedSchemasRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + def list_approved_schemas( + self, + pipeline: ListApprovedSchemasRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + def list_approved_schemas( + self, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + def list_flow_profiles( + self, + body: ListFlowProfilesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> FlowProfilesListResult: ... + + @overload + def list_flow_profiles( + self, + body: ListFlowProfilesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> FlowProfilesListResult: ... + + @overload + def list_flow_profiles( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> FlowProfilesListResult: ... + + @overload + def list_pipeline_metadata( + self, + body: ListPipelineMetadataRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListPipelineMetadataResult: ... + + @overload + def list_pipeline_metadata( + self, + body: ListPipelineMetadataRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListPipelineMetadataResult: ... + + @overload + def list_pipeline_metadata( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListPipelineMetadataResult: ... + + @overload + def validate_schema( + self, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidateSchemaResult: ... + + @overload + def validate_schema( + self, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidateSchemaResult: ... + + @overload + def validate_schema( + self, + schema: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidateSchemaResult: ... + + + class azure.mgmt.datatransfer.operations.ConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> ItemPaged[PendingConnection]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Connection]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Connection]: ... + + @distributed_trace + def list_pending_flows_list( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> ItemPaged[PendingFlow]: ... + + + class azure.mgmt.datatransfer.operations.FlowProfilesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FlowProfile]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FlowProfile]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FlowProfile]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-05-30-preview', params_added_on={'2025-05-30-preview': ['api_version', 'subscription_id', 'resource_group_name', 'pipeline_name', 'flow_profile_name']}, api_versions_list=['2025-05-30-preview', '2025-10-10-preview', '2026-02-06-preview']) + def begin_delete( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FlowProfile]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FlowProfile]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FlowProfile]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-05-30-preview', params_added_on={'2025-05-30-preview': ['api_version', 'subscription_id', 'resource_group_name', 'pipeline_name', 'flow_profile_name', 'accept']}, api_versions_list=['2025-05-30-preview', '2025-10-10-preview', '2026-02-06-preview']) + def get( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + **kwargs: Any + ) -> FlowProfile: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-05-30-preview', params_added_on={'2025-05-30-preview': ['api_version', 'subscription_id', 'resource_group_name', 'pipeline_name', 'accept']}, api_versions_list=['2025-05-30-preview', '2025-10-10-preview', '2026-02-06-preview']) + def list_by_pipeline( + self, + resource_group_name: str, + pipeline_name: str, + **kwargs: Any + ) -> ItemPaged[FlowProfile]: ... + + + class azure.mgmt.datatransfer.operations.FlowsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Flow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Flow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def begin_disable( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @distributed_trace + def begin_enable( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @distributed_trace + def begin_generate_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Flow]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> Flow: ... + + @distributed_trace + def get_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> GetDestinationEndpointPortsResult: ... + + @distributed_trace + def get_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> GetDestinationEndpointsResult: ... + + @distributed_trace + def get_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> StreamSourceAddresses: ... + + @distributed_trace + def get_stream_connection_string( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + **kwargs: Any + ) -> GetStreamConnectionStringResult: ... + + @distributed_trace + def list_by_connection( + self, + resource_group_name: str, + connection_name: str, + **kwargs: Any + ) -> ItemPaged[Flow]: ... + + + class azure.mgmt.datatransfer.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.datatransfer.operations.PipelinesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Pipeline]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Pipeline]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Pipeline]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + pipeline_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: Action, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Pipeline]: ... + + @overload + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: Action, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Pipeline]: ... + + @overload + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Pipeline]: ... + + @overload + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Connection]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + pipeline_name: str, + **kwargs: Any + ) -> Pipeline: ... + + @overload + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListFlowsByPipelineResult: ... + + @overload + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListFlowsByPipelineResult: ... + + @overload + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ListFlowsByPipelineResult: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Pipeline]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Pipeline]: ... + + @overload + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + @overload + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemasListResult: ... + + +namespace azure.mgmt.datatransfer.types + + class azure.mgmt.datatransfer.types.Action(TypedDict, total=False): + key "actionType": Required[Union[str, DateTransferActionType]] + key "justification": str + key "targetType": Required[Union[str, TargetType]] + actionType: Union[str, DateTransferActionType] + justification: str + targetType: Union[str, TargetType] + targets: list[str] + + + class azure.mgmt.datatransfer.types.AntivirusRuleset(TypedDict, total=False): + avSolutions: list[Union[str, AntivirusSolutions]] + + + class azure.mgmt.datatransfer.types.ApiFlowOptions(TypedDict, total=False): + key "apiMode": Union[str, ApiMode] + key "audienceOverride": str + key "cname": str + key "identityTranslation": Union[str, IdentityTranslation] + key "remoteCallingModeClientId": str + key "remoteEndpoint": str + key "remoteEndpointSettings": ForwardRef('RemoteEndpointSettings', module='types') + key "senderClientId": str + apiMode: Union[str, ApiMode] + audienceOverride: str + authentication: list[Authentication] + cname: str + identityTranslation: Union[str, IdentityTranslation] + remoteCallingModeClientId: str + remoteEndpoint: str + remoteEndpointSettings: RemoteEndpointSettings + senderClientId: str + + + class azure.mgmt.datatransfer.types.ArchiveRuleset(TypedDict, total=False): + key "maximumCompressionRatioLimit": float + key "maximumDepthLimit": int + key "maximumExpansionSizeLimit": int + key "minimumSizeForExpansion": int + maximumCompressionRatioLimit: float + maximumDepthLimit: int + maximumExpansionSizeLimit: int + minimumSizeForExpansion: int + + + class azure.mgmt.datatransfer.types.Authentication(TypedDict, total=False): + key "audience": str + key "authority": str + key "clientIdOverride": str + key "identityTranslation": Union[str, IdentityTranslation] + key "instance": str + key "tenantId": str + key "type": Union[str, AuthenticationType] + applicationIds: list[str] + audience: str + authority: str + clientIdOverride: str + identityTranslation: Union[str, IdentityTranslation] + instance: str + tenantId: str + type: Union[str, AuthenticationType] + + + class azure.mgmt.datatransfer.types.Connection(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('ConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: ConnectionProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.datatransfer.types.ConnectionIdList(TypedDict, total=False): + value: list[str] + + + class azure.mgmt.datatransfer.types.ConnectionProperties(TypedDict, total=False): + key "apiHostname": str + key "approver": str + key "dateSubmitted": str + key "direction": Union[str, Direction] + key "justification": str + key "linkStatus": Union[str, LinkStatus] + key "linkedConnectionId": str + key "pin": str + key "pipeline": Required[str] + key "primaryContact": str + key "provisioningState": Union[str, ProvisioningState] + key "remoteSubscriptionId": str + key "requirementId": str + key "status": Union[str, ConnectionStatus] + key "statusReason": str + apiHostname: str + approver: str + dateSubmitted: str + direction: Union[str, Direction] + flowProfileList: list[FlowProfileMetadata] + flowTypes: list[Union[str, FlowType]] + forceDisabledStatus: list[Union[str, ForceDisabledStatus]] + justification: str + linkStatus: Union[str, LinkStatus] + linkedConnectionId: str + pin: str + pipeline: str + policies: list[str] + primaryContact: str + provisioningState: Union[str, ProvisioningState] + remoteSubscriptionId: str + requirementId: str + schemaUris: list[str] + schemas: list[Schema] + secondaryContacts: list[str] + status: Union[str, ConnectionStatus] + statusReason: str + + + class azure.mgmt.datatransfer.types.ConnectionsPatch(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + identity: ManagedServiceIdentity + tags: dict[str, str] + + + class azure.mgmt.datatransfer.types.DataSizeRuleset(TypedDict, total=False): + key "maximum": int + key "minimum": int + maximum: int + minimum: int + + + class azure.mgmt.datatransfer.types.Flow(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "plan": ForwardRef('Plan', module='types') + key "properties": ForwardRef('FlowProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + plan: Plan + properties: FlowProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.datatransfer.types.FlowProfile(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('FlowProfileProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: FlowProfileProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.datatransfer.types.FlowProfileMetadata(TypedDict, total=False): + key "description": Required[str] + key "flowProfileId": Required[str] + key "name": Required[str] + key "pipeline": Required[str] + key "replicationScenario": Required[Union[str, DataClassType]] + key "status": Required[Union[str, FlowProfileStatus]] + description: str + flowProfileId: str + name: str + pipeline: str + replicationScenario: Union[str, DataClassType] + status: Union[str, FlowProfileStatus] + + + class azure.mgmt.datatransfer.types.FlowProfilePatch(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('FlowProfilePatchProperties', module='types') + identity: ManagedServiceIdentity + properties: FlowProfilePatchProperties + tags: dict[str, str] + + + class azure.mgmt.datatransfer.types.FlowProfilePatchProperties(TypedDict, total=False): + key "description": str + key "provisioningState": Union[str, ProvisioningState] + key "rulesets": ForwardRef('FlowProfileRulesets', module='types') + key "status": Union[str, FlowProfileStatus] + description: str + provisioningState: Union[str, ProvisioningState] + rulesets: FlowProfileRulesets + status: Union[str, FlowProfileStatus] + + + class azure.mgmt.datatransfer.types.FlowProfileProperties(TypedDict, total=False): + key "description": Required[str] + key "flowProfileId": str + key "provisioningState": Union[str, ProvisioningState] + key "replicationScenario": Required[Union[str, DataClassType]] + key "rulesets": ForwardRef('FlowProfileRulesets', module='types') + key "status": Required[Union[str, FlowProfileStatus]] + description: str + flowProfileId: str + provisioningState: Union[str, ProvisioningState] + replicationScenario: Union[str, DataClassType] + rulesets: FlowProfileRulesets + status: Union[str, FlowProfileStatus] + + + class azure.mgmt.datatransfer.types.FlowProfileRulesets(TypedDict, total=False): + key "antivirus": ForwardRef('AntivirusRuleset', module='types') + key "archives": ForwardRef('ArchiveRuleset', module='types') + key "dataSize": ForwardRef('DataSizeRuleset', module='types') + key "mimeFilters": ForwardRef('MimeFilterRuleset', module='types') + key "textMatching": ForwardRef('TextMatchingRuleset', module='types') + key "xmlFilters": ForwardRef('XmlFilterRuleset', module='types') + antivirus: AntivirusRuleset + archives: ArchiveRuleset + dataSize: DataSizeRuleset + mimeFilters: MimeFilterRuleset + textMatching: TextMatchingRuleset + xmlFilters: XmlFilterRuleset + + + class azure.mgmt.datatransfer.types.FlowProperties(TypedDict, total=False): + key "apiFlowOptions": ForwardRef('ApiFlowOptions', module='types') + key "connection": ForwardRef('SelectedResource', module='types') + key "consumerGroup": str + key "customerManagedKeyVaultUri": str + key "dataType": Union[str, DataType] + key "eventHubId": str + key "flowDataType": Union[str, DataClass] + key "flowId": str + key "flowProfile": ForwardRef('FlowProfileMetadata', module='types') + key "flowType": Union[str, FlowType] + key "keyVaultUri": str + key "linkStatus": Union[str, LinkStatus] + key "linkedFlowId": str + key "messagingOptions": ForwardRef('MessagingOptions', module='types') + key "passphrase": str + key "provisioningState": Union[str, ProvisioningState] + key "schema": ForwardRef('Schema', module='types') + key "serviceBusQueueId": str + key "sourceAddresses": ForwardRef('StreamSourceAddresses', module='types') + key "status": Union[str, FlowStatus] + key "storageAccountId": str + key "storageAccountName": str + key "storageContainerName": str + key "storageTableName": str + key "streamId": str + key "streamLatency": int + key "streamProtocol": Union[str, StreamProtocol] + apiFlowOptions: ApiFlowOptions + connection: SelectedResource + consumerGroup: str + customerManagedKeyVaultUri: str + dataType: Union[str, DataType] + destinationEndpointPorts: list[int] + destinationEndpoints: list[str] + eventHubId: str + flowDataType: Union[str, DataClass] + flowId: str + flowProfile: FlowProfileMetadata + flowType: Union[str, FlowType] + forceDisabledStatus: list[Union[str, ForceDisabledStatus]] + keyVaultUri: str + linkStatus: Union[str, LinkStatus] + linkedFlowId: str + messagingOptions: MessagingOptions + passphrase: str + policies: list[str] + provisioningState: Union[str, ProvisioningState] + schema: Schema + serviceBusQueueId: str + sourceAddresses: StreamSourceAddresses + status: Union[str, FlowStatus] + storageAccountId: str + storageAccountName: str + storageContainerName: str + storageTableName: str + streamId: str + streamLatency: int + streamProtocol: Union[str, StreamProtocol] + + + class azure.mgmt.datatransfer.types.FlowsPatch(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('FlowsPatchProperties', module='types') + identity: ManagedServiceIdentity + properties: FlowsPatchProperties + tags: dict[str, str] + + + class azure.mgmt.datatransfer.types.FlowsPatchProperties(TypedDict, total=False): + key "passphrase": str + key "streamId": str + key "streamLatency": int + key "streamProtocol": Union[str, StreamProtocol] + passphrase: str + streamId: str + streamLatency: int + streamProtocol: Union[str, StreamProtocol] + + + class azure.mgmt.datatransfer.types.InternalMetadataProperties(TypedDict, total=False): + key "operationStatus": ForwardRef('OperationStatusProperties', module='types') + key "statusSetBy": str + operationStatus: OperationStatusProperties + statusSetBy: str + + + class azure.mgmt.datatransfer.types.ListApprovedSchemasRequest(TypedDict, total=False): + key "direction": Union[str, Direction] + key "pipeline": str + direction: Union[str, Direction] + pipeline: str + + + class azure.mgmt.datatransfer.types.ListFlowProfilesRequest(TypedDict, total=False): + key "pipeline": str + pipeline: str + + + class azure.mgmt.datatransfer.types.ListPipelineMetadataRequest(TypedDict, total=False): + key "pipeline": Required[str] + pipeline: str + + + class azure.mgmt.datatransfer.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principalId: str + tenantId: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.datatransfer.types.MessagingOptions(TypedDict, total=False): + key "billingTier": Union[str, FlowBillingTier] + key "performancePriority": Union[str, EnablementStatus] + billingTier: Union[str, FlowBillingTier] + performancePriority: Union[str, EnablementStatus] + + + class azure.mgmt.datatransfer.types.MimeFilterRuleset(TypedDict, total=False): + key "type": Union[str, FilterType] + filters: list[MimeTypeFilter] + type: Union[str, FilterType] + + + class azure.mgmt.datatransfer.types.MimeTypeFilter(TypedDict, total=False): + key "media": str + extensions: list[str] + media: str + + + class azure.mgmt.datatransfer.types.OperationStatusProperties(TypedDict, total=False): + key "id": str + key "message": str + key "status": Union[str, OperationStatusEnum] + id: str + message: str + status: Union[str, OperationStatusEnum] + + + class azure.mgmt.datatransfer.types.Pipeline(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('PipelineProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: PipelineProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.datatransfer.types.PipelineConnectionProperties(TypedDict, total=False): + key "internalMetadata": ForwardRef('InternalMetadataProperties', module='types') + internalMetadata: InternalMetadataProperties + + + class azure.mgmt.datatransfer.types.PipelineProperties(TypedDict, total=False): + key "displayName": str + key "provisioningState": Union[str, ProvisioningState] + key "quarantineDownloadStorageAccount": str + key "quarantineDownloadStorageContainer": str + key "remoteCloud": Required[str] + key "status": Union[str, PipelineStatus] + connections: list[ReadPipelineConnection] + disabledDataClass: list[Union[str, DataClass]] + disabledFlowTypes: list[Union[str, FlowType]] + displayName: str + flowTypes: list[Union[str, FlowType]] + policies: list[str] + provisioningState: Union[str, ProvisioningState] + quarantineDownloadStorageAccount: str + quarantineDownloadStorageContainer: str + remoteCloud: str + status: Union[str, PipelineStatus] + subscribers: list[Subscriber] + + + class azure.mgmt.datatransfer.types.PipelinesPatch(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('PipelinesPatchProperties', module='types') + identity: ManagedServiceIdentity + properties: PipelinesPatchProperties + tags: dict[str, str] + + + class azure.mgmt.datatransfer.types.PipelinesPatchProperties(TypedDict, total=False): + flowTypes: list[Union[str, FlowType]] + + + class azure.mgmt.datatransfer.types.Plan(TypedDict, total=False): + key "name": Required[str] + key "product": Required[str] + key "promotionCode": str + key "publisher": Required[str] + key "version": str + name: str + product: str + promotionCode: str + publisher: str + version: str + + + class azure.mgmt.datatransfer.types.ReadPipelineConnection(TypedDict, total=False): + key "etag": str + key "id": Required[str] + key "location": str + key "name": str + key "properties": ForwardRef('PipelineConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + etag: str + id: str + location: str + name: str + properties: PipelineConnectionProperties + systemData: SystemData + type: str + + + class azure.mgmt.datatransfer.types.RemoteEndpointSettings(TypedDict, total=False): + key "endpoint": Required[str] + authentication: list[Authentication] + endpoint: str + + + class azure.mgmt.datatransfer.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.datatransfer.types.ResourceBody(TypedDict, total=False): + key "id": Required[str] + key "statusReason": str + id: str + statusReason: str + + + class azure.mgmt.datatransfer.types.Schema(TypedDict, total=False): + key "connectionId": str + key "content": str + key "direction": Union[str, Direction] + key "id": str + key "name": str + key "schemaType": Union[str, SchemaType] + key "schemaUri": str + key "status": Union[str, SchemaStatus] + connectionId: str + content: str + direction: Union[str, Direction] + id: str + name: str + schemaType: Union[str, SchemaType] + schemaUri: str + status: Union[str, SchemaStatus] + + + class azure.mgmt.datatransfer.types.SelectedResource(TypedDict, total=False): + key "id": Required[str] + key "location": str + key "name": str + key "subscriptionName": str + id: str + location: str + name: str + subscriptionName: str + + + class azure.mgmt.datatransfer.types.SetDestinationEndpointPorts(TypedDict, total=False): + ports: list[int] + + + class azure.mgmt.datatransfer.types.SetDestinationEndpoints(TypedDict, total=False): + endpoints: list[str] + + + class azure.mgmt.datatransfer.types.SetSourceAddresses(TypedDict, total=False): + values: list[str] + + + class azure.mgmt.datatransfer.types.SetStreamPassphrase(TypedDict, total=False): + key "value": str + value: str + + + class azure.mgmt.datatransfer.types.StreamSourceAddresses(TypedDict, total=False): + sourceAddresses: list[str] + + + class azure.mgmt.datatransfer.types.Subscriber(TypedDict, total=False): + key "email": str + key "notifications": int + email: str + notifications: int + + + class azure.mgmt.datatransfer.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.datatransfer.types.TextMatchingRuleset(TypedDict, total=False): + deny: list[TextMatchingRulesetDeny] + + + class azure.mgmt.datatransfer.types.TextMatchingRulesetDeny(TypedDict, total=False): + key "caseSensitivity": Required[Union[str, Casing]] + key "matchType": Required[Union[str, MatchType]] + key "text": Required[str] + caseSensitivity: Union[str, Casing] + matchType: Union[str, MatchType] + text: str + + + class azure.mgmt.datatransfer.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.datatransfer.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + clientId: str + principalId: str + + + class azure.mgmt.datatransfer.types.XmlFilterRuleset(TypedDict, total=False): + key "defaultNamespace": str + key "reference": Union[str, XmlReferenceType] + key "schema": str + defaultNamespace: str + reference: Union[str, XmlReferenceType] + schema: str + + +``` \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/api.metadata.yml b/sdk/azuredatatransfer/azure-mgmt-datatransfer/api.metadata.yml new file mode 100644 index 000000000000..ae214ca0fb8e --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/api.metadata.yml @@ -0,0 +1,4 @@ +apiMdSha256: a0129601cff5eb7502e930c5f245555fe0fb3a36f907011d0f28fcd846f7f875 +packageVersion: 1.0.0b1 +parserVersion: 0.3.31 +pythonVersion: 3.13.16 diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/apiview-properties.json b/sdk/azuredatatransfer/azure-mgmt-datatransfer/apiview-properties.json new file mode 100644 index 000000000000..eae2d501a7cf --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/apiview-properties.json @@ -0,0 +1,204 @@ +{ + "CrossLanguagePackageId": "Microsoft.AzureDataTransfer", + "CrossLanguageDefinitionId": { + "azure.mgmt.datatransfer.models.Action": "Microsoft.AzureDataTransfer.Action", + "azure.mgmt.datatransfer.models.AntivirusRuleset": "Microsoft.AzureDataTransfer.AntivirusRuleset", + "azure.mgmt.datatransfer.models.ApiFlowOptions": "Microsoft.AzureDataTransfer.ApiFlowOptions", + "azure.mgmt.datatransfer.models.ArchiveRuleset": "Microsoft.AzureDataTransfer.ArchiveRuleset", + "azure.mgmt.datatransfer.models.Authentication": "Microsoft.AzureDataTransfer.Authentication", + "azure.mgmt.datatransfer.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.datatransfer.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.datatransfer.models.Connection": "Microsoft.AzureDataTransfer.Connection", + "azure.mgmt.datatransfer.models.ConnectionIdList": "Microsoft.AzureDataTransfer.ConnectionIdList", + "azure.mgmt.datatransfer.models.ConnectionProperties": "Microsoft.AzureDataTransfer.ConnectionProperties", + "azure.mgmt.datatransfer.models.ConnectionsPatch": "Microsoft.AzureDataTransfer.ConnectionsPatch", + "azure.mgmt.datatransfer.models.DataSizeRuleset": "Microsoft.AzureDataTransfer.DataSizeRuleset", + "azure.mgmt.datatransfer.models.DirectionSettings": "Microsoft.AzureDataTransfer.DirectionSettings", + "azure.mgmt.datatransfer.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.datatransfer.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.datatransfer.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.datatransfer.models.Flow": "Microsoft.AzureDataTransfer.Flow", + "azure.mgmt.datatransfer.models.FlowProfile": "Microsoft.AzureDataTransfer.FlowProfile", + "azure.mgmt.datatransfer.models.FlowProfileMetadata": "Microsoft.AzureDataTransfer.FlowProfileMetadata", + "azure.mgmt.datatransfer.models.FlowProfilePatch": "Microsoft.AzureDataTransfer.FlowProfilePatch", + "azure.mgmt.datatransfer.models.FlowProfilePatchProperties": "Microsoft.AzureDataTransfer.FlowProfilePatchProperties", + "azure.mgmt.datatransfer.models.FlowProfileProperties": "Microsoft.AzureDataTransfer.FlowProfileProperties", + "azure.mgmt.datatransfer.models.FlowProfileRulesets": "Microsoft.AzureDataTransfer.FlowProfileRulesets", + "azure.mgmt.datatransfer.models.FlowProfilesListResult": "Microsoft.AzureDataTransfer.FlowProfilesListResult", + "azure.mgmt.datatransfer.models.FlowProperties": "Microsoft.AzureDataTransfer.FlowProperties", + "azure.mgmt.datatransfer.models.FlowsPatch": "Microsoft.AzureDataTransfer.FlowsPatch", + "azure.mgmt.datatransfer.models.FlowsPatchProperties": "Microsoft.AzureDataTransfer.FlowsPatchProperties", + "azure.mgmt.datatransfer.models.GetDestinationEndpointPortsResult": "Microsoft.AzureDataTransfer.GetDestinationEndpointPortsResult", + "azure.mgmt.datatransfer.models.GetDestinationEndpointsResult": "Microsoft.AzureDataTransfer.GetDestinationEndpointsResult", + "azure.mgmt.datatransfer.models.GetStreamConnectionStringResult": "Microsoft.AzureDataTransfer.GetStreamConnectionStringResult", + "azure.mgmt.datatransfer.models.InternalMetadataProperties": "Microsoft.AzureDataTransfer.InternalMetadataProperties", + "azure.mgmt.datatransfer.models.ListApprovedSchemasRequest": "Microsoft.AzureDataTransfer.ListApprovedSchemasRequest", + "azure.mgmt.datatransfer.models.ListFlowProfilesRequest": "Microsoft.AzureDataTransfer.ListFlowProfilesRequest", + "azure.mgmt.datatransfer.models.ListFlowsByPipelineConnection": "Microsoft.AzureDataTransfer.ListFlowsByPipelineConnection", + "azure.mgmt.datatransfer.models.ListFlowsByPipelineResult": "Microsoft.AzureDataTransfer.ListFlowsByPipelineResult", + "azure.mgmt.datatransfer.models.ListParameterBody": "Microsoft.AzureDataTransfer.list.Parameter.body.anonymous", + "azure.mgmt.datatransfer.models.ListPipelineMetadataRequest": "Microsoft.AzureDataTransfer.ListPipelineMetadataRequest", + "azure.mgmt.datatransfer.models.ListPipelineMetadataResult": "Microsoft.AzureDataTransfer.ListPipelineMetadataResult", + "azure.mgmt.datatransfer.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.datatransfer.models.MessagingOptions": "Microsoft.AzureDataTransfer.MessagingOptions", + "azure.mgmt.datatransfer.models.MimeFilterRuleset": "Microsoft.AzureDataTransfer.MimeFilterRuleset", + "azure.mgmt.datatransfer.models.MimeTypeFilter": "Microsoft.AzureDataTransfer.MimeTypeFilter", + "azure.mgmt.datatransfer.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.datatransfer.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.datatransfer.models.OperationStatusProperties": "Microsoft.AzureDataTransfer.OperationStatusProperties", + "azure.mgmt.datatransfer.models.PendingConnection": "Microsoft.AzureDataTransfer.PendingConnection", + "azure.mgmt.datatransfer.models.PendingFlow": "Microsoft.AzureDataTransfer.PendingFlow", + "azure.mgmt.datatransfer.models.Pipeline": "Microsoft.AzureDataTransfer.Pipeline", + "azure.mgmt.datatransfer.models.PipelineConnectionProperties": "Microsoft.AzureDataTransfer.PipelineConnectionProperties", + "azure.mgmt.datatransfer.models.PipelineProperties": "Microsoft.AzureDataTransfer.PipelineProperties", + "azure.mgmt.datatransfer.models.PipelinesPatch": "Microsoft.AzureDataTransfer.PipelinesPatch", + "azure.mgmt.datatransfer.models.PipelinesPatchProperties": "Microsoft.AzureDataTransfer.PipelinesPatchProperties", + "azure.mgmt.datatransfer.models.Plan": "Azure.ResourceManager.CommonTypes.Plan", + "azure.mgmt.datatransfer.models.ReadPipelineConnection": "Microsoft.AzureDataTransfer.ReadPipelineConnection", + "azure.mgmt.datatransfer.models.RemoteEndpointSettings": "Microsoft.AzureDataTransfer.RemoteEndpointSettings", + "azure.mgmt.datatransfer.models.ResourceBody": "Microsoft.AzureDataTransfer.ResourceBody", + "azure.mgmt.datatransfer.models.Schema": "Microsoft.AzureDataTransfer.Schema", + "azure.mgmt.datatransfer.models.SchemasListResult": "Microsoft.AzureDataTransfer.SchemasListResult", + "azure.mgmt.datatransfer.models.SelectedResource": "Microsoft.AzureDataTransfer.SelectedResource", + "azure.mgmt.datatransfer.models.SetDestinationEndpointPorts": "Microsoft.AzureDataTransfer.SetDestinationEndpointPorts", + "azure.mgmt.datatransfer.models.SetDestinationEndpoints": "Microsoft.AzureDataTransfer.SetDestinationEndpoints", + "azure.mgmt.datatransfer.models.SetSourceAddresses": "Microsoft.AzureDataTransfer.SetSourceAddresses", + "azure.mgmt.datatransfer.models.SetStreamPassphrase": "Microsoft.AzureDataTransfer.SetStreamPassphrase", + "azure.mgmt.datatransfer.models.StreamSourceAddresses": "Microsoft.AzureDataTransfer.StreamSourceAddresses", + "azure.mgmt.datatransfer.models.Subscriber": "Microsoft.AzureDataTransfer.Subscriber", + "azure.mgmt.datatransfer.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.datatransfer.models.TextMatchingRuleset": "Microsoft.AzureDataTransfer.TextMatchingRuleset", + "azure.mgmt.datatransfer.models.TextMatchingRulesetDeny": "Microsoft.AzureDataTransfer.TextMatchingRuleset.deny.anonymous", + "azure.mgmt.datatransfer.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.datatransfer.models.ValidateSchemaResult": "Microsoft.AzureDataTransfer.ValidateSchemaResult", + "azure.mgmt.datatransfer.models.XmlFilterRuleset": "Microsoft.AzureDataTransfer.XmlFilterRuleset", + "azure.mgmt.datatransfer.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.datatransfer.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.datatransfer.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.datatransfer.models.ProvisioningState": "Microsoft.AzureDataTransfer.ProvisioningState", + "azure.mgmt.datatransfer.models.DataClassType": "Microsoft.AzureDataTransfer.DataClassType", + "azure.mgmt.datatransfer.models.FlowProfileStatus": "Microsoft.AzureDataTransfer.FlowProfileStatus", + "azure.mgmt.datatransfer.models.AntivirusSolutions": "Microsoft.AzureDataTransfer.AntivirusSolutions", + "azure.mgmt.datatransfer.models.FilterType": "Microsoft.AzureDataTransfer.FilterType", + "azure.mgmt.datatransfer.models.XmlReferenceType": "Microsoft.AzureDataTransfer.XmlReferenceType", + "azure.mgmt.datatransfer.models.MatchType": "Microsoft.AzureDataTransfer.MatchType", + "azure.mgmt.datatransfer.models.Casing": "Microsoft.AzureDataTransfer.Casing", + "azure.mgmt.datatransfer.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "azure.mgmt.datatransfer.models.OperationStatusEnum": "Microsoft.AzureDataTransfer.OperationStatusEnum", + "azure.mgmt.datatransfer.models.FlowType": "Microsoft.AzureDataTransfer.FlowType", + "azure.mgmt.datatransfer.models.DataClass": "Microsoft.AzureDataTransfer.DataClass", + "azure.mgmt.datatransfer.models.PipelineStatus": "Microsoft.AzureDataTransfer.PipelineStatus", + "azure.mgmt.datatransfer.models.Direction": "Microsoft.AzureDataTransfer.Direction", + "azure.mgmt.datatransfer.models.ConnectionStatus": "Microsoft.AzureDataTransfer.ConnectionStatus", + "azure.mgmt.datatransfer.models.ForceDisabledStatus": "Microsoft.AzureDataTransfer.ForceDisabledStatus", + "azure.mgmt.datatransfer.models.LinkStatus": "Microsoft.AzureDataTransfer.LinkStatus", + "azure.mgmt.datatransfer.models.SchemaStatus": "Microsoft.AzureDataTransfer.SchemaStatus", + "azure.mgmt.datatransfer.models.SchemaType": "Microsoft.AzureDataTransfer.SchemaType", + "azure.mgmt.datatransfer.models.DateTransferActionType": "Microsoft.AzureDataTransfer.ActionType", + "azure.mgmt.datatransfer.models.TargetType": "Microsoft.AzureDataTransfer.TargetType", + "azure.mgmt.datatransfer.models.FlowStatus": "Microsoft.AzureDataTransfer.FlowStatus", + "azure.mgmt.datatransfer.models.DataType": "Microsoft.AzureDataTransfer.DataType", + "azure.mgmt.datatransfer.models.FlowBillingTier": "Microsoft.AzureDataTransfer.FlowBillingTier", + "azure.mgmt.datatransfer.models.EnablementStatus": "Microsoft.AzureDataTransfer.EnablementStatus", + "azure.mgmt.datatransfer.models.ApiMode": "Microsoft.AzureDataTransfer.ApiMode", + "azure.mgmt.datatransfer.models.IdentityTranslation": "Microsoft.AzureDataTransfer.IdentityTranslation", + "azure.mgmt.datatransfer.models.AuthenticationType": "Microsoft.AzureDataTransfer.AuthenticationType", + "azure.mgmt.datatransfer.models.StreamProtocol": "Microsoft.AzureDataTransfer.StreamProtocol", + "azure.mgmt.datatransfer.models.ValidateSchemaStatus": "Microsoft.AzureDataTransfer.ValidateSchemaStatus", + "azure.mgmt.datatransfer.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.datatransfer.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.datatransfer.operations.FlowProfilesOperations.get": "Microsoft.AzureDataTransfer.FlowProfiles.get", + "azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations.get": "Microsoft.AzureDataTransfer.FlowProfiles.get", + "azure.mgmt.datatransfer.operations.FlowProfilesOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.FlowProfiles.createOrUpdate", + "azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.FlowProfiles.createOrUpdate", + "azure.mgmt.datatransfer.operations.FlowProfilesOperations.begin_update": "Microsoft.AzureDataTransfer.FlowProfiles.update", + "azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations.begin_update": "Microsoft.AzureDataTransfer.FlowProfiles.update", + "azure.mgmt.datatransfer.operations.FlowProfilesOperations.begin_delete": "Microsoft.AzureDataTransfer.FlowProfiles.delete", + "azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations.begin_delete": "Microsoft.AzureDataTransfer.FlowProfiles.delete", + "azure.mgmt.datatransfer.operations.FlowProfilesOperations.list_by_pipeline": "Microsoft.AzureDataTransfer.FlowProfiles.listByPipeline", + "azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations.list_by_pipeline": "Microsoft.AzureDataTransfer.FlowProfiles.listByPipeline", + "azure.mgmt.datatransfer.operations.PipelinesOperations.get": "Microsoft.AzureDataTransfer.Pipelines.get", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.get": "Microsoft.AzureDataTransfer.Pipelines.get", + "azure.mgmt.datatransfer.operations.PipelinesOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.Pipelines.createOrUpdate", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.Pipelines.createOrUpdate", + "azure.mgmt.datatransfer.operations.PipelinesOperations.begin_update": "Microsoft.AzureDataTransfer.Pipelines.update", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.begin_update": "Microsoft.AzureDataTransfer.Pipelines.update", + "azure.mgmt.datatransfer.operations.PipelinesOperations.begin_delete": "Microsoft.AzureDataTransfer.Pipelines.delete", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.begin_delete": "Microsoft.AzureDataTransfer.Pipelines.delete", + "azure.mgmt.datatransfer.operations.PipelinesOperations.list_by_resource_group": "Microsoft.AzureDataTransfer.Pipelines.listByResourceGroup", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.list_by_resource_group": "Microsoft.AzureDataTransfer.Pipelines.listByResourceGroup", + "azure.mgmt.datatransfer.operations.PipelinesOperations.list_by_subscription": "Microsoft.AzureDataTransfer.Pipelines.listBySubscription", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.list_by_subscription": "Microsoft.AzureDataTransfer.Pipelines.listBySubscription", + "azure.mgmt.datatransfer.operations.PipelinesOperations.begin_approve_connection": "Microsoft.AzureDataTransfer.Pipelines.approveConnection", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.begin_approve_connection": "Microsoft.AzureDataTransfer.Pipelines.approveConnection", + "azure.mgmt.datatransfer.operations.PipelinesOperations.begin_execute_action": "Microsoft.AzureDataTransfer.Pipelines.executeAction", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.begin_execute_action": "Microsoft.AzureDataTransfer.Pipelines.executeAction", + "azure.mgmt.datatransfer.operations.PipelinesOperations.list": "Microsoft.AzureDataTransfer.Pipelines.list", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.list": "Microsoft.AzureDataTransfer.Pipelines.list", + "azure.mgmt.datatransfer.operations.PipelinesOperations.list_schemas_list": "Microsoft.AzureDataTransfer.Pipelines.listSchemasList", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.list_schemas_list": "Microsoft.AzureDataTransfer.Pipelines.listSchemasList", + "azure.mgmt.datatransfer.operations.PipelinesOperations.begin_reject_connection": "Microsoft.AzureDataTransfer.Pipelines.rejectConnection", + "azure.mgmt.datatransfer.aio.operations.PipelinesOperations.begin_reject_connection": "Microsoft.AzureDataTransfer.Pipelines.rejectConnection", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.get": "Microsoft.AzureDataTransfer.Connections.get", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.get": "Microsoft.AzureDataTransfer.Connections.get", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.Connections.createOrUpdate", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.Connections.createOrUpdate", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.begin_update": "Microsoft.AzureDataTransfer.Connections.update", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.begin_update": "Microsoft.AzureDataTransfer.Connections.update", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.begin_delete": "Microsoft.AzureDataTransfer.Connections.delete", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.begin_delete": "Microsoft.AzureDataTransfer.Connections.delete", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.list_by_resource_group": "Microsoft.AzureDataTransfer.Connections.listByResourceGroup", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.list_by_resource_group": "Microsoft.AzureDataTransfer.Connections.listByResourceGroup", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.list_by_subscription": "Microsoft.AzureDataTransfer.Connections.listBySubscription", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.list_by_subscription": "Microsoft.AzureDataTransfer.Connections.listBySubscription", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.begin_link": "Microsoft.AzureDataTransfer.Connections.link", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.begin_link": "Microsoft.AzureDataTransfer.Connections.link", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.list": "Microsoft.AzureDataTransfer.Connections.list", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.list": "Microsoft.AzureDataTransfer.Connections.list", + "azure.mgmt.datatransfer.operations.ConnectionsOperations.list_pending_flows_list": "Microsoft.AzureDataTransfer.Connections.listPendingFlowsList", + "azure.mgmt.datatransfer.aio.operations.ConnectionsOperations.list_pending_flows_list": "Microsoft.AzureDataTransfer.Connections.listPendingFlowsList", + "azure.mgmt.datatransfer.operations.FlowsOperations.get": "Microsoft.AzureDataTransfer.Flows.get", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.get": "Microsoft.AzureDataTransfer.Flows.get", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.Flows.createOrUpdate", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_create_or_update": "Microsoft.AzureDataTransfer.Flows.createOrUpdate", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_update": "Microsoft.AzureDataTransfer.Flows.update", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_update": "Microsoft.AzureDataTransfer.Flows.update", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_delete": "Microsoft.AzureDataTransfer.Flows.delete", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_delete": "Microsoft.AzureDataTransfer.Flows.delete", + "azure.mgmt.datatransfer.operations.FlowsOperations.list_by_connection": "Microsoft.AzureDataTransfer.Flows.listByConnection", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.list_by_connection": "Microsoft.AzureDataTransfer.Flows.listByConnection", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_disable": "Microsoft.AzureDataTransfer.Flows.disable", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_disable": "Microsoft.AzureDataTransfer.Flows.disable", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_enable": "Microsoft.AzureDataTransfer.Flows.enable", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_enable": "Microsoft.AzureDataTransfer.Flows.enable", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_generate_passphrase": "Microsoft.AzureDataTransfer.Flows.generatePassphrase", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_generate_passphrase": "Microsoft.AzureDataTransfer.Flows.generatePassphrase", + "azure.mgmt.datatransfer.operations.FlowsOperations.get_destination_endpoint_ports": "Microsoft.AzureDataTransfer.Flows.getDestinationEndpointPorts", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.get_destination_endpoint_ports": "Microsoft.AzureDataTransfer.Flows.getDestinationEndpointPorts", + "azure.mgmt.datatransfer.operations.FlowsOperations.get_destination_endpoints": "Microsoft.AzureDataTransfer.Flows.getDestinationEndpoints", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.get_destination_endpoints": "Microsoft.AzureDataTransfer.Flows.getDestinationEndpoints", + "azure.mgmt.datatransfer.operations.FlowsOperations.get_source_addresses": "Microsoft.AzureDataTransfer.Flows.getSourceAddresses", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.get_source_addresses": "Microsoft.AzureDataTransfer.Flows.getSourceAddresses", + "azure.mgmt.datatransfer.operations.FlowsOperations.get_stream_connection_string": "Microsoft.AzureDataTransfer.Flows.getStreamConnectionString", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.get_stream_connection_string": "Microsoft.AzureDataTransfer.Flows.getStreamConnectionString", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_link": "Microsoft.AzureDataTransfer.Flows.link", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_link": "Microsoft.AzureDataTransfer.Flows.link", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_set_destination_endpoint_ports": "Microsoft.AzureDataTransfer.Flows.setDestinationEndpointPorts", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_set_destination_endpoint_ports": "Microsoft.AzureDataTransfer.Flows.setDestinationEndpointPorts", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_set_destination_endpoints": "Microsoft.AzureDataTransfer.Flows.setDestinationEndpoints", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_set_destination_endpoints": "Microsoft.AzureDataTransfer.Flows.setDestinationEndpoints", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_set_passphrase": "Microsoft.AzureDataTransfer.Flows.setPassphrase", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_set_passphrase": "Microsoft.AzureDataTransfer.Flows.setPassphrase", + "azure.mgmt.datatransfer.operations.FlowsOperations.begin_set_source_addresses": "Microsoft.AzureDataTransfer.Flows.setSourceAddresses", + "azure.mgmt.datatransfer.aio.operations.FlowsOperations.begin_set_source_addresses": "Microsoft.AzureDataTransfer.Flows.setSourceAddresses", + "azure.mgmt.datatransfer.operations.AzureDataTransferOperations.list_approved_schemas": "Microsoft.AzureDataTransfer.AzureDataTransfer.listApprovedSchemas", + "azure.mgmt.datatransfer.aio.operations.AzureDataTransferOperations.list_approved_schemas": "Microsoft.AzureDataTransfer.AzureDataTransfer.listApprovedSchemas", + "azure.mgmt.datatransfer.operations.AzureDataTransferOperations.list_flow_profiles": "Microsoft.AzureDataTransfer.AzureDataTransfer.listFlowProfiles", + "azure.mgmt.datatransfer.aio.operations.AzureDataTransferOperations.list_flow_profiles": "Microsoft.AzureDataTransfer.AzureDataTransfer.listFlowProfiles", + "azure.mgmt.datatransfer.operations.AzureDataTransferOperations.validate_schema": "Microsoft.AzureDataTransfer.AzureDataTransfer.validateSchema", + "azure.mgmt.datatransfer.aio.operations.AzureDataTransferOperations.validate_schema": "Microsoft.AzureDataTransfer.AzureDataTransfer.validateSchema", + "azure.mgmt.datatransfer.operations.AzureDataTransferOperations.list_pipeline_metadata": "Microsoft.AzureDataTransfer.AzureDataTransfer.listPipelineMetadata", + "azure.mgmt.datatransfer.aio.operations.AzureDataTransferOperations.list_pipeline_metadata": "Microsoft.AzureDataTransfer.AzureDataTransfer.listPipelineMetadata" + }, + "CrossLanguageVersion": "011d300cbd38" +} \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/__init__.py new file mode 100644 index 000000000000..04981ebdb430 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import DataTransferMgmtClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataTransferMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_client.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_client.py new file mode 100644 index 000000000000..ba6c9fa0817c --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_client.py @@ -0,0 +1,164 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from ._configuration import DataTransferMgmtClientConfiguration +from ._utils.serialization import Deserializer, Serializer +from .operations import ( + AzureDataTransferOperations, + ConnectionsOperations, + FlowProfilesOperations, + FlowsOperations, + Operations, + PipelinesOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class DataTransferMgmtClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """DataTransferMgmtClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datatransfer.operations.Operations + :ivar flow_profiles: FlowProfilesOperations operations + :vartype flow_profiles: azure.mgmt.datatransfer.operations.FlowProfilesOperations + :ivar pipelines: PipelinesOperations operations + :vartype pipelines: azure.mgmt.datatransfer.operations.PipelinesOperations + :ivar connections: ConnectionsOperations operations + :vartype connections: azure.mgmt.datatransfer.operations.ConnectionsOperations + :ivar flows: FlowsOperations operations + :vartype flows: azure.mgmt.datatransfer.operations.FlowsOperations + :ivar azure_data_transfer: AzureDataTransferOperations operations + :vartype azure_data_transfer: azure.mgmt.datatransfer.operations.AzureDataTransferOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-02-06-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = DataTransferMgmtClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.flow_profiles = FlowProfilesOperations(self._client, self._config, self._serialize, self._deserialize) + self.pipelines = PipelinesOperations(self._client, self._config, self._serialize, self._deserialize) + self.connections = ConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.flows = FlowsOperations(self._client, self._config, self._serialize, self._deserialize) + self.azure_data_transfer = AzureDataTransferOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_configuration.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_configuration.py new file mode 100644 index 000000000000..cc6be69356fb --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_configuration.py @@ -0,0 +1,82 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class DataTransferMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for DataTransferMgmtClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-02-06-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2026-02-06-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-datatransfer/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_patch.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/model_base.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/model_base.py new file mode 100644 index 000000000000..88aaf1823543 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/model_base.py @@ -0,0 +1,1805 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on the mapping's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on the mapping's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: a set-like object providing a view on the mapping's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if the dictionary is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from the dictionary. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Update the dictionary from a mapping or an iterable of key-value pairs. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + dict_to_pass.update(self._init_from_xml(args[0])) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) + super().__init__(dict_to_pass) + + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + original_tsp_name: typing.Optional[str] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + self._original_tsp_name = original_tsp_name + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + original_tsp_name: typing.Optional[str] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + original_tsp_name=original_tsp_name, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) + wrapped_element = _create_xml_element( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _set_xml_attribute(wrapped_element, k, v, prop_meta) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/serialization.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/serialization.py new file mode 100644 index 000000000000..ae08f9d89f74 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_utils/serialization.py @@ -0,0 +1,2179 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized |= target_obj.additional_properties + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(list[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_validation.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_version.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_version.py new file mode 100644 index 000000000000..be71c81bd282 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/__init__.py new file mode 100644 index 000000000000..97795e24d3d8 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import DataTransferMgmtClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataTransferMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_client.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_client.py new file mode 100644 index 000000000000..3133eebab688 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_client.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from .._utils.serialization import Deserializer, Serializer +from ._configuration import DataTransferMgmtClientConfiguration +from .operations import ( + AzureDataTransferOperations, + ConnectionsOperations, + FlowProfilesOperations, + FlowsOperations, + Operations, + PipelinesOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class DataTransferMgmtClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """DataTransferMgmtClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datatransfer.aio.operations.Operations + :ivar flow_profiles: FlowProfilesOperations operations + :vartype flow_profiles: azure.mgmt.datatransfer.aio.operations.FlowProfilesOperations + :ivar pipelines: PipelinesOperations operations + :vartype pipelines: azure.mgmt.datatransfer.aio.operations.PipelinesOperations + :ivar connections: ConnectionsOperations operations + :vartype connections: azure.mgmt.datatransfer.aio.operations.ConnectionsOperations + :ivar flows: FlowsOperations operations + :vartype flows: azure.mgmt.datatransfer.aio.operations.FlowsOperations + :ivar azure_data_transfer: AzureDataTransferOperations operations + :vartype azure_data_transfer: + azure.mgmt.datatransfer.aio.operations.AzureDataTransferOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-02-06-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = DataTransferMgmtClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.flow_profiles = FlowProfilesOperations(self._client, self._config, self._serialize, self._deserialize) + self.pipelines = PipelinesOperations(self._client, self._config, self._serialize, self._deserialize) + self.connections = ConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.flows = FlowsOperations(self._client, self._config, self._serialize, self._deserialize) + self.azure_data_transfer = AzureDataTransferOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_configuration.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_configuration.py new file mode 100644 index 000000000000..cbb8cb38f076 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_configuration.py @@ -0,0 +1,82 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class DataTransferMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for DataTransferMgmtClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-02-06-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2026-02-06-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-datatransfer/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_patch.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/__init__.py new file mode 100644 index 000000000000..c10849cb4a3f --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/__init__.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import FlowProfilesOperations # type: ignore +from ._operations import PipelinesOperations # type: ignore +from ._operations import ConnectionsOperations # type: ignore +from ._operations import FlowsOperations # type: ignore +from ._operations import AzureDataTransferOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "FlowProfilesOperations", + "PipelinesOperations", + "ConnectionsOperations", + "FlowsOperations", + "AzureDataTransferOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_operations.py new file mode 100644 index 000000000000..40cce6d4768c --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_operations.py @@ -0,0 +1,7687 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation +from ...operations._operations import ( + build_azure_data_transfer_list_approved_schemas_request, + build_azure_data_transfer_list_flow_profiles_request, + build_azure_data_transfer_list_pipeline_metadata_request, + build_azure_data_transfer_validate_schema_request, + build_connections_create_or_update_request, + build_connections_delete_request, + build_connections_get_request, + build_connections_link_request, + build_connections_list_by_resource_group_request, + build_connections_list_by_subscription_request, + build_connections_list_pending_flows_list_request, + build_connections_list_request, + build_connections_update_request, + build_flow_profiles_create_or_update_request, + build_flow_profiles_delete_request, + build_flow_profiles_get_request, + build_flow_profiles_list_by_pipeline_request, + build_flow_profiles_update_request, + build_flows_create_or_update_request, + build_flows_delete_request, + build_flows_disable_request, + build_flows_enable_request, + build_flows_generate_passphrase_request, + build_flows_get_destination_endpoint_ports_request, + build_flows_get_destination_endpoints_request, + build_flows_get_request, + build_flows_get_source_addresses_request, + build_flows_get_stream_connection_string_request, + build_flows_link_request, + build_flows_list_by_connection_request, + build_flows_set_destination_endpoint_ports_request, + build_flows_set_destination_endpoints_request, + build_flows_set_passphrase_request, + build_flows_set_source_addresses_request, + build_flows_update_request, + build_operations_list_request, + build_pipelines_approve_connection_request, + build_pipelines_create_or_update_request, + build_pipelines_delete_request, + build_pipelines_execute_action_request, + build_pipelines_get_request, + build_pipelines_list_by_resource_group_request, + build_pipelines_list_by_subscription_request, + build_pipelines_list_request, + build_pipelines_list_schemas_list_request, + build_pipelines_reject_connection_request, + build_pipelines_update_request, +) +from .._configuration import DataTransferMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.aio.DataTransferMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FlowProfilesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.aio.DataTransferMgmtClient`'s + :attr:`flow_profiles` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def get( + self, resource_group_name: str, pipeline_name: str, flow_profile_name: str, **kwargs: Any + ) -> _models.FlowProfile: + """Retrieves the specified FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :return: FlowProfile. The FlowProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FlowProfile] = kwargs.pop("cls", None) + + _request = build_flow_profiles_get_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FlowProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: Union[_models.FlowProfile, _types.FlowProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flow_profiles_create_or_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: _models.FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Required. + :type resource: ~azure.mgmt.datatransfer.models.FlowProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: _types.FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Required. + :type resource: ~azure.mgmt.datatransfer.types.FlowProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: Union[_models.FlowProfile, _types.FlowProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Is either a + FlowProfile type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.datatransfer.models.FlowProfile or + ~azure.mgmt.datatransfer.types.FlowProfile or IO[bytes] + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowProfile] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FlowProfile, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowProfile].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowProfile]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def _update_initial( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: Union[_models.FlowProfilePatch, _types.FlowProfilePatch, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flow_profiles_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: _models.FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. + Required. + :type properties: ~azure.mgmt.datatransfer.models.FlowProfilePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: _types.FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. + Required. + :type properties: ~azure.mgmt.datatransfer.types.FlowProfilePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. + Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: Union[_models.FlowProfilePatch, _types.FlowProfilePatch, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. Is + either a FlowProfilePatch type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.datatransfer.models.FlowProfilePatch or + ~azure.mgmt.datatransfer.types.FlowProfilePatch or IO[bytes] + :return: An instance of AsyncLROPoller that returns FlowProfile. The FlowProfile is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowProfile] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FlowProfile, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowProfile].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowProfile]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, pipeline_name: str, flow_profile_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flow_profiles_delete_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + async def begin_delete( + self, resource_group_name: str, pipeline_name: str, flow_profile_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": ["api_version", "subscription_id", "resource_group_name", "pipeline_name", "accept"] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def list_by_pipeline( + self, resource_group_name: str, pipeline_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FlowProfile"]: + """Lists all FlowProfiles under a given Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :return: An iterator like instance of FlowProfile + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FlowProfile]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flow_profiles_list_by_pipeline_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FlowProfile], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PipelinesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.aio.DataTransferMgmtClient`'s + :attr:`pipelines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, pipeline_name: str, **kwargs: Any) -> _models.Pipeline: + """Retrieves the specified Pipeline resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :return: Pipeline. The Pipeline is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.Pipeline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Pipeline] = kwargs.pop("cls", None) + + _request = build_pipelines_get_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Pipeline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.Pipeline, _types.Pipeline, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pipeline, (IOBase, bytes)): + _content = pipeline + else: + _content = json.dumps(pipeline, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_create_or_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _models.Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.Pipeline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _types.Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Required. + :type pipeline: ~azure.mgmt.datatransfer.types.Pipeline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Required. + :type pipeline: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.Pipeline, _types.Pipeline, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Is either a Pipeline type + or a IO[bytes] type. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.Pipeline or + ~azure.mgmt.datatransfer.types.Pipeline or IO[bytes] + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pipeline] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + pipeline=pipeline, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pipeline, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Pipeline].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Pipeline]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.PipelinesPatch, _types.PipelinesPatch, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pipeline, (IOBase, bytes)): + _content = pipeline + else: + _content = json.dumps(pipeline, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _models.PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.PipelinesPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _types.PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Required. + :type pipeline: ~azure.mgmt.datatransfer.types.PipelinesPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Required. + :type pipeline: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.PipelinesPatch, _types.PipelinesPatch, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Is either a + PipelinesPatch type or a IO[bytes] type. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.PipelinesPatch or + ~azure.mgmt.datatransfer.types.PipelinesPatch or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + pipeline=pipeline, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_initial( + self, resource_group_name: str, pipeline_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_pipelines_delete_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, pipeline_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified Pipeline resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Pipeline"]: + """Lists all Pipeline resources within the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Pipeline + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pipeline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_pipelines_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Pipeline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Pipeline"]: + """Lists all Pipeline resources within the current subscription. + + :return: An iterator like instance of Pipeline + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pipeline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_pipelines_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Pipeline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _approve_connection_initial( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_approve_connection_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Required. + :type connection: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Is either a + ResourceBody type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._approve_connection_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _execute_action_initial( + self, + resource_group_name: str, + pipeline_name: str, + action: Union[_models.Action, _types.Action, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(action, (IOBase, bytes)): + _content = action + else: + _content = json.dumps(action, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_execute_action_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: _models.Action, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Required. + :type action: ~azure.mgmt.datatransfer.models.Action + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: _types.Action, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Required. + :type action: ~azure.mgmt.datatransfer.types.Action + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Required. + :type action: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: Union[_models.Action, _types.Action, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Is either a Action type or a + IO[bytes] type. Required. + :type action: ~azure.mgmt.datatransfer.models.Action or ~azure.mgmt.datatransfer.types.Action + or IO[bytes] + :return: An instance of AsyncLROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pipeline] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._execute_action_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + action=action, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pipeline, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Pipeline].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Pipeline]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[_models.ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Default value is None. + :type connections: ~azure.mgmt.datatransfer.models.ConnectionIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[_types.ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Default value is None. + :type connections: ~azure.mgmt.datatransfer.types.ConnectionIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Default value is None. + :type connections: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[Union[_models.ConnectionIdList, _types.ConnectionIdList, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Is either a ConnectionIdList type or a IO[bytes] type. Default value is None. + :type connections: ~azure.mgmt.datatransfer.models.ConnectionIdList or + ~azure.mgmt.datatransfer.types.ConnectionIdList or IO[bytes] + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if connections else None + cls: ClsType[_models.ListFlowsByPipelineResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if connections else None + _content = None + if isinstance(connections, (IOBase, bytes)): + _content = connections + else: + if connections is not None: + _content = json.dumps(connections, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_pipelines_list_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ListFlowsByPipelineResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: _models.Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: _types.Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Required. + :type schema: ~azure.mgmt.datatransfer.types.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Required. + :type schema: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: Union[_models.Schema, _types.Schema, IO[bytes]], + **kwargs: Any + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Is either a Schema type + or a IO[bytes] type. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema or ~azure.mgmt.datatransfer.types.Schema + or IO[bytes] + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SchemasListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(schema, (IOBase, bytes)): + _content = schema + else: + _content = json.dumps(schema, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_list_schemas_list_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemasListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _reject_connection_initial( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_reject_connection_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Required. + :type connection: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Is either a + ResourceBody type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reject_connection_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ConnectionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.aio.DataTransferMgmtClient`'s + :attr:`connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, connection_name: str, **kwargs: Any) -> _models.Connection: + """Gets connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + + _request = build_connections_get_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Connection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.Connection, _types.Connection, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_create_or_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: _models.Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.models.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: _types.Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.types.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.Connection, _types.Connection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Is either a Connection type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.datatransfer.models.Connection or + ~azure.mgmt.datatransfer.types.Connection or IO[bytes] + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ConnectionsPatch, _types.ConnectionsPatch, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: _models.ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.models.ConnectionsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: _types.ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.types.ConnectionsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ConnectionsPatch, _types.ConnectionsPatch, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Is either a ConnectionsPatch type or a IO[bytes] type. + Required. + :type connection: ~azure.mgmt.datatransfer.models.ConnectionsPatch or + ~azure.mgmt.datatransfer.types.ConnectionsPatch or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_initial( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_connections_delete_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, connection_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Connection"]: + """Gets connections in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Connection + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Connection"]: + """Gets connections in a subscription. + + :return: An iterator like instance of Connection + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _link_initial( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_link_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Is either a ResourceBody type or a IO[bytes] type. + Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of AsyncLROPoller that returns Connection. The Connection is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._link_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.PendingConnection"]: + """Lists all pending remote connections that are linkable to this connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An iterator like instance of PendingConnection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.PendingConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PendingConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PendingConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_pending_flows_list( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.PendingFlow"]: + """Lists all remote flows that have not yet been linked to local flows. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An iterator like instance of PendingFlow + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.PendingFlow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PendingFlow]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_pending_flows_list_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PendingFlow], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FlowsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.aio.DataTransferMgmtClient`'s + :attr:`flows` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any) -> _models.Flow: + """Gets flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.Flow + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + + _request = build_flows_get_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Flow, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.Flow, _types.Flow, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(flow, (IOBase, bytes)): + _content = flow + else: + _content = json.dumps(flow, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_create_or_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _models.Flow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.models.Flow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _types.Flow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.types.Flow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.Flow, _types.Flow, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Is either a Flow type or a IO[bytes] type. Required. + :type flow: ~azure.mgmt.datatransfer.models.Flow or ~azure.mgmt.datatransfer.types.Flow or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + flow=flow, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.FlowsPatch, _types.FlowsPatch, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(flow, (IOBase, bytes)): + _content = flow + else: + _content = json.dumps(flow, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _models.FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.models.FlowsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _types.FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.types.FlowsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.FlowsPatch, _types.FlowsPatch, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Is either a FlowsPatch type or a IO[bytes] type. Required. + :type flow: ~azure.mgmt.datatransfer.models.FlowsPatch or + ~azure.mgmt.datatransfer.types.FlowsPatch or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + flow=flow, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_delete_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_connection( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Flow"]: + """Gets flows in a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An iterator like instance of Flow + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Flow]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flows_list_by_connection_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Flow], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _disable_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_disable_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_disable( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Disables the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disable_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _enable_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_enable_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_enable( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Enables the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._enable_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _generate_passphrase_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_generate_passphrase_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_generate_passphrase( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Generate a compliant passphrase for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_passphrase_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_destination_endpoint_ports( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.GetDestinationEndpointPortsResult: + """Get the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: GetDestinationEndpointPortsResult. The GetDestinationEndpointPortsResult is compatible + with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.GetDestinationEndpointPortsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetDestinationEndpointPortsResult] = kwargs.pop("cls", None) + + _request = build_flows_get_destination_endpoint_ports_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GetDestinationEndpointPortsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_destination_endpoints( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.GetDestinationEndpointsResult: + """Get the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: GetDestinationEndpointsResult. The GetDestinationEndpointsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.GetDestinationEndpointsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetDestinationEndpointsResult] = kwargs.pop("cls", None) + + _request = build_flows_get_destination_endpoints_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GetDestinationEndpointsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_source_addresses( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.StreamSourceAddresses: + """Get the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: StreamSourceAddresses. The StreamSourceAddresses is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.StreamSourceAddresses + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StreamSourceAddresses] = kwargs.pop("cls", None) + + _request = build_flows_get_source_addresses_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StreamSourceAddresses, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_stream_connection_string( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.GetStreamConnectionStringResult: + """Get the connection string for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: GetStreamConnectionStringResult. The GetStreamConnectionStringResult is compatible + with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.GetStreamConnectionStringResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetStreamConnectionStringResult] = kwargs.pop("cls", None) + + _request = build_flows_get_stream_connection_string_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GetStreamConnectionStringResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _link_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(flow, (IOBase, bytes)): + _content = flow + else: + _content = json.dumps(flow, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_link_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Is either a ResourceBody type or a IO[bytes] type. Required. + :type flow: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._link_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + flow=flow, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_destination_endpoint_ports_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: Union[ + _models.SetDestinationEndpointPorts, _types.SetDestinationEndpointPorts, IO[bytes] + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(stream_destination_endpoint_ports, (IOBase, bytes)): + _content = stream_destination_endpoint_ports + else: + _content = json.dumps(stream_destination_endpoint_ports, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_destination_endpoint_ports_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: _models.SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Required. + :type stream_destination_endpoint_ports: + ~azure.mgmt.datatransfer.models.SetDestinationEndpointPorts + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: _types.SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Required. + :type stream_destination_endpoint_ports: + ~azure.mgmt.datatransfer.types.SetDestinationEndpointPorts + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Required. + :type stream_destination_endpoint_ports: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: Union[ + _models.SetDestinationEndpointPorts, _types.SetDestinationEndpointPorts, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Is either a + SetDestinationEndpointPorts type or a IO[bytes] type. Required. + :type stream_destination_endpoint_ports: + ~azure.mgmt.datatransfer.models.SetDestinationEndpointPorts or + ~azure.mgmt.datatransfer.types.SetDestinationEndpointPorts or IO[bytes] + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_destination_endpoint_ports_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + stream_destination_endpoint_ports=stream_destination_endpoint_ports, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_destination_endpoints_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: Union[_models.SetDestinationEndpoints, _types.SetDestinationEndpoints, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(stream_destination_endpoints, (IOBase, bytes)): + _content = stream_destination_endpoints + else: + _content = json.dumps(stream_destination_endpoints, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_destination_endpoints_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: _models.SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Required. + :type stream_destination_endpoints: ~azure.mgmt.datatransfer.models.SetDestinationEndpoints + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: _types.SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Required. + :type stream_destination_endpoints: ~azure.mgmt.datatransfer.types.SetDestinationEndpoints + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Required. + :type stream_destination_endpoints: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: Union[_models.SetDestinationEndpoints, _types.SetDestinationEndpoints, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Is either a + SetDestinationEndpoints type or a IO[bytes] type. Required. + :type stream_destination_endpoints: ~azure.mgmt.datatransfer.models.SetDestinationEndpoints or + ~azure.mgmt.datatransfer.types.SetDestinationEndpoints or IO[bytes] + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_destination_endpoints_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + stream_destination_endpoints=stream_destination_endpoints, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_passphrase_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: Union[_models.SetStreamPassphrase, _types.SetStreamPassphrase, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(passphrase, (IOBase, bytes)): + _content = passphrase + else: + _content = json.dumps(passphrase, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_passphrase_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: _models.SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Required. + :type passphrase: ~azure.mgmt.datatransfer.models.SetStreamPassphrase + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: _types.SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Required. + :type passphrase: ~azure.mgmt.datatransfer.types.SetStreamPassphrase + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Required. + :type passphrase: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: Union[_models.SetStreamPassphrase, _types.SetStreamPassphrase, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Is either a SetStreamPassphrase type or a IO[bytes] type. + Required. + :type passphrase: ~azure.mgmt.datatransfer.models.SetStreamPassphrase or + ~azure.mgmt.datatransfer.types.SetStreamPassphrase or IO[bytes] + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_passphrase_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + passphrase=passphrase, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_source_addresses_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: Union[_models.SetSourceAddresses, _types.SetSourceAddresses, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(source_addresses, (IOBase, bytes)): + _content = source_addresses + else: + _content = json.dumps(source_addresses, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_source_addresses_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: _models.SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Required. + :type source_addresses: ~azure.mgmt.datatransfer.models.SetSourceAddresses + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: _types.SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Required. + :type source_addresses: ~azure.mgmt.datatransfer.types.SetSourceAddresses + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Required. + :type source_addresses: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: Union[_models.SetSourceAddresses, _types.SetSourceAddresses, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Is either a SetSourceAddresses type or a + IO[bytes] type. Required. + :type source_addresses: ~azure.mgmt.datatransfer.models.SetSourceAddresses or + ~azure.mgmt.datatransfer.types.SetSourceAddresses or IO[bytes] + :return: An instance of AsyncLROPoller that returns Flow. The Flow is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_source_addresses_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + source_addresses=source_addresses, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class AzureDataTransferOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.aio.DataTransferMgmtClient`'s + :attr:`azure_data_transfer` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def list_approved_schemas( + self, pipeline: _models.ListApprovedSchemasRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.ListApprovedSchemasRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_approved_schemas( + self, pipeline: _types.ListApprovedSchemasRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Required. + :type pipeline: ~azure.mgmt.datatransfer.types.ListApprovedSchemasRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_approved_schemas( + self, pipeline: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Required. + :type pipeline: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_approved_schemas( + self, + pipeline: Union[_models.ListApprovedSchemasRequest, _types.ListApprovedSchemasRequest, IO[bytes]], + **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Is either a + ListApprovedSchemasRequest type or a IO[bytes] type. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.ListApprovedSchemasRequest or + ~azure.mgmt.datatransfer.types.ListApprovedSchemasRequest or IO[bytes] + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SchemasListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pipeline, (IOBase, bytes)): + _content = pipeline + else: + _content = json.dumps(pipeline, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_list_approved_schemas_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemasListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_flow_profiles( + self, body: _models.ListFlowProfilesRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.models.ListFlowProfilesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_flow_profiles( + self, body: _types.ListFlowProfilesRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.types.ListFlowProfilesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_flow_profiles( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-10-preview", + params_added_on={"2025-10-10-preview": ["api_version", "content_type", "accept"]}, + api_versions_list=["2025-10-10-preview", "2026-02-06-preview"], + ) + async def list_flow_profiles( + self, body: Union[_models.ListFlowProfilesRequest, _types.ListFlowProfilesRequest, IO[bytes]], **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Is either a ListFlowProfilesRequest type or a IO[bytes] type. + Required. + :type body: ~azure.mgmt.datatransfer.models.ListFlowProfilesRequest or + ~azure.mgmt.datatransfer.types.ListFlowProfilesRequest or IO[bytes] + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowProfilesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_list_flow_profiles_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FlowProfilesListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def validate_schema( + self, schema: _models.Schema, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_schema( + self, schema: _types.Schema, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Required. + :type schema: ~azure.mgmt.datatransfer.types.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_schema( + self, schema: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Required. + :type schema: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_schema( + self, schema: Union[_models.Schema, _types.Schema, IO[bytes]], **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Is either a Schema type or a IO[bytes] type. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema or ~azure.mgmt.datatransfer.types.Schema + or IO[bytes] + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateSchemaResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(schema, (IOBase, bytes)): + _content = schema + else: + _content = json.dumps(schema, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_validate_schema_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidateSchemaResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_pipeline_metadata( + self, body: _models.ListPipelineMetadataRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.models.ListPipelineMetadataRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_pipeline_metadata( + self, body: _types.ListPipelineMetadataRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.types.ListPipelineMetadataRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_pipeline_metadata( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-02-06-preview", + params_added_on={"2026-02-06-preview": ["api_version", "content_type", "accept"]}, + api_versions_list=["2026-02-06-preview"], + ) + async def list_pipeline_metadata( + self, + body: Union[_models.ListPipelineMetadataRequest, _types.ListPipelineMetadataRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Is either a ListPipelineMetadataRequest type or a IO[bytes] + type. Required. + :type body: ~azure.mgmt.datatransfer.models.ListPipelineMetadataRequest or + ~azure.mgmt.datatransfer.types.ListPipelineMetadataRequest or IO[bytes] + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ListPipelineMetadataResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_list_pipeline_metadata_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ListPipelineMetadataResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_patch.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/__init__.py new file mode 100644 index 000000000000..0e6e015c3ece --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/__init__.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + Action, + AntivirusRuleset, + ApiFlowOptions, + ArchiveRuleset, + Authentication, + Connection, + ConnectionIdList, + ConnectionProperties, + ConnectionsPatch, + DataSizeRuleset, + DirectionSettings, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Flow, + FlowProfile, + FlowProfileMetadata, + FlowProfilePatch, + FlowProfilePatchProperties, + FlowProfileProperties, + FlowProfileRulesets, + FlowProfilesListResult, + FlowProperties, + FlowsPatch, + FlowsPatchProperties, + GetDestinationEndpointPortsResult, + GetDestinationEndpointsResult, + GetStreamConnectionStringResult, + InternalMetadataProperties, + ListApprovedSchemasRequest, + ListFlowProfilesRequest, + ListFlowsByPipelineConnection, + ListFlowsByPipelineResult, + ListParameterBody, + ListPipelineMetadataRequest, + ListPipelineMetadataResult, + ManagedServiceIdentity, + MessagingOptions, + MimeFilterRuleset, + MimeTypeFilter, + Operation, + OperationDisplay, + OperationStatusProperties, + PendingConnection, + PendingFlow, + Pipeline, + PipelineConnectionProperties, + PipelineProperties, + PipelinesPatch, + PipelinesPatchProperties, + Plan, + ReadPipelineConnection, + RemoteEndpointSettings, + Resource, + ResourceBody, + Schema, + SchemasListResult, + SelectedResource, + SetDestinationEndpointPorts, + SetDestinationEndpoints, + SetSourceAddresses, + SetStreamPassphrase, + StreamSourceAddresses, + Subscriber, + SystemData, + TextMatchingRuleset, + TextMatchingRulesetDeny, + TrackedResource, + UserAssignedIdentity, + ValidateSchemaResult, + XmlFilterRuleset, +) + +from ._enums import ( # type: ignore + ActionType, + AntivirusSolutions, + ApiMode, + AuthenticationType, + Casing, + ConnectionStatus, + CreatedByType, + DataClass, + DataClassType, + DataType, + DateTransferActionType, + Direction, + EnablementStatus, + FilterType, + FlowBillingTier, + FlowProfileStatus, + FlowStatus, + FlowType, + ForceDisabledStatus, + IdentityTranslation, + LinkStatus, + ManagedServiceIdentityType, + MatchType, + OperationStatusEnum, + Origin, + PipelineStatus, + ProvisioningState, + SchemaStatus, + SchemaType, + StreamProtocol, + TargetType, + ValidateSchemaStatus, + XmlReferenceType, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Action", + "AntivirusRuleset", + "ApiFlowOptions", + "ArchiveRuleset", + "Authentication", + "Connection", + "ConnectionIdList", + "ConnectionProperties", + "ConnectionsPatch", + "DataSizeRuleset", + "DirectionSettings", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "Flow", + "FlowProfile", + "FlowProfileMetadata", + "FlowProfilePatch", + "FlowProfilePatchProperties", + "FlowProfileProperties", + "FlowProfileRulesets", + "FlowProfilesListResult", + "FlowProperties", + "FlowsPatch", + "FlowsPatchProperties", + "GetDestinationEndpointPortsResult", + "GetDestinationEndpointsResult", + "GetStreamConnectionStringResult", + "InternalMetadataProperties", + "ListApprovedSchemasRequest", + "ListFlowProfilesRequest", + "ListFlowsByPipelineConnection", + "ListFlowsByPipelineResult", + "ListParameterBody", + "ListPipelineMetadataRequest", + "ListPipelineMetadataResult", + "ManagedServiceIdentity", + "MessagingOptions", + "MimeFilterRuleset", + "MimeTypeFilter", + "Operation", + "OperationDisplay", + "OperationStatusProperties", + "PendingConnection", + "PendingFlow", + "Pipeline", + "PipelineConnectionProperties", + "PipelineProperties", + "PipelinesPatch", + "PipelinesPatchProperties", + "Plan", + "ReadPipelineConnection", + "RemoteEndpointSettings", + "Resource", + "ResourceBody", + "Schema", + "SchemasListResult", + "SelectedResource", + "SetDestinationEndpointPorts", + "SetDestinationEndpoints", + "SetSourceAddresses", + "SetStreamPassphrase", + "StreamSourceAddresses", + "Subscriber", + "SystemData", + "TextMatchingRuleset", + "TextMatchingRulesetDeny", + "TrackedResource", + "UserAssignedIdentity", + "ValidateSchemaResult", + "XmlFilterRuleset", + "ActionType", + "AntivirusSolutions", + "ApiMode", + "AuthenticationType", + "Casing", + "ConnectionStatus", + "CreatedByType", + "DataClass", + "DataClassType", + "DataType", + "DateTransferActionType", + "Direction", + "EnablementStatus", + "FilterType", + "FlowBillingTier", + "FlowProfileStatus", + "FlowStatus", + "FlowType", + "ForceDisabledStatus", + "IdentityTranslation", + "LinkStatus", + "ManagedServiceIdentityType", + "MatchType", + "OperationStatusEnum", + "Origin", + "PipelineStatus", + "ProvisioningState", + "SchemaStatus", + "SchemaType", + "StreamProtocol", + "TargetType", + "ValidateSchemaStatus", + "XmlReferenceType", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_enums.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_enums.py new file mode 100644 index 000000000000..007bc81d3beb --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_enums.py @@ -0,0 +1,404 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal + only APIs. + """ + + INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class AntivirusSolutions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The list of Antivirus solutions currently provided.""" + + DEFENDER = "Defender" + """Option to use Microsoft Defender antivirus scanning software as the scanning solution.""" + CLAM_AV = "ClamAv" + """Option to use the external ClamAV open-source software as an antivirus scanning solution.""" + + +class ApiMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API Flow will + be invoked. + """ + + SDK = "SDK" + """The API flow will forward calls to a custom Software Development Kit implementation.""" + ENDPOINT = "Endpoint" + """The API flow will forward calls to a specified endpoint.""" + + +class AuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of authentication mechanism for Azure Data Transfer API Flows.""" + + JWT = "JWT" + """Option to use a JWT Bearer Authentication Token.""" + NONE = "None" + """Option to not use any form of Authentication.""" + + +class Casing(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Text casing comparison options - diacritics casing is also supported.""" + + INSENSITIVE = "Insensitive" + """Ignores casing when performing pattern matching. For example, \"Hello World\" would be found in + \"hello world\".""" + SENSITIVE = "Sensitive" + """Requires exact casing for the pattern match. For example, \"Hello World\" would NOT not be found + in \"hello world\".""" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the connection.""" + + IN_REVIEW = "InReview" + """This connection has been created but is under review by the pipeline owner.""" + APPROVED = "Approved" + """This connection has been approved by the pipeline owner and is ready for use.""" + REJECTED = "Rejected" + """This connection has been rejected by the pipeline owner and cannot be used.""" + ACCEPTED = "Accepted" + """Creation of the connection has been accepted.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + +class DataClass(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The list of data types supported for replication.""" + + SERVICE_BUS = "ServiceBus" + """(Messaging) Replicates messages from Azure Service Bus for downstream processing or analysis.""" + EVENT_HUB = "EventHub" + """(Messaging) Replicates messages from Azure Event Hub for downstream processing or analysis.""" + API_ENDPOINT = "ApiEndpoint" + """(API) Replicates request/response data through RESTful API endpoints.""" + API_SDK = "ApiSDK" + """(API) Replicates request/response data through SDK-based integrations.""" + VIDEO = "Video" + """(Stream) Enables replication of real-time video streaming data.""" + BLOB = "Blob" + """(Files/SoftwareArtifacts/Complex) Replicates generic blobs data using Azure Blob Storage.""" + TABLE = "Table" + """(Files) Replicates structured NoSQL data using Azure Table Storage.""" + + +class DataClassType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the supported replication scenarios for Azure Data Transfer.""" + + MESSAGING = "Messaging" + """Represents standard message-based data, including Azure Service and Event Hub, used in message + replication.""" + API = "API" + """Represents transactional request/response data types from API endpoints.""" + STREAM = "Stream" + """Represents data types that require continuous, real-time streaming replication (e.g., video).""" + FILES = "Files" + """Represents standard file-based data, including Azure Blob and Table Storage, used in + general-purpose replication.""" + SOFTWARE_ARTIFACTS = "SoftwareArtifacts" + """Represents data related to development, security, and operations workflows such as build + artifacts subject to an NCDSMO policy.""" + COMPLEX = "Complex" + """Represents rich content types such as documents (e.g., Word, PDF) and images that require + specialized replication handling.""" + + +class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transfer Storage Blobs or Tables.""" + + BLOB = "Blob" + """The flow uses Azure Storage blobs to send or receive data.""" + TABLE = "Table" + """The flow uses Azure Storage tables to send or receive data.""" + + +class DateTransferActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of action to be executed.""" + + ALLOW_UPDATES = "AllowUpdates" + """Allow a pipeline, connection, or flow to be updated.""" + FORCE_DISABLE = "ForceDisable" + """Force disable a pipeline, connection, or flow.""" + + +class Direction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Direction of data movement.""" + + SEND = "Send" + """The direction is on the sending side of a pipeline, connection, or flow.""" + RECEIVE = "Receive" + """The direction is on the receiving side side of a pipeline, connection, or flow.""" + + +class EnablementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enablement statuses.""" + + ENABLED = "Enabled" + """Represents an enabled status.""" + DISABLED = "Disabled" + """Represents a disabled status.""" + + +class FilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies whether the filter applies an allow or deny policy.""" + + ALLOW = "Allow" + """Defines an allow filter used for allowlist.""" + DENY = "Deny" + """Defines a denying filter used for blocklisting.""" + + +class FlowBillingTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Billing tier for this messaging flow.""" + + BLOB_TRANSPORT = "BlobTransport" + """Billing tier for messaging processing that charges based on how much data is transferred.""" + STANDARD = "Standard" + """Billing tier for standard messaging processing that charges based on having the messaging + resource allocated.""" + PREMIUM = "Premium" + """Billing tier for premium messaging processing that charges based on having the messaging + resource allocated.""" + + +class FlowProfileStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The allowed statuses of a FlowProfile.""" + + OBSOLETE = "Obsolete" + """Defines a FlowProfile that can no longer be selected.""" + ENABLED = "Enabled" + """Defines a FlowProfile that is enabled.""" + DISABLED = "Disabled" + """Defines a FlowProfile that is disabled.""" + + +class FlowStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the current flow.""" + + ENABLED = "Enabled" + """The flow is currently enabled and able to send or receive data.""" + DISABLED = "Disabled" + """The flow is currently disabled and cannot send or receive data.""" + + +class FlowType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Flow type for the specified resource. FlowType will be deprecated starting from version + 2025_05_30_preview - please create a FlowProfile resource instead. + """ + + UNKNOWN = "Unknown" + """This type of flow is not set.""" + COMPLEX = "Complex" + """This flow sends complex documents, such as Microsoft Office documents of Portable document + format files.""" + DEV_SEC_OPS = "DevSecOps" + """This flow sends source code files and artifacts.""" + MESSAGING = "Messaging" + """This flow over the Azure Data Transfer low latency messaging subsystem.""" + MISSION = "Mission" + """This flow sends standard data but is subject to strict cloud owner approval.""" + MICROSOFT_INTERNAL = "MicrosoftInternal" + """This flow is assigned to internal Microsoft use cases.""" + BASIC_FILES = "BasicFiles" + """This flow sends blobs that can be used for multiple use cases.""" + DATA = "Data" + """This flow sends blobs that can be used for multiple use cases.""" + STANDARD = "Standard" + """This flow sends blobs that can be used for multiple use cases.""" + STREAMING_VIDEO = "StreamingVideo" + """This flow sends video streams.""" + OPAQUE = "Opaque" + """This flow sends blobs but is subject to cloud owner approval.""" + MISSION_OPAQUE_XML = "MissionOpaqueXML" + """This flow sends Extensible Markup Language that is subject to strict cloud owner approval.""" + DISK_IMAGES = "DiskImages" + """This flow sends blobs that can be used for Virtual Machines.""" + API = "API" + """This flow sends data via an Application Programmer Interface.""" + + +class ForceDisabledStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines different disablement statuses and the circumstances in why they were disabled.""" + + CONNECTION_FORCE_DISABLED = "ConnectionForceDisabled" + """Defines disablement of a Flow due to the parent connection being disabled.""" + FLOW_TYPE_FORCE_DISABLED = "FlowTypeForceDisabled" + """Defines disablement of a Flow due to the linked flow type being disabled.""" + PIPELINE_FORCE_DISABLED = "PipelineForceDisabled" + """Defines disablement of a Flow due to the Pipeline being disabled.""" + FLOW_PROFILE_FORCE_DISABLED = "FlowProfileForceDisabled" + """Defines disablement of a Flow due to the FlowProfile being disabled.""" + + +class IdentityTranslation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Flag for if Azure Data Transfer API Flow should extract the user token.""" + + USER_IDENTITY = "UserIdentity" + """The API flow will make use of the user identity that called this API flow, and pass that token + through the boundary.""" + SERVICE_IDENTITY = "ServiceIdentity" + """The API flow will make use of the Azure Data Transfer Flow managed identity on the other side + of the boundary.""" + + +class LinkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Link status of the current pipeline, connection, flow.""" + + LINKED = "Linked" + """The pipeline, connection, or flow is currently linked with another corresponding pipeline, + connection, or flow, and can be used.""" + UNLINKED = "Unlinked" + """The pipeline, connection, or flow is not linked with another corresponding pipeline, + connection, or flow, and cannot be used.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + +class MatchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The text pattern matching conditions for text comparison.""" + + PARTIAL = "Partial" + """The option to pattern match substrings within all text content. For example, \"hello world\" + would be found in \"chello worlds\".""" + COMPLETE = "Complete" + """The option to pattern match the entire string explicitly. For example, \"hello world\" would NOT + be found in \"chello worlds\".""" + + +class OperationStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Operation status for the last patch request for this connection.""" + + FAILED = "Failed" + """The last patch request for this connection completed with an error.""" + SUCCEEDED = "Succeeded" + """The last patch request for this connection completed.""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". + """ + + USER = "user" + """Indicates the operation is initiated by a user.""" + SYSTEM = "system" + """Indicates the operation is initiated by a system.""" + USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" + + +class PipelineStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the current pipeline.""" + + ENABLED = "Enabled" + """The pipeline is currently enabled and all child connection and flow resources below able to + send or receive data.""" + DISABLED = "Disabled" + """The pipeline is currently disabled and all child connection and flow resources below are unable + to send or receive data.""" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the pipeline, connection, flow.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + ACCEPTED = "Accepted" + """Resource has been accepted for creation.""" + + +class SchemaStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the schema.""" + + NEW = "New" + """A schema that has not been approved and is awaiting review.""" + APPROVED = "Approved" + """A schema that has been approved and is ready for use.""" + + +class SchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Schema Type.""" + + XSD = "Xsd" + """The schema represents a single XML schema definition file.""" + ZIP = "Zip" + """The schema represents a ZIP file with multiple XML schema definition files within it.""" + + +class StreamProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol of the stream.""" + + UDP = "UDP" + """This Flow is using User Datagram Protocol for the video stream.""" + SRT = "SRT" + """This Flow is using Secure Reliable Transfer for the video stream.""" + RTP = "RTP" + """This Flow is using Real-time Transport Protocol for the video stream.""" + + +class TargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of target to execute the action on.""" + + PIPELINE = "Pipeline" + """The action executing is targeting a pipeline.""" + CONNECTION = "Connection" + """The action executing is targeting a connection.""" + FLOW_TYPE = "FlowType" + """The action executing is targeting a flow type.""" + FLOW_PROFILE = "FlowProfile" + """The action executing is targeting a flow profile.""" + + +class ValidateSchemaStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Validation status of the schema.""" + + SUCCEEDED = "Succeeded" + """Validation of the schema was successful.""" + FAILED = "Failed" + """The schema failed validation, whether due to error or an invalid schema.""" + + +class XmlReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies how to reference the XML for processing.""" + + INLINE = "Inline" + """Defines a referencing procedure where the xml schema will be provided inline.""" diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_models.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_models.py new file mode 100644 index 000000000000..435ad4684ba3 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_models.py @@ -0,0 +1,3806 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class Action(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The action to be executed. + + :ivar action_type: Type of action to be executed. Required. Known values are: "AllowUpdates" + and "ForceDisable". + :vartype action_type: str or ~azure.mgmt.datatransfer.models.DateTransferActionType + :ivar target_type: Type of target to execute the action on. Required. Known values are: + "Pipeline", "Connection", "FlowType", and "FlowProfile". + :vartype target_type: str or ~azure.mgmt.datatransfer.models.TargetType + :ivar targets: Targets for the action. + :vartype targets: list[str] + :ivar justification: Business justification for the action. + :vartype justification: str + """ + + action_type: Union[str, "_models.DateTransferActionType"] = rest_field( + name="actionType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of action to be executed. Required. Known values are: \"AllowUpdates\" and + \"ForceDisable\".""" + target_type: Union[str, "_models.TargetType"] = rest_field( + name="targetType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of target to execute the action on. Required. Known values are: \"Pipeline\", + \"Connection\", \"FlowType\", and \"FlowProfile\".""" + targets: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Targets for the action.""" + justification: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Business justification for the action.""" + + @overload + def __init__( + self, + *, + action_type: Union[str, "_models.DateTransferActionType"], + target_type: Union[str, "_models.TargetType"], + targets: Optional[list[str]] = None, + justification: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AntivirusRuleset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Antivirus scanning rules for replicating data. By default, all antivirus scanning solutions are + disabled. + + :ivar av_solutions: Optional. The list of antiviruses to be used as a scanning solution for + replicating data. + :vartype av_solutions: list[str or ~azure.mgmt.datatransfer.models.AntivirusSolutions] + """ + + av_solutions: Optional[list[Union[str, "_models.AntivirusSolutions"]]] = rest_field( + name="avSolutions", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional. The list of antiviruses to be used as a scanning solution for replicating data.""" + + @overload + def __init__( + self, + *, + av_solutions: Optional[list[Union[str, "_models.AntivirusSolutions"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ApiFlowOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties specific to API Flow Type. + + :ivar remote_endpoint: Remote host to which communication needs to be made. The property has + reached end of life support starting version 2025-05-30-preview. Please create and use the + remoteEndpointSettings.endpoint property instead. + :vartype remote_endpoint: str + :ivar cname: Unique CNAME to represent the Azure Data Transfer API Flow instance. + :vartype cname: str + :ivar api_mode: Remote Calling Mode in the Azure Data Transfer API Flow, which describes how + the API Flow will be invoked. Known values are: "SDK" and "Endpoint". + :vartype api_mode: str or ~azure.mgmt.datatransfer.models.ApiMode + :ivar identity_translation: Determines which identity to use for extracting the user token for + Azure Data Transfer API Flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use the authentication property instead. Known values + are: "UserIdentity" and "ServiceIdentity". + :vartype identity_translation: str or ~azure.mgmt.datatransfer.models.IdentityTranslation + :ivar sender_client_id: Sender's app user assigned Manage Identity client ID. The property has + reached end of life support starting version 2025-05-30-preview. Please create and use the + authentication property instead. + :vartype sender_client_id: str + :ivar remote_calling_mode_client_id: Remote stub app registration Client ID. The property has + reached end of life support starting version 2025-05-30-preview. Please create and use the + authentication property instead. + :vartype remote_calling_mode_client_id: str + :ivar audience_override: Optional field to override the audience of the remote endpoint. The + property has reached end of life support starting version 2025-05-30-preview. Please create and + use the authentication property instead. + :vartype audience_override: str + :ivar authentication: Optional and for advanced used only. A list of authentication methods to + use when accessing the Azure Data Transfer API Flow. If not provided, the default S2S + authentication using Entra (API Flow Managed Identity) and RBAC will be applied. + :vartype authentication: list[~azure.mgmt.datatransfer.models.Authentication] + :ivar remote_endpoint_settings: Defines the destination remote endpoint for the API calls. + :vartype remote_endpoint_settings: ~azure.mgmt.datatransfer.models.RemoteEndpointSettings + """ + + remote_endpoint: Optional[str] = rest_field( + name="remoteEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Remote host to which communication needs to be made. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use the + remoteEndpointSettings.endpoint property instead.""" + cname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique CNAME to represent the Azure Data Transfer API Flow instance.""" + api_mode: Optional[Union[str, "_models.ApiMode"]] = rest_field( + name="apiMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API Flow will + be invoked. Known values are: \"SDK\" and \"Endpoint\".""" + identity_translation: Optional[Union[str, "_models.IdentityTranslation"]] = rest_field( + name="identityTranslation", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines which identity to use for extracting the user token for Azure Data Transfer API + Flow. The property has reached end of life support starting version 2025-05-30-preview. Please + create and use the authentication property instead. Known values are: \"UserIdentity\" and + \"ServiceIdentity\".""" + sender_client_id: Optional[str] = rest_field( + name="senderClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """Sender's app user assigned Manage Identity client ID. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use the authentication property + instead.""" + remote_calling_mode_client_id: Optional[str] = rest_field( + name="remoteCallingModeClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """Remote stub app registration Client ID. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use the authentication property instead.""" + audience_override: Optional[str] = rest_field( + name="audienceOverride", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional field to override the audience of the remote endpoint. The property has reached end of + life support starting version 2025-05-30-preview. Please create and use the authentication + property instead.""" + authentication: Optional[list["_models.Authentication"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional and for advanced used only. A list of authentication methods to use when accessing the + Azure Data Transfer API Flow. If not provided, the default S2S authentication using Entra (API + Flow Managed Identity) and RBAC will be applied.""" + remote_endpoint_settings: Optional["_models.RemoteEndpointSettings"] = rest_field( + name="remoteEndpointSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the destination remote endpoint for the API calls.""" + + @overload + def __init__( + self, + *, + remote_endpoint: Optional[str] = None, + cname: Optional[str] = None, + api_mode: Optional[Union[str, "_models.ApiMode"]] = None, + identity_translation: Optional[Union[str, "_models.IdentityTranslation"]] = None, + sender_client_id: Optional[str] = None, + remote_calling_mode_client_id: Optional[str] = None, + audience_override: Optional[str] = None, + authentication: Optional[list["_models.Authentication"]] = None, + remote_endpoint_settings: Optional["_models.RemoteEndpointSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ArchiveRuleset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rules for regulating supported archive files (BZip2, Cpio, Deb, GZip, Rpm, Tar, Zip) during + data replication. All properties are optional and only the configured options will be applied + against archives. As an example, suppose minimumSizeForExpansion is 10 MiB and + maximumExpansionSizeLimit is 1 GiB. Then all archives smaller than 10 MiB will be treated as + though the archive ruleset is disabled, although other rulesets will apply as usual. + Furthermore, all archives at least 10 MiB in size but with a decompressed size greater than 1 + GiB will fail the ruleset. All other archives will have their contents extracted and each + extracted element will be applied to all rulesets. + + :ivar minimum_size_for_expansion: Optional. Default is 0. The minimum archive file size (in + bytes) required to trigger expansion during replication. Any archive file size below the + configured threshold will skip the rest of the configured rulesets for archives. + :vartype minimum_size_for_expansion: int + :ivar maximum_expansion_size_limit: Optional. The combined maximum size (in bytes) of all + extracted files that an expanded archive is allowed to reach. Archives exceeding the max limit + will be denied for replication. + :vartype maximum_expansion_size_limit: int + :ivar maximum_depth_limit: Optional. The maximum depth of nested archives that can be expanded. + Limits how many layers of embedded archives will be processed. Archives exceeding the max limit + will be denied for replication. + :vartype maximum_depth_limit: int + :ivar maximum_compression_ratio_limit: Optional. Provides the multiplication value for an + archive in total based on the initial object being validated. This value takes the root object + size and multiplies it by this value to create a maximum. Once this maximum is exceeded, the + archive is failed. Used to detect and block archives with suspiciously high compression (e.g., + zip bombs). + :vartype maximum_compression_ratio_limit: float + """ + + minimum_size_for_expansion: Optional[int] = rest_field( + name="minimumSizeForExpansion", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional. Default is 0. The minimum archive file size (in bytes) required to trigger expansion + during replication. Any archive file size below the configured threshold will skip the rest of + the configured rulesets for archives.""" + maximum_expansion_size_limit: Optional[int] = rest_field( + name="maximumExpansionSizeLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional. The combined maximum size (in bytes) of all extracted files that an expanded archive + is allowed to reach. Archives exceeding the max limit will be denied for replication.""" + maximum_depth_limit: Optional[int] = rest_field( + name="maximumDepthLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional. The maximum depth of nested archives that can be expanded. Limits how many layers of + embedded archives will be processed. Archives exceeding the max limit will be denied for + replication.""" + maximum_compression_ratio_limit: Optional[float] = rest_field( + name="maximumCompressionRatioLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional. Provides the multiplication value for an archive in total based on the initial object + being validated. This value takes the root object size and multiplies it by this value to + create a maximum. Once this maximum is exceeded, the archive is failed. Used to detect and + block archives with suspiciously high compression (e.g., zip bombs).""" + + @overload + def __init__( + self, + *, + minimum_size_for_expansion: Optional[int] = None, + maximum_expansion_size_limit: Optional[int] = None, + maximum_depth_limit: Optional[int] = None, + maximum_compression_ratio_limit: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Authentication(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configures the authentication method and parameters for an Azure Data Transfer API Flow. + + :ivar type: Type of authentication mechanism. JWT by default. Known values are: "JWT" and + "None". + :vartype type: str or ~azure.mgmt.datatransfer.models.AuthenticationType + :ivar instance: The identity provider's token service instance. + :vartype instance: str + :ivar tenant_id: A unique identifier representing the tenant of the identity provider's token + service. + :vartype tenant_id: str + :ivar authority: The full URL endpoint used to acquire tokens, typically combining the instance + and tenant ID to target a specific authentication context. + :vartype authority: str + :ivar application_ids: List of applicationIds allowed to authorize to this flow. This is used + as an alternative to the RBAC authorization check. + :vartype application_ids: list[str] + :ivar audience: Audience of the identity of the remote endpoint service. By default, + remoteEndpointSettings.endpoint will be used if a value is not provided. + :vartype audience: str + :ivar client_id_override: The Flow can use an Entra app identity that is provided by the Flow + user to obtain the token to call the remote endpoint. This field specifies the user provided + app's clientId. + :vartype client_id_override: str + :ivar identity_translation: Determines which identity to use for extracting the user token for + Azure Data Transfer API Flow. Known values are: "UserIdentity" and "ServiceIdentity". + :vartype identity_translation: str or ~azure.mgmt.datatransfer.models.IdentityTranslation + """ + + type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of authentication mechanism. JWT by default. Known values are: \"JWT\" and \"None\".""" + instance: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identity provider's token service instance.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """A unique identifier representing the tenant of the identity provider's token service.""" + authority: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The full URL endpoint used to acquire tokens, typically combining the instance and tenant ID to + target a specific authentication context.""" + application_ids: Optional[list[str]] = rest_field( + name="applicationIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of applicationIds allowed to authorize to this flow. This is used as an alternative to the + RBAC authorization check.""" + audience: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audience of the identity of the remote endpoint service. By default, + remoteEndpointSettings.endpoint will be used if a value is not provided.""" + client_id_override: Optional[str] = rest_field( + name="clientIdOverride", visibility=["read", "create", "update", "delete", "query"] + ) + """The Flow can use an Entra app identity that is provided by the Flow user to obtain the token to + call the remote endpoint. This field specifies the user provided app's clientId.""" + identity_translation: Optional[Union[str, "_models.IdentityTranslation"]] = rest_field( + name="identityTranslation", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines which identity to use for extracting the user token for Azure Data Transfer API + Flow. Known values are: \"UserIdentity\" and \"ServiceIdentity\".""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.AuthenticationType"]] = None, + instance: Optional[str] = None, + tenant_id: Optional[str] = None, + authority: Optional[str] = None, + application_ids: Optional[list[str]] = None, + audience: Optional[str] = None, + client_id_override: Optional[str] = None, + identity_translation: Optional[Union[str, "_models.IdentityTranslation"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Connection(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The connection resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of connection. + :vartype properties: ~azure.mgmt.datatransfer.models.ConnectionProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + """ + + properties: Optional["_models.ConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of connection.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ConnectionProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectionIdList(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An array of connection id resources. + + :ivar value: Connection ID to target. + :vartype value: list[str] + """ + + value: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection ID to target.""" + + @overload + def __init__( + self, + *, + value: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of connection. + + :ivar pipeline: Pipeline to use to transfer data. Required. + :vartype pipeline: str + :ivar direction: Direction of data movement. Known values are: "Send" and "Receive". + :vartype direction: str or ~azure.mgmt.datatransfer.models.Direction + :ivar justification: Justification for the connection request. + :vartype justification: str + :ivar status: Status of the connection. Known values are: "InReview", "Approved", "Rejected", + and "Accepted". + :vartype status: str or ~azure.mgmt.datatransfer.models.ConnectionStatus + :ivar force_disabled_status: Force disablement status of the current connection. + :vartype force_disabled_status: list[str or + ~azure.mgmt.datatransfer.models.ForceDisabledStatus] + :ivar status_reason: Reason for status. + :vartype status_reason: str + :ivar link_status: Link status of the current connection. Known values are: "Linked" and + "Unlinked". + :vartype link_status: str or ~azure.mgmt.datatransfer.models.LinkStatus + :ivar linked_connection_id: Resource ID of the linked connection. + :vartype linked_connection_id: str + :ivar flow_types: The flow types being requested for this connection. This FlowType property + has reached end of life support starting version 2025-05-30-preview. Please create a + FlowProfile resource instead. + :vartype flow_types: list[str or ~azure.mgmt.datatransfer.models.FlowType] + :ivar flow_profile_list: Provides a list of FlowProfiles . + :vartype flow_profile_list: list[~azure.mgmt.datatransfer.models.FlowProfileMetadata] + :ivar requirement_id: Requirement ID of the connection. + :vartype requirement_id: str + :ivar remote_subscription_id: Subscription ID to link cloud subscriptions together. + :vartype remote_subscription_id: str + :ivar approver: Approver of this connection request. + :vartype approver: str + :ivar pin: PIN to link requests together. + :vartype pin: str + :ivar date_submitted: The timestamp that this connection request was submitted at. + :vartype date_submitted: ~datetime.datetime + :ivar primary_contact: The primary contact for this connection request. + :vartype primary_contact: str + :ivar secondary_contacts: The secondary contacts for this connection request. + :vartype secondary_contacts: list[str] + :ivar provisioning_state: Provisioning state of the connection. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar policies: The policies for this connection. The policies property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype policies: list[str] + :ivar schemas: The schemas for this connection. The schemas property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype schemas: list[~azure.mgmt.datatransfer.models.Schema] + :ivar schema_uris: The schema URIs for this connection. The schemaUris property has reached end + of life support starting version 2025-05-30-preview. Please create and use a FlowProfile + resource instead. + :vartype schema_uris: list[str] + :ivar api_hostname: Hostname specific to API Flows. + :vartype api_hostname: str + """ + + pipeline: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pipeline to use to transfer data. Required.""" + direction: Optional[Union[str, "_models.Direction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Direction of data movement. Known values are: \"Send\" and \"Receive\".""" + justification: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Justification for the connection request.""" + status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field(visibility=["read"]) + """Status of the connection. Known values are: \"InReview\", \"Approved\", \"Rejected\", and + \"Accepted\".""" + force_disabled_status: Optional[list[Union[str, "_models.ForceDisabledStatus"]]] = rest_field( + name="forceDisabledStatus", visibility=["read"] + ) + """Force disablement status of the current connection.""" + status_reason: Optional[str] = rest_field(name="statusReason", visibility=["read"]) + """Reason for status.""" + link_status: Optional[Union[str, "_models.LinkStatus"]] = rest_field(name="linkStatus", visibility=["read"]) + """Link status of the current connection. Known values are: \"Linked\" and \"Unlinked\".""" + linked_connection_id: Optional[str] = rest_field(name="linkedConnectionId", visibility=["read"]) + """Resource ID of the linked connection.""" + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = rest_field( + name="flowTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow types being requested for this connection. This FlowType property has reached end of + life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead.""" + flow_profile_list: Optional[list["_models.FlowProfileMetadata"]] = rest_field( + name="flowProfileList", visibility=["read", "create", "update", "delete", "query"] + ) + """Provides a list of FlowProfiles .""" + requirement_id: Optional[str] = rest_field( + name="requirementId", visibility=["read", "create", "update", "delete", "query"] + ) + """Requirement ID of the connection.""" + remote_subscription_id: Optional[str] = rest_field( + name="remoteSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Subscription ID to link cloud subscriptions together.""" + approver: Optional[str] = rest_field(visibility=["read"]) + """Approver of this connection request.""" + pin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """PIN to link requests together.""" + date_submitted: Optional[datetime.datetime] = rest_field( + name="dateSubmitted", visibility=["read"], format="rfc3339" + ) + """The timestamp that this connection request was submitted at.""" + primary_contact: Optional[str] = rest_field( + name="primaryContact", visibility=["read", "create", "update", "delete", "query"] + ) + """The primary contact for this connection request.""" + secondary_contacts: Optional[list[str]] = rest_field( + name="secondaryContacts", visibility=["read", "create", "update", "delete", "query"] + ) + """The secondary contacts for this connection request.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the connection. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Accepted\".""" + policies: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The policies for this connection. The policies property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schemas: Optional[list["_models.Schema"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The schemas for this connection. The schemas property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schema_uris: Optional[list[str]] = rest_field( + name="schemaUris", visibility=["read", "create", "update", "delete", "query"] + ) + """The schema URIs for this connection. The schemaUris property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + api_hostname: Optional[str] = rest_field( + name="apiHostname", visibility=["read", "create", "update", "delete", "query"] + ) + """Hostname specific to API Flows.""" + + @overload + def __init__( + self, + *, + pipeline: str, + direction: Optional[Union[str, "_models.Direction"]] = None, + justification: Optional[str] = None, + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = None, + flow_profile_list: Optional[list["_models.FlowProfileMetadata"]] = None, + requirement_id: Optional[str] = None, + remote_subscription_id: Optional[str] = None, + pin: Optional[str] = None, + primary_contact: Optional[str] = None, + secondary_contacts: Optional[list[str]] = None, + policies: Optional[list[str]] = None, + schemas: Optional[list["_models.Schema"]] = None, + schema_uris: Optional[list[str]] = None, + api_hostname: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectionsPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The connections resource patch definition. + + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + identity: Optional["_models.ManagedServiceIdentity"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataSizeRuleset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines rules that enforce minimum and maximum file size limits for data replication. + + :ivar maximum: Optional. Specifies the maximum allowed size (in bytes) for files to be + replicated. Any file size greater than maximum will be denied replication. + :vartype maximum: int + :ivar minimum: Optional. Default is 0. Specifies the minimum required size (in bytes) for a + file to be eligible for replication. Any file size less than minimum will be denied + replication. + :vartype minimum: int + """ + + maximum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional. Specifies the maximum allowed size (in bytes) for files to be replicated. Any file + size greater than maximum will be denied replication.""" + minimum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional. Default is 0. Specifies the minimum required size (in bytes) for a file to be + eligible for replication. Any file size less than minimum will be denied replication.""" + + @overload + def __init__( + self, + *, + maximum: Optional[int] = None, + minimum: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DirectionSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Describes the available settings and supported features for a specific transfer direction (Send + or Receive) within a pipeline. + + :ivar complete_linking: Indicates whether this direction completes the connection linking + process. Required. Known values are: "Enabled" and "Disabled". + :vartype complete_linking: str or ~azure.mgmt.datatransfer.models.EnablementStatus + :ivar connection_approvals: Indicates whether connections in this direction require approval. + Required. Known values are: "Enabled" and "Disabled". + :vartype connection_approvals: str or ~azure.mgmt.datatransfer.models.EnablementStatus + :ivar flow_approvals: Indicates whether flow approvals are required for this direction. Known + values are: "Enabled" and "Disabled". + :vartype flow_approvals: str or ~azure.mgmt.datatransfer.models.EnablementStatus + :ivar flow_types_available: The flow types supported for this direction. + :vartype flow_types_available: list[str or ~azure.mgmt.datatransfer.models.FlowType] + :ivar messaging_flow_type_schema_validation: Indicates whether schema validation is required + for data transfer in this direction. Known values are: "Enabled" and "Disabled". + :vartype messaging_flow_type_schema_validation: str or + ~azure.mgmt.datatransfer.models.EnablementStatus + :ivar flow_profile_data_classes_available: The data class types available for FlowProfile-based + transfers in this direction. + :vartype flow_profile_data_classes_available: list[str or + ~azure.mgmt.datatransfer.models.DataClassType] + :ivar messaging_flows_pricing_options: The pricing options available for messaging flows in + this direction. + :vartype messaging_flows_pricing_options: list[str or + ~azure.mgmt.datatransfer.models.FlowBillingTier] + """ + + complete_linking: Union[str, "_models.EnablementStatus"] = rest_field( + name="completeLinking", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether this direction completes the connection linking process. Required. Known + values are: \"Enabled\" and \"Disabled\".""" + connection_approvals: Union[str, "_models.EnablementStatus"] = rest_field( + name="connectionApprovals", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether connections in this direction require approval. Required. Known values are: + \"Enabled\" and \"Disabled\".""" + flow_approvals: Optional[Union[str, "_models.EnablementStatus"]] = rest_field( + name="flowApprovals", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether flow approvals are required for this direction. Known values are: \"Enabled\" + and \"Disabled\".""" + flow_types_available: Optional[list[Union[str, "_models.FlowType"]]] = rest_field( + name="flowTypesAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow types supported for this direction.""" + messaging_flow_type_schema_validation: Optional[Union[str, "_models.EnablementStatus"]] = rest_field( + name="messagingFlowTypeSchemaValidation", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether schema validation is required for data transfer in this direction. Known + values are: \"Enabled\" and \"Disabled\".""" + flow_profile_data_classes_available: Optional[list[Union[str, "_models.DataClassType"]]] = rest_field( + name="flowProfileDataClassesAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """The data class types available for FlowProfile-based transfers in this direction.""" + messaging_flows_pricing_options: Optional[list[Union[str, "_models.FlowBillingTier"]]] = rest_field( + name="messagingFlowsPricingOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """The pricing options available for messaging flows in this direction.""" + + @overload + def __init__( + self, + *, + complete_linking: Union[str, "_models.EnablementStatus"], + connection_approvals: Union[str, "_models.EnablementStatus"], + flow_approvals: Optional[Union[str, "_models.EnablementStatus"]] = None, + flow_types_available: Optional[list[Union[str, "_models.FlowType"]]] = None, + messaging_flow_type_schema_validation: Optional[Union[str, "_models.EnablementStatus"]] = None, + flow_profile_data_classes_available: Optional[list[Union[str, "_models.DataClassType"]]] = None, + messaging_flows_pricing_options: Optional[list[Union[str, "_models.FlowBillingTier"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.datatransfer.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.datatransfer.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.datatransfer.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Flow(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The flow resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of flow. + :vartype properties: ~azure.mgmt.datatransfer.models.FlowProperties + :ivar plan: Details of the resource plan. + :vartype plan: ~azure.mgmt.datatransfer.models.Plan + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + """ + + properties: Optional["_models.FlowProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of flow.""" + plan: Optional["_models.Plan"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of the resource plan.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.FlowProperties"] = None, + plan: Optional["_models.Plan"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfile(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a FlowProfile Azure resource, which defines a data replication scenario with a + specific data classification and a set of configurable policy rules. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The set of configuration properties that define the behavior and rules of the + FlowProfile. + :vartype properties: ~azure.mgmt.datatransfer.models.FlowProfileProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + """ + + properties: Optional["_models.FlowProfileProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of configuration properties that define the behavior and rules of the FlowProfile.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.FlowProfileProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfileMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The FlowProfile Metadata used to concisely provide all publicly viewable information. + + :ivar pipeline: The name of the parent Pipeline Azure resource associated with this + FlowProfile. Required. + :vartype pipeline: str + :ivar name: The name of the FlowProfile. Required. + :vartype name: str + :ivar replication_scenario: The data replication scenario handled by this FlowProfile. Please + note, that this value cannot be updated after creation. See the FlowProfilePatchProperties to + see updateable properties. Required. Known values are: "Messaging", "API", "Stream", "Files", + "SoftwareArtifacts", and "Complex". + :vartype replication_scenario: str or ~azure.mgmt.datatransfer.models.DataClassType + :ivar flow_profile_id: A guid represented as a string for the FlowProfile resource, assigned by + the system. Required. + :vartype flow_profile_id: str + :ivar status: The operational status of the FlowProfile. Required. Known values are: + "Obsolete", "Enabled", and "Disabled". + :vartype status: str or ~azure.mgmt.datatransfer.models.FlowProfileStatus + :ivar description: A description of the FlowProfile and its rulesets. The description should + describe the flowprofile's purpose and rulesets applied. Required. + :vartype description: str + """ + + pipeline: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the parent Pipeline Azure resource associated with this FlowProfile. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the FlowProfile. Required.""" + replication_scenario: Union[str, "_models.DataClassType"] = rest_field( + name="replicationScenario", visibility=["read", "create", "update", "delete", "query"] + ) + """The data replication scenario handled by this FlowProfile. Please note, that this value cannot + be updated after creation. See the FlowProfilePatchProperties to see updateable properties. + Required. Known values are: \"Messaging\", \"API\", \"Stream\", \"Files\", + \"SoftwareArtifacts\", and \"Complex\".""" + flow_profile_id: str = rest_field(name="flowProfileId", visibility=["read", "create", "update", "delete", "query"]) + """A guid represented as a string for the FlowProfile resource, assigned by the system. Required.""" + status: Union[str, "_models.FlowProfileStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operational status of the FlowProfile. Required. Known values are: \"Obsolete\", + \"Enabled\", and \"Disabled\".""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the FlowProfile and its rulesets. The description should describe the + flowprofile's purpose and rulesets applied. Required.""" + + @overload + def __init__( + self, + *, + pipeline: str, + name: str, + replication_scenario: Union[str, "_models.DataClassType"], + flow_profile_id: str, + status: Union[str, "_models.FlowProfileStatus"], + description: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfilePatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines the patchable properties for a FlowProfile resource. + + :ivar properties: Properties of FlowProfile patch body. + :vartype properties: ~azure.mgmt.datatransfer.models.FlowProfilePatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.FlowProfilePatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of FlowProfile patch body.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.FlowProfilePatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfilePatchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the updatable properties of a FlowProfile. + + :ivar provisioning_state: The current provisioning state of the FlowProfile resource. Known + values are: "Succeeded", "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar description: A description of the FlowProfile that defines the replication scenario. + :vartype description: str + :ivar rulesets: A set of configurable rulesets applied to this FlowProfile. + :vartype rulesets: ~azure.mgmt.datatransfer.models.FlowProfileRulesets + :ivar status: The operational status of the FlowProfile. Known values are: "Obsolete", + "Enabled", and "Disabled". + :vartype status: str or ~azure.mgmt.datatransfer.models.FlowProfileStatus + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of the FlowProfile resource. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", and \"Accepted\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the FlowProfile that defines the replication scenario.""" + rulesets: Optional["_models.FlowProfileRulesets"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A set of configurable rulesets applied to this FlowProfile.""" + status: Optional[Union[str, "_models.FlowProfileStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operational status of the FlowProfile. Known values are: \"Obsolete\", \"Enabled\", and + \"Disabled\".""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + rulesets: Optional["_models.FlowProfileRulesets"] = None, + status: Optional[Union[str, "_models.FlowProfileStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfileProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines the full set of properties for a FlowProfile resource. + + :ivar provisioning_state: The current provisioning state of the FlowProfile. Known values are: + "Succeeded", "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar flow_profile_id: A guid represented as a string for the FlowProfile resource, assigned by + the system. + :vartype flow_profile_id: str + :ivar replication_scenario: The data replication scenario handled by this FlowProfile. Please + not, that this value cannot be updated after creation. Required. Known values are: "Messaging", + "API", "Stream", "Files", "SoftwareArtifacts", and "Complex". + :vartype replication_scenario: str or ~azure.mgmt.datatransfer.models.DataClassType + :ivar status: The operational status of the FlowProfile. Required. Known values are: + "Obsolete", "Enabled", and "Disabled". + :vartype status: str or ~azure.mgmt.datatransfer.models.FlowProfileStatus + :ivar description: A user-defined description of the FlowProfile. Required. + :vartype description: str + :ivar rulesets: A set of configurable rulesets applied to this FlowProfile. + :vartype rulesets: ~azure.mgmt.datatransfer.models.FlowProfileRulesets + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of the FlowProfile. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Accepted\".""" + flow_profile_id: Optional[str] = rest_field(name="flowProfileId", visibility=["read"]) + """A guid represented as a string for the FlowProfile resource, assigned by the system.""" + replication_scenario: Union[str, "_models.DataClassType"] = rest_field( + name="replicationScenario", visibility=["read", "create", "update", "delete", "query"] + ) + """The data replication scenario handled by this FlowProfile. Please not, that this value cannot + be updated after creation. Required. Known values are: \"Messaging\", \"API\", \"Stream\", + \"Files\", \"SoftwareArtifacts\", and \"Complex\".""" + status: Union[str, "_models.FlowProfileStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operational status of the FlowProfile. Required. Known values are: \"Obsolete\", + \"Enabled\", and \"Disabled\".""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A user-defined description of the FlowProfile. Required.""" + rulesets: Optional["_models.FlowProfileRulesets"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A set of configurable rulesets applied to this FlowProfile.""" + + @overload + def __init__( + self, + *, + replication_scenario: Union[str, "_models.DataClassType"], + status: Union[str, "_models.FlowProfileStatus"], + description: str, + rulesets: Optional["_models.FlowProfileRulesets"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfileRulesets(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The allowed set of configurable rulesets for a FlowProfile resource, used during data + replication. All rulesets are optional, and any ruleset configured will be applied to every + applicable replicating data. Any data that fails a ruleset will be denied replication. If a + ruleset is not configured then the ruleset is considered disabled and will not apply towards + replicating data. + + :ivar antivirus: Antivirus scanning rules for replicated data. + :vartype antivirus: ~azure.mgmt.datatransfer.models.AntivirusRuleset + :ivar archives: Rules for handling archive files during replication. + :vartype archives: ~azure.mgmt.datatransfer.models.ArchiveRuleset + :ivar data_size: Rules that enforce minimum and maximum data size limits. + :vartype data_size: ~azure.mgmt.datatransfer.models.DataSizeRuleset + :ivar mime_filters: Rules for filtering files based on MIME types. + :vartype mime_filters: ~azure.mgmt.datatransfer.models.MimeFilterRuleset + :ivar xml_filters: Rules for filtering XML content using XSD schemas. + :vartype xml_filters: ~azure.mgmt.datatransfer.models.XmlFilterRuleset + :ivar text_matching: Rules for detecting and blocking specific text patterns. + :vartype text_matching: ~azure.mgmt.datatransfer.models.TextMatchingRuleset + """ + + antivirus: Optional["_models.AntivirusRuleset"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Antivirus scanning rules for replicated data.""" + archives: Optional["_models.ArchiveRuleset"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Rules for handling archive files during replication.""" + data_size: Optional["_models.DataSizeRuleset"] = rest_field( + name="dataSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Rules that enforce minimum and maximum data size limits.""" + mime_filters: Optional["_models.MimeFilterRuleset"] = rest_field( + name="mimeFilters", visibility=["read", "create", "update", "delete", "query"] + ) + """Rules for filtering files based on MIME types.""" + xml_filters: Optional["_models.XmlFilterRuleset"] = rest_field( + name="xmlFilters", visibility=["read", "create", "update", "delete", "query"] + ) + """Rules for filtering XML content using XSD schemas.""" + text_matching: Optional["_models.TextMatchingRuleset"] = rest_field( + name="textMatching", visibility=["read", "create", "update", "delete", "query"] + ) + """Rules for detecting and blocking specific text patterns.""" + + @overload + def __init__( + self, + *, + antivirus: Optional["_models.AntivirusRuleset"] = None, + archives: Optional["_models.ArchiveRuleset"] = None, + data_size: Optional["_models.DataSizeRuleset"] = None, + mime_filters: Optional["_models.MimeFilterRuleset"] = None, + xml_filters: Optional["_models.XmlFilterRuleset"] = None, + text_matching: Optional["_models.TextMatchingRuleset"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProfilesListResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The flow profiles list result. + + :ivar value: FlowProfileMetadata array. + :vartype value: list[~azure.mgmt.datatransfer.models.FlowProfileMetadata] + """ + + value: Optional[list["_models.FlowProfileMetadata"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """FlowProfileMetadata array.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.FlowProfileMetadata"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of flow. + + :ivar connection: The connection associated with this flow. + :vartype connection: ~azure.mgmt.datatransfer.models.SelectedResource + :ivar flow_id: Dataflow GUID associated with this flow. + :vartype flow_id: str + :ivar key_vault_uri: URI to a Key Vault Secret containing a SAS token. + :vartype key_vault_uri: str + :ivar link_status: Link status of the current flow. Known values are: "Linked" and "Unlinked". + :vartype link_status: str or ~azure.mgmt.datatransfer.models.LinkStatus + :ivar linked_flow_id: Resource ID of the linked flow. + :vartype linked_flow_id: str + :ivar status: Status of the current flow. Known values are: "Enabled" and "Disabled". + :vartype status: str or ~azure.mgmt.datatransfer.models.FlowStatus + :ivar force_disabled_status: Force disablement status of the current flow. + :vartype force_disabled_status: list[str or + ~azure.mgmt.datatransfer.models.ForceDisabledStatus] + :ivar storage_account_name: Storage Account. + :vartype storage_account_name: str + :ivar storage_account_id: Storage Account ID. + :vartype storage_account_id: str + :ivar storage_container_name: Storage Container Name. + :vartype storage_container_name: str + :ivar storage_table_name: Storage Table Name. + :vartype storage_table_name: str + :ivar service_bus_queue_id: Service Bus Queue ID. + :vartype service_bus_queue_id: str + :ivar flow_profile: Type of FlowProfile to use for transfer via the flow. + :vartype flow_profile: ~azure.mgmt.datatransfer.models.FlowProfileMetadata + :ivar flow_data_type: The Flow's data class. Known values are: "ServiceBus", "EventHub", + "ApiEndpoint", "ApiSDK", "Video", "Blob", and "Table". + :vartype flow_data_type: str or ~azure.mgmt.datatransfer.models.DataClass + :ivar flow_type: The flow type for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + Known values are: "Unknown", "Complex", "DevSecOps", "Messaging", "Mission", + "MicrosoftInternal", "BasicFiles", "Data", "Standard", "StreamingVideo", "Opaque", + "MissionOpaqueXML", "DiskImages", and "API". + :vartype flow_type: str or ~azure.mgmt.datatransfer.models.FlowType + :ivar data_type: Type of data to transfer via the flow. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. Known values are: "Blob" and "Table". + :vartype data_type: str or ~azure.mgmt.datatransfer.models.DataType + :ivar provisioning_state: Provisioning state of the flow. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar policies: The policies for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + :vartype policies: list[str] + :ivar schema: The selected schema for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + :vartype schema: ~azure.mgmt.datatransfer.models.Schema + :ivar messaging_options: The messaging options for this flow. + :vartype messaging_options: ~azure.mgmt.datatransfer.models.MessagingOptions + :ivar api_flow_options: The API Flow configuration options for Azure Data Transfer API Flow + type. + :vartype api_flow_options: ~azure.mgmt.datatransfer.models.ApiFlowOptions + :ivar customer_managed_key_vault_uri: The URI to the customer managed key for this flow. + :vartype customer_managed_key_vault_uri: str + :ivar stream_id: The flow stream identifier. + :vartype stream_id: str + :ivar stream_protocol: The protocol of the stream. Known values are: "UDP", "SRT", and "RTP". + :vartype stream_protocol: str or ~azure.mgmt.datatransfer.models.StreamProtocol + :ivar stream_latency: The latency of the stream in milliseconds. + :vartype stream_latency: int + :ivar passphrase: The passphrase used for SRT streams. + :vartype passphrase: str + :ivar source_addresses: The source IP address and CIDR ranges of the stream. + :vartype source_addresses: ~azure.mgmt.datatransfer.models.StreamSourceAddresses + :ivar destination_endpoints: The destination endpoints of the stream. + :vartype destination_endpoints: list[str] + :ivar destination_endpoint_ports: The destination endpoint ports of the stream. + :vartype destination_endpoint_ports: list[int] + :ivar event_hub_id: Event Hub ID. + :vartype event_hub_id: str + :ivar consumer_group: Event Hub Consumer Group. + :vartype consumer_group: str + """ + + connection: Optional["_models.SelectedResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The connection associated with this flow.""" + flow_id: Optional[str] = rest_field(name="flowId", visibility=["read"]) + """Dataflow GUID associated with this flow.""" + key_vault_uri: Optional[str] = rest_field( + name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] + ) + """URI to a Key Vault Secret containing a SAS token.""" + link_status: Optional[Union[str, "_models.LinkStatus"]] = rest_field(name="linkStatus", visibility=["read"]) + """Link status of the current flow. Known values are: \"Linked\" and \"Unlinked\".""" + linked_flow_id: Optional[str] = rest_field(name="linkedFlowId", visibility=["read"]) + """Resource ID of the linked flow.""" + status: Optional[Union[str, "_models.FlowStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Status of the current flow. Known values are: \"Enabled\" and \"Disabled\".""" + force_disabled_status: Optional[list[Union[str, "_models.ForceDisabledStatus"]]] = rest_field( + name="forceDisabledStatus", visibility=["read"] + ) + """Force disablement status of the current flow.""" + storage_account_name: Optional[str] = rest_field( + name="storageAccountName", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Account.""" + storage_account_id: Optional[str] = rest_field( + name="storageAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Account ID.""" + storage_container_name: Optional[str] = rest_field( + name="storageContainerName", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Container Name.""" + storage_table_name: Optional[str] = rest_field( + name="storageTableName", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Table Name.""" + service_bus_queue_id: Optional[str] = rest_field( + name="serviceBusQueueId", visibility=["read", "create", "update", "delete", "query"] + ) + """Service Bus Queue ID.""" + flow_profile: Optional["_models.FlowProfileMetadata"] = rest_field( + name="flowProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of FlowProfile to use for transfer via the flow.""" + flow_data_type: Optional[Union[str, "_models.DataClass"]] = rest_field( + name="flowDataType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Flow's data class. Known values are: \"ServiceBus\", \"EventHub\", \"ApiEndpoint\", + \"ApiSDK\", \"Video\", \"Blob\", and \"Table\".""" + flow_type: Optional[Union[str, "_models.FlowType"]] = rest_field( + name="flowType", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow type for this flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use a FlowProfile resource instead. Known values are: + \"Unknown\", \"Complex\", \"DevSecOps\", \"Messaging\", \"Mission\", \"MicrosoftInternal\", + \"BasicFiles\", \"Data\", \"Standard\", \"StreamingVideo\", \"Opaque\", \"MissionOpaqueXML\", + \"DiskImages\", and \"API\".""" + data_type: Optional[Union[str, "_models.DataType"]] = rest_field( + name="dataType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of data to transfer via the flow. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead. Known values + are: \"Blob\" and \"Table\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the flow. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", and + \"Accepted\".""" + policies: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The policies for this flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schema: Optional["_models.Schema"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The selected schema for this flow. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + messaging_options: Optional["_models.MessagingOptions"] = rest_field( + name="messagingOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """The messaging options for this flow.""" + api_flow_options: Optional["_models.ApiFlowOptions"] = rest_field( + name="apiFlowOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """The API Flow configuration options for Azure Data Transfer API Flow type.""" + customer_managed_key_vault_uri: Optional[str] = rest_field( + name="customerManagedKeyVaultUri", visibility=["read", "create", "update", "delete", "query"] + ) + """The URI to the customer managed key for this flow.""" + stream_id: Optional[str] = rest_field(name="streamId", visibility=["read", "create", "update", "delete", "query"]) + """The flow stream identifier.""" + stream_protocol: Optional[Union[str, "_models.StreamProtocol"]] = rest_field( + name="streamProtocol", visibility=["read", "create", "update", "delete", "query"] + ) + """The protocol of the stream. Known values are: \"UDP\", \"SRT\", and \"RTP\".""" + stream_latency: Optional[int] = rest_field( + name="streamLatency", visibility=["read", "create", "update", "delete", "query"] + ) + """The latency of the stream in milliseconds.""" + passphrase: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The passphrase used for SRT streams.""" + source_addresses: Optional["_models.StreamSourceAddresses"] = rest_field( + name="sourceAddresses", visibility=["read", "create", "update", "delete", "query"] + ) + """The source IP address and CIDR ranges of the stream.""" + destination_endpoints: Optional[list[str]] = rest_field( + name="destinationEndpoints", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination endpoints of the stream.""" + destination_endpoint_ports: Optional[list[int]] = rest_field( + name="destinationEndpointPorts", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination endpoint ports of the stream.""" + event_hub_id: Optional[str] = rest_field( + name="eventHubId", visibility=["read", "create", "update", "delete", "query"] + ) + """Event Hub ID.""" + consumer_group: Optional[str] = rest_field( + name="consumerGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """Event Hub Consumer Group.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + connection: Optional["_models.SelectedResource"] = None, + key_vault_uri: Optional[str] = None, + status: Optional[Union[str, "_models.FlowStatus"]] = None, + storage_account_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + storage_container_name: Optional[str] = None, + storage_table_name: Optional[str] = None, + service_bus_queue_id: Optional[str] = None, + flow_profile: Optional["_models.FlowProfileMetadata"] = None, + flow_data_type: Optional[Union[str, "_models.DataClass"]] = None, + flow_type: Optional[Union[str, "_models.FlowType"]] = None, + data_type: Optional[Union[str, "_models.DataType"]] = None, + policies: Optional[list[str]] = None, + schema: Optional["_models.Schema"] = None, + messaging_options: Optional["_models.MessagingOptions"] = None, + api_flow_options: Optional["_models.ApiFlowOptions"] = None, + customer_managed_key_vault_uri: Optional[str] = None, + stream_id: Optional[str] = None, + stream_protocol: Optional[Union[str, "_models.StreamProtocol"]] = None, + stream_latency: Optional[int] = None, + passphrase: Optional[str] = None, + source_addresses: Optional["_models.StreamSourceAddresses"] = None, + destination_endpoints: Optional[list[str]] = None, + destination_endpoint_ports: Optional[list[int]] = None, + event_hub_id: Optional[str] = None, + consumer_group: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowsPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The flows resource patch definition. + + :ivar properties: Properties of flows patch body. + :vartype properties: ~azure.mgmt.datatransfer.models.FlowsPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.FlowsPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of flows patch body.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.FlowsPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlowsPatchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of flows patch body. + + :ivar stream_protocol: The protocol of the stream. Known values are: "UDP", "SRT", and "RTP". + :vartype stream_protocol: str or ~azure.mgmt.datatransfer.models.StreamProtocol + :ivar passphrase: The passphrase used for SRT streams. + :vartype passphrase: str + :ivar stream_id: The flow stream identifier. + :vartype stream_id: str + :ivar stream_latency: The latency of the stream in milliseconds. + :vartype stream_latency: int + """ + + stream_protocol: Optional[Union[str, "_models.StreamProtocol"]] = rest_field( + name="streamProtocol", visibility=["read", "create", "update", "delete", "query"] + ) + """The protocol of the stream. Known values are: \"UDP\", \"SRT\", and \"RTP\".""" + passphrase: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The passphrase used for SRT streams.""" + stream_id: Optional[str] = rest_field(name="streamId", visibility=["read", "create", "update", "delete", "query"]) + """The flow stream identifier.""" + stream_latency: Optional[int] = rest_field( + name="streamLatency", visibility=["read", "create", "update", "delete", "query"] + ) + """The latency of the stream in milliseconds.""" + + @overload + def __init__( + self, + *, + stream_protocol: Optional[Union[str, "_models.StreamProtocol"]] = None, + passphrase: Optional[str] = None, + stream_id: Optional[str] = None, + stream_latency: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GetDestinationEndpointPortsResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """List of destination endpoint ports for the flow stream. + + :ivar ports: The destination endpoint port for the flow stream. + :vartype ports: list[int] + """ + + ports: Optional[list[int]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The destination endpoint port for the flow stream.""" + + @overload + def __init__( + self, + *, + ports: Optional[list[int]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GetDestinationEndpointsResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """List of destination endpoints for the flow stream. + + :ivar endpoints: The destination endpoints for the flow stream. + :vartype endpoints: list[str] + """ + + endpoints: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The destination endpoints for the flow stream.""" + + @overload + def __init__( + self, + *, + endpoints: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GetStreamConnectionStringResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The connection string for the specified streaming flow. + + :ivar connection_string: The connection string for the specified streaming flow. + :vartype connection_string: str + """ + + connection_string: Optional[str] = rest_field( + name="connectionString", visibility=["read", "create", "update", "delete", "query"] + ) + """The connection string for the specified streaming flow.""" + + @overload + def __init__( + self, + *, + connection_string: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalMetadataProperties(_Model): + """Internal metadata of the connection inside pipeline. + + :ivar operation_status: Operation status associated with the last patch request. + :vartype operation_status: ~azure.mgmt.datatransfer.models.OperationStatusProperties + :ivar status_set_by: User that last set the approved status for this connection. + :vartype status_set_by: str + """ + + operation_status: Optional["_models.OperationStatusProperties"] = rest_field( + name="operationStatus", visibility=["read"] + ) + """Operation status associated with the last patch request.""" + status_set_by: Optional[str] = rest_field(name="statusSetBy", visibility=["read"]) + """User that last set the approved status for this connection.""" + + +class ListApprovedSchemasRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request used to list approved schemas within the resource provider. + ListApprovedSchemaRequest has reached end of life support starting version 2025-05-30-preview. + Please manage schemas with a FlowProfile resource instead. + + :ivar pipeline: The name of the pipeline to filter approved schemas. + :vartype pipeline: str + :ivar direction: The direction pipeline to filter approved schemas. Known values are: "Send" + and "Receive". + :vartype direction: str or ~azure.mgmt.datatransfer.models.Direction + """ + + pipeline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the pipeline to filter approved schemas.""" + direction: Optional[Union[str, "_models.Direction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The direction pipeline to filter approved schemas. Known values are: \"Send\" and \"Receive\".""" + + @overload + def __init__( + self, + *, + pipeline: Optional[str] = None, + direction: Optional[Union[str, "_models.Direction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ListFlowProfilesRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines the required request body for retrieving FlowProfile information for a provided + pipeline. + + :ivar pipeline: The name of the pipeline for which to retrieve associated FlowProfiles. + :vartype pipeline: str + """ + + pipeline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the pipeline for which to retrieve associated FlowProfiles.""" + + @overload + def __init__( + self, + *, + pipeline: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ListFlowsByPipelineConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A connection resource id in addition to all child flow resources under this connection. + + :ivar id: ID of the connection. + :vartype id: str + :ivar flows: List of flows associated with the connection. + :vartype flows: list[~azure.mgmt.datatransfer.models.Flow] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """ID of the connection.""" + flows: Optional[list["_models.Flow"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of flows associated with the connection.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + flows: Optional[list["_models.Flow"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ListFlowsByPipelineResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An array of flow resources. + + :ivar value: List flows by pipeline result by connection. + :vartype value: list[~azure.mgmt.datatransfer.models.ListFlowsByPipelineConnection] + """ + + value: Optional[list["_models.ListFlowsByPipelineConnection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List flows by pipeline result by connection.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.ListFlowsByPipelineConnection"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ListParameterBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ListParameterBody. + + :ivar connections: A list of connection identifiers used to filter the Flows to be retrieved. + :vartype connections: ~azure.mgmt.datatransfer.models.ConnectionIdList + """ + + connections: Optional["_models.ConnectionIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of connection identifiers used to filter the Flows to be retrieved.""" + + @overload + def __init__( + self, + *, + connections: Optional["_models.ConnectionIdList"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ListPipelineMetadataRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines the required request body for retrieving Pipeline metadata for a provided pipeline. + + :ivar pipeline: The name of the pipeline for which to retrieve associated metadata. Required. + :vartype pipeline: str + """ + + pipeline: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the pipeline for which to retrieve associated metadata. Required.""" + + @overload + def __init__( + self, + *, + pipeline: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ListPipelineMetadataResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines the response body for retrieving Pipeline metadata for a provided pipeline. + + :ivar send: Returns the settings associated with send direction of the pipeline. + :vartype send: ~azure.mgmt.datatransfer.models.DirectionSettings + :ivar receive: Returns the settings associated with receive direction of the pipeline. + :vartype receive: ~azure.mgmt.datatransfer.models.DirectionSettings + """ + + send: Optional["_models.DirectionSettings"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Returns the settings associated with send direction of the pipeline.""" + receive: Optional["_models.DirectionSettings"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Returns the settings associated with receive direction of the pipeline.""" + + @overload + def __init__( + self, + *, + send: Optional["_models.DirectionSettings"] = None, + receive: Optional["_models.DirectionSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.datatransfer.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.datatransfer.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MessagingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The option associated with messaging flows. + + :ivar billing_tier: Billing tier for this messaging flow. Known values are: "BlobTransport", + "Standard", and "Premium". + :vartype billing_tier: str or ~azure.mgmt.datatransfer.models.FlowBillingTier + :ivar performance_priority: Field indicating whether to enable guaranteed delivery on the flow + or not. The default disabled option chooses speed over consistency. When enabled, messages are + delivered with minimal delay, but delivery is not guaranteed under all conditions. Known values + are: "Enabled" and "Disabled". + :vartype performance_priority: str or ~azure.mgmt.datatransfer.models.EnablementStatus + """ + + billing_tier: Optional[Union[str, "_models.FlowBillingTier"]] = rest_field( + name="billingTier", visibility=["read", "create", "update", "delete", "query"] + ) + """Billing tier for this messaging flow. Known values are: \"BlobTransport\", \"Standard\", and + \"Premium\".""" + performance_priority: Optional[Union[str, "_models.EnablementStatus"]] = rest_field( + name="performancePriority", visibility=["read", "create", "update", "delete", "query"] + ) + """Field indicating whether to enable guaranteed delivery on the flow or not. The default disabled + option chooses speed over consistency. When enabled, messages are delivered with minimal delay, + but delivery is not guaranteed under all conditions. Known values are: \"Enabled\" and + \"Disabled\".""" + + @overload + def __init__( + self, + *, + billing_tier: Optional[Union[str, "_models.FlowBillingTier"]] = None, + performance_priority: Optional[Union[str, "_models.EnablementStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MimeFilterRuleset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rules for filtering files based on Media types (f.k.a MIME types). + + :ivar type: Specifies whether the filter is an allow list or deny list. For more detail, please + refer to the FilterType model. Known values are: "Allow" and "Deny". + :vartype type: str or ~azure.mgmt.datatransfer.models.FilterType + :ivar filters: Defines the Media types (f.k.a MIME types) and associated file extensions to be + filtered. For more detail, please refer to the MimeTypeFiler model. + :vartype filters: list[~azure.mgmt.datatransfer.models.MimeTypeFilter] + """ + + type: Optional[Union[str, "_models.FilterType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether the filter is an allow list or deny list. For more detail, please refer to + the FilterType model. Known values are: \"Allow\" and \"Deny\".""" + filters: Optional[list["_models.MimeTypeFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the Media types (f.k.a MIME types) and associated file extensions to be filtered. For + more detail, please refer to the MimeTypeFiler model.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.FilterType"]] = None, + filters: Optional[list["_models.MimeTypeFilter"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MimeTypeFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines a list of Media types (f.k.a MIME Types) and associated file extensions subject to + filtering. + + :ivar media: The Media Types (f.k.a MIME types), following IANA standards (e.g., + application/json, image/png). For a more detailed list of allowed media types please refer to + the Tika documentation: + `https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml + `_. + :vartype media: str + :ivar extensions: A list of file extensions associated with the specified Media type (e.g., + .json, .png). To specify files with no extension, use an empty string "".". + :vartype extensions: list[str] + """ + + media: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Media Types (f.k.a MIME types), following IANA standards (e.g., application/json, + image/png). For a more detailed list of allowed media types please refer to the Tika + documentation: + `https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml + `_.""" + extensions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of file extensions associated with the specified Media type (e.g., .json, .png). To + specify files with no extension, use an empty string \"\".\".""" + + @overload + def __init__( + self, + *, + media: Optional[str] = None, + extensions: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.datatransfer.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.datatransfer.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.datatransfer.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for an operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OperationStatusProperties(_Model): + """Operation status associated with the last patch request. + + :ivar status: Operation status for the last patch request for this connection. Known values + are: "Failed" and "Succeeded". + :vartype status: str or ~azure.mgmt.datatransfer.models.OperationStatusEnum + :ivar id: Operation status ID of the last patch request for this connection. + :vartype id: str + :ivar message: Message for the operation for the last patch request for this connection. + :vartype message: str + """ + + status: Optional[Union[str, "_models.OperationStatusEnum"]] = rest_field(visibility=["read"]) + """Operation status for the last patch request for this connection. Known values are: \"Failed\" + and \"Succeeded\".""" + id: Optional[str] = rest_field(visibility=["read"]) + """Operation status ID of the last patch request for this connection.""" + message: Optional[str] = rest_field(visibility=["read"]) + """Message for the operation for the last patch request for this connection.""" + + +class PendingConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Pending connection object. + + :ivar subscription_id: Subscription ID of the pending connection. + :vartype subscription_id: str + :ivar pipeline: Pipeline to use to transfer data. Required. + :vartype pipeline: str + :ivar direction: Direction of data movement. Known values are: "Send" and "Receive". + :vartype direction: str or ~azure.mgmt.datatransfer.models.Direction + :ivar justification: Justification for the connection request. + :vartype justification: str + :ivar status: Status of the connection. Known values are: "InReview", "Approved", "Rejected", + and "Accepted". + :vartype status: str or ~azure.mgmt.datatransfer.models.ConnectionStatus + :ivar force_disabled_status: Force disablement status of the current connection. + :vartype force_disabled_status: list[str or + ~azure.mgmt.datatransfer.models.ForceDisabledStatus] + :ivar status_reason: Reason for status. + :vartype status_reason: str + :ivar link_status: Link status of the current connection. Known values are: "Linked" and + "Unlinked". + :vartype link_status: str or ~azure.mgmt.datatransfer.models.LinkStatus + :ivar linked_connection_id: Resource ID of the linked connection. + :vartype linked_connection_id: str + :ivar flow_types: The flow types being requested for this connection. This FlowType property + has reached end of life support starting version 2025-05-30-preview. Please create a + FlowProfile resource instead. + :vartype flow_types: list[str or ~azure.mgmt.datatransfer.models.FlowType] + :ivar flow_profile_list: Provides a list of FlowProfiles . + :vartype flow_profile_list: list[~azure.mgmt.datatransfer.models.FlowProfileMetadata] + :ivar requirement_id: Requirement ID of the connection. + :vartype requirement_id: str + :ivar remote_subscription_id: Subscription ID to link cloud subscriptions together. + :vartype remote_subscription_id: str + :ivar approver: Approver of this connection request. + :vartype approver: str + :ivar pin: PIN to link requests together. + :vartype pin: str + :ivar date_submitted: The timestamp that this connection request was submitted at. + :vartype date_submitted: ~datetime.datetime + :ivar primary_contact: The primary contact for this connection request. + :vartype primary_contact: str + :ivar secondary_contacts: The secondary contacts for this connection request. + :vartype secondary_contacts: list[str] + :ivar provisioning_state: Provisioning state of the connection. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar policies: The policies for this connection. The policies property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype policies: list[str] + :ivar schemas: The schemas for this connection. The schemas property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype schemas: list[~azure.mgmt.datatransfer.models.Schema] + :ivar schema_uris: The schema URIs for this connection. The schemaUris property has reached end + of life support starting version 2025-05-30-preview. Please create and use a FlowProfile + resource instead. + :vartype schema_uris: list[str] + :ivar api_hostname: Hostname specific to API Flows. + :vartype api_hostname: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + """ + + subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"]) + """Subscription ID of the pending connection.""" + pipeline: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pipeline to use to transfer data. Required.""" + direction: Optional[Union[str, "_models.Direction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Direction of data movement. Known values are: \"Send\" and \"Receive\".""" + justification: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Justification for the connection request.""" + status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field(visibility=["read"]) + """Status of the connection. Known values are: \"InReview\", \"Approved\", \"Rejected\", and + \"Accepted\".""" + force_disabled_status: Optional[list[Union[str, "_models.ForceDisabledStatus"]]] = rest_field( + name="forceDisabledStatus", visibility=["read"] + ) + """Force disablement status of the current connection.""" + status_reason: Optional[str] = rest_field(name="statusReason", visibility=["read"]) + """Reason for status.""" + link_status: Optional[Union[str, "_models.LinkStatus"]] = rest_field(name="linkStatus", visibility=["read"]) + """Link status of the current connection. Known values are: \"Linked\" and \"Unlinked\".""" + linked_connection_id: Optional[str] = rest_field(name="linkedConnectionId", visibility=["read"]) + """Resource ID of the linked connection.""" + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = rest_field( + name="flowTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow types being requested for this connection. This FlowType property has reached end of + life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead.""" + flow_profile_list: Optional[list["_models.FlowProfileMetadata"]] = rest_field( + name="flowProfileList", visibility=["read", "create", "update", "delete", "query"] + ) + """Provides a list of FlowProfiles .""" + requirement_id: Optional[str] = rest_field( + name="requirementId", visibility=["read", "create", "update", "delete", "query"] + ) + """Requirement ID of the connection.""" + remote_subscription_id: Optional[str] = rest_field( + name="remoteSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Subscription ID to link cloud subscriptions together.""" + approver: Optional[str] = rest_field(visibility=["read"]) + """Approver of this connection request.""" + pin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """PIN to link requests together.""" + date_submitted: Optional[datetime.datetime] = rest_field( + name="dateSubmitted", visibility=["read"], format="rfc3339" + ) + """The timestamp that this connection request was submitted at.""" + primary_contact: Optional[str] = rest_field( + name="primaryContact", visibility=["read", "create", "update", "delete", "query"] + ) + """The primary contact for this connection request.""" + secondary_contacts: Optional[list[str]] = rest_field( + name="secondaryContacts", visibility=["read", "create", "update", "delete", "query"] + ) + """The secondary contacts for this connection request.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the connection. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Accepted\".""" + policies: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The policies for this connection. The policies property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schemas: Optional[list["_models.Schema"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The schemas for this connection. The schemas property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schema_uris: Optional[list[str]] = rest_field( + name="schemaUris", visibility=["read", "create", "update", "delete", "query"] + ) + """The schema URIs for this connection. The schemaUris property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + api_hostname: Optional[str] = rest_field( + name="apiHostname", visibility=["read", "create", "update", "delete", "query"] + ) + """Hostname specific to API Flows.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + pipeline: str, + location: str, + direction: Optional[Union[str, "_models.Direction"]] = None, + justification: Optional[str] = None, + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = None, + flow_profile_list: Optional[list["_models.FlowProfileMetadata"]] = None, + requirement_id: Optional[str] = None, + remote_subscription_id: Optional[str] = None, + pin: Optional[str] = None, + primary_contact: Optional[str] = None, + secondary_contacts: Optional[list[str]] = None, + policies: Optional[list[str]] = None, + schemas: Optional[list["_models.Schema"]] = None, + schema_uris: Optional[list[str]] = None, + api_hostname: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PendingFlow(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Pending flow object. + + :ivar subscription_id: Subscription ID of the pending flow. + :vartype subscription_id: str + :ivar connection_id: Connection ID of the pending flow. + :vartype connection_id: str + :ivar connection: The connection associated with this flow. + :vartype connection: ~azure.mgmt.datatransfer.models.SelectedResource + :ivar flow_id: Dataflow GUID associated with this flow. + :vartype flow_id: str + :ivar key_vault_uri: URI to a Key Vault Secret containing a SAS token. + :vartype key_vault_uri: str + :ivar link_status: Link status of the current flow. Known values are: "Linked" and "Unlinked". + :vartype link_status: str or ~azure.mgmt.datatransfer.models.LinkStatus + :ivar linked_flow_id: Resource ID of the linked flow. + :vartype linked_flow_id: str + :ivar status: Status of the current flow. Known values are: "Enabled" and "Disabled". + :vartype status: str or ~azure.mgmt.datatransfer.models.FlowStatus + :ivar force_disabled_status: Force disablement status of the current flow. + :vartype force_disabled_status: list[str or + ~azure.mgmt.datatransfer.models.ForceDisabledStatus] + :ivar storage_account_name: Storage Account. + :vartype storage_account_name: str + :ivar storage_account_id: Storage Account ID. + :vartype storage_account_id: str + :ivar storage_container_name: Storage Container Name. + :vartype storage_container_name: str + :ivar storage_table_name: Storage Table Name. + :vartype storage_table_name: str + :ivar service_bus_queue_id: Service Bus Queue ID. + :vartype service_bus_queue_id: str + :ivar flow_profile: Type of FlowProfile to use for transfer via the flow. + :vartype flow_profile: ~azure.mgmt.datatransfer.models.FlowProfileMetadata + :ivar flow_data_type: The Flow's data class. Known values are: "ServiceBus", "EventHub", + "ApiEndpoint", "ApiSDK", "Video", "Blob", and "Table". + :vartype flow_data_type: str or ~azure.mgmt.datatransfer.models.DataClass + :ivar flow_type: The flow type for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + Known values are: "Unknown", "Complex", "DevSecOps", "Messaging", "Mission", + "MicrosoftInternal", "BasicFiles", "Data", "Standard", "StreamingVideo", "Opaque", + "MissionOpaqueXML", "DiskImages", and "API". + :vartype flow_type: str or ~azure.mgmt.datatransfer.models.FlowType + :ivar data_type: Type of data to transfer via the flow. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. Known values are: "Blob" and "Table". + :vartype data_type: str or ~azure.mgmt.datatransfer.models.DataType + :ivar provisioning_state: Provisioning state of the flow. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar policies: The policies for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + :vartype policies: list[str] + :ivar schema: The selected schema for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + :vartype schema: ~azure.mgmt.datatransfer.models.Schema + :ivar messaging_options: The messaging options for this flow. + :vartype messaging_options: ~azure.mgmt.datatransfer.models.MessagingOptions + :ivar api_flow_options: The API Flow configuration options for Azure Data Transfer API Flow + type. + :vartype api_flow_options: ~azure.mgmt.datatransfer.models.ApiFlowOptions + :ivar customer_managed_key_vault_uri: The URI to the customer managed key for this flow. + :vartype customer_managed_key_vault_uri: str + :ivar stream_id: The flow stream identifier. + :vartype stream_id: str + :ivar stream_protocol: The protocol of the stream. Known values are: "UDP", "SRT", and "RTP". + :vartype stream_protocol: str or ~azure.mgmt.datatransfer.models.StreamProtocol + :ivar stream_latency: The latency of the stream in milliseconds. + :vartype stream_latency: int + :ivar passphrase: The passphrase used for SRT streams. + :vartype passphrase: str + :ivar source_addresses: The source IP address and CIDR ranges of the stream. + :vartype source_addresses: ~azure.mgmt.datatransfer.models.StreamSourceAddresses + :ivar destination_endpoints: The destination endpoints of the stream. + :vartype destination_endpoints: list[str] + :ivar destination_endpoint_ports: The destination endpoint ports of the stream. + :vartype destination_endpoint_ports: list[int] + :ivar event_hub_id: Event Hub ID. + :vartype event_hub_id: str + :ivar consumer_group: Event Hub Consumer Group. + :vartype consumer_group: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + """ + + subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"]) + """Subscription ID of the pending flow.""" + connection_id: Optional[str] = rest_field(name="connectionId", visibility=["read"]) + """Connection ID of the pending flow.""" + connection: Optional["_models.SelectedResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The connection associated with this flow.""" + flow_id: Optional[str] = rest_field(name="flowId", visibility=["read"]) + """Dataflow GUID associated with this flow.""" + key_vault_uri: Optional[str] = rest_field( + name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] + ) + """URI to a Key Vault Secret containing a SAS token.""" + link_status: Optional[Union[str, "_models.LinkStatus"]] = rest_field(name="linkStatus", visibility=["read"]) + """Link status of the current flow. Known values are: \"Linked\" and \"Unlinked\".""" + linked_flow_id: Optional[str] = rest_field(name="linkedFlowId", visibility=["read"]) + """Resource ID of the linked flow.""" + status: Optional[Union[str, "_models.FlowStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Status of the current flow. Known values are: \"Enabled\" and \"Disabled\".""" + force_disabled_status: Optional[list[Union[str, "_models.ForceDisabledStatus"]]] = rest_field( + name="forceDisabledStatus", visibility=["read"] + ) + """Force disablement status of the current flow.""" + storage_account_name: Optional[str] = rest_field( + name="storageAccountName", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Account.""" + storage_account_id: Optional[str] = rest_field( + name="storageAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Account ID.""" + storage_container_name: Optional[str] = rest_field( + name="storageContainerName", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Container Name.""" + storage_table_name: Optional[str] = rest_field( + name="storageTableName", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Table Name.""" + service_bus_queue_id: Optional[str] = rest_field( + name="serviceBusQueueId", visibility=["read", "create", "update", "delete", "query"] + ) + """Service Bus Queue ID.""" + flow_profile: Optional["_models.FlowProfileMetadata"] = rest_field( + name="flowProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of FlowProfile to use for transfer via the flow.""" + flow_data_type: Optional[Union[str, "_models.DataClass"]] = rest_field( + name="flowDataType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Flow's data class. Known values are: \"ServiceBus\", \"EventHub\", \"ApiEndpoint\", + \"ApiSDK\", \"Video\", \"Blob\", and \"Table\".""" + flow_type: Optional[Union[str, "_models.FlowType"]] = rest_field( + name="flowType", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow type for this flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use a FlowProfile resource instead. Known values are: + \"Unknown\", \"Complex\", \"DevSecOps\", \"Messaging\", \"Mission\", \"MicrosoftInternal\", + \"BasicFiles\", \"Data\", \"Standard\", \"StreamingVideo\", \"Opaque\", \"MissionOpaqueXML\", + \"DiskImages\", and \"API\".""" + data_type: Optional[Union[str, "_models.DataType"]] = rest_field( + name="dataType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of data to transfer via the flow. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead. Known values + are: \"Blob\" and \"Table\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the flow. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", and + \"Accepted\".""" + policies: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The policies for this flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schema: Optional["_models.Schema"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The selected schema for this flow. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + messaging_options: Optional["_models.MessagingOptions"] = rest_field( + name="messagingOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """The messaging options for this flow.""" + api_flow_options: Optional["_models.ApiFlowOptions"] = rest_field( + name="apiFlowOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """The API Flow configuration options for Azure Data Transfer API Flow type.""" + customer_managed_key_vault_uri: Optional[str] = rest_field( + name="customerManagedKeyVaultUri", visibility=["read", "create", "update", "delete", "query"] + ) + """The URI to the customer managed key for this flow.""" + stream_id: Optional[str] = rest_field(name="streamId", visibility=["read", "create", "update", "delete", "query"]) + """The flow stream identifier.""" + stream_protocol: Optional[Union[str, "_models.StreamProtocol"]] = rest_field( + name="streamProtocol", visibility=["read", "create", "update", "delete", "query"] + ) + """The protocol of the stream. Known values are: \"UDP\", \"SRT\", and \"RTP\".""" + stream_latency: Optional[int] = rest_field( + name="streamLatency", visibility=["read", "create", "update", "delete", "query"] + ) + """The latency of the stream in milliseconds.""" + passphrase: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The passphrase used for SRT streams.""" + source_addresses: Optional["_models.StreamSourceAddresses"] = rest_field( + name="sourceAddresses", visibility=["read", "create", "update", "delete", "query"] + ) + """The source IP address and CIDR ranges of the stream.""" + destination_endpoints: Optional[list[str]] = rest_field( + name="destinationEndpoints", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination endpoints of the stream.""" + destination_endpoint_ports: Optional[list[int]] = rest_field( + name="destinationEndpointPorts", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination endpoint ports of the stream.""" + event_hub_id: Optional[str] = rest_field( + name="eventHubId", visibility=["read", "create", "update", "delete", "query"] + ) + """Event Hub ID.""" + consumer_group: Optional[str] = rest_field( + name="consumerGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """Event Hub Consumer Group.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + location: str, + connection: Optional["_models.SelectedResource"] = None, + key_vault_uri: Optional[str] = None, + status: Optional[Union[str, "_models.FlowStatus"]] = None, + storage_account_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + storage_container_name: Optional[str] = None, + storage_table_name: Optional[str] = None, + service_bus_queue_id: Optional[str] = None, + flow_profile: Optional["_models.FlowProfileMetadata"] = None, + flow_data_type: Optional[Union[str, "_models.DataClass"]] = None, + flow_type: Optional[Union[str, "_models.FlowType"]] = None, + data_type: Optional[Union[str, "_models.DataType"]] = None, + policies: Optional[list[str]] = None, + schema: Optional["_models.Schema"] = None, + messaging_options: Optional["_models.MessagingOptions"] = None, + api_flow_options: Optional["_models.ApiFlowOptions"] = None, + customer_managed_key_vault_uri: Optional[str] = None, + stream_id: Optional[str] = None, + stream_protocol: Optional[Union[str, "_models.StreamProtocol"]] = None, + stream_latency: Optional[int] = None, + passphrase: Optional[str] = None, + source_addresses: Optional["_models.StreamSourceAddresses"] = None, + destination_endpoints: Optional[list[str]] = None, + destination_endpoint_ports: Optional[list[int]] = None, + event_hub_id: Optional[str] = None, + consumer_group: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Pipeline(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The pipeline resource definition. A Pipeline defines the scope and identity under which data + replication scenarios are managed. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The set of configurable properties for the Pipeline resource. + :vartype properties: ~azure.mgmt.datatransfer.models.PipelineProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + """ + + properties: Optional["_models.PipelineProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of configurable properties for the Pipeline resource.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.PipelineProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PipelineConnectionProperties(_Model): + """Connection properties inside pipeline. + + :ivar internal_metadata: Internal metadata of the connection inside pipeline. + :vartype internal_metadata: ~azure.mgmt.datatransfer.models.InternalMetadataProperties + """ + + internal_metadata: Optional["_models.InternalMetadataProperties"] = rest_field( + name="internalMetadata", visibility=["read"] + ) + """Internal metadata of the connection inside pipeline.""" + + +class PipelineProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of pipeline. + + :ivar remote_cloud: Remote cloud of the data to be transferred or received. Required. + :vartype remote_cloud: str + :ivar display_name: Display name of this pipeline. + :vartype display_name: str + :ivar connections: Connections associated with pipeline. + :vartype connections: list[~azure.mgmt.datatransfer.models.ReadPipelineConnection] + :ivar subscribers: Subscribers of this resource. + :vartype subscribers: list[~azure.mgmt.datatransfer.models.Subscriber] + :ivar provisioning_state: Provisioning state of the pipeline. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.datatransfer.models.ProvisioningState + :ivar policies: The policies for this pipeline. The policies property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype policies: list[str] + :ivar flow_types: The flow type for this flow. The flowTypes property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype flow_types: list[str or ~azure.mgmt.datatransfer.models.FlowType] + :ivar disabled_flow_types: The flow types that are disabled for this pipeline. + :vartype disabled_flow_types: list[str or ~azure.mgmt.datatransfer.models.FlowType] + :ivar disabled_data_class: The DataClasses that are disabled for this pipeline. + :vartype disabled_data_class: list[str or ~azure.mgmt.datatransfer.models.DataClass] + :ivar quarantine_download_storage_account: Quarantine Download Storage Account. + :vartype quarantine_download_storage_account: str + :ivar quarantine_download_storage_container: Quarantine Download Storage Container. + :vartype quarantine_download_storage_container: str + :ivar status: Status of the current pipeline. Known values are: "Enabled" and "Disabled". + :vartype status: str or ~azure.mgmt.datatransfer.models.PipelineStatus + """ + + remote_cloud: str = rest_field(name="remoteCloud", visibility=["read", "create", "update", "delete", "query"]) + """Remote cloud of the data to be transferred or received. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display name of this pipeline.""" + connections: Optional[list["_models.ReadPipelineConnection"]] = rest_field(visibility=["read"]) + """Connections associated with pipeline.""" + subscribers: Optional[list["_models.Subscriber"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Subscribers of this resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the pipeline. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Accepted\".""" + policies: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The policies for this pipeline. The policies property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = rest_field( + name="flowTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow type for this flow. The flowTypes property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + disabled_flow_types: Optional[list[Union[str, "_models.FlowType"]]] = rest_field( + name="disabledFlowTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow types that are disabled for this pipeline.""" + disabled_data_class: Optional[list[Union[str, "_models.DataClass"]]] = rest_field( + name="disabledDataClass", visibility=["read", "create", "update", "delete", "query"] + ) + """The DataClasses that are disabled for this pipeline.""" + quarantine_download_storage_account: Optional[str] = rest_field( + name="quarantineDownloadStorageAccount", visibility=["read", "create", "update", "delete", "query"] + ) + """Quarantine Download Storage Account.""" + quarantine_download_storage_container: Optional[str] = rest_field( + name="quarantineDownloadStorageContainer", visibility=["read", "create", "update", "delete", "query"] + ) + """Quarantine Download Storage Container.""" + status: Optional[Union[str, "_models.PipelineStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Status of the current pipeline. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + remote_cloud: str, + display_name: Optional[str] = None, + subscribers: Optional[list["_models.Subscriber"]] = None, + policies: Optional[list[str]] = None, + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = None, + disabled_flow_types: Optional[list[Union[str, "_models.FlowType"]]] = None, + disabled_data_class: Optional[list[Union[str, "_models.DataClass"]]] = None, + quarantine_download_storage_account: Optional[str] = None, + quarantine_download_storage_container: Optional[str] = None, + status: Optional[Union[str, "_models.PipelineStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PipelinesPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The pipelines resource patch definition. + + :ivar properties: Properties of pipelines patch body. + :vartype properties: ~azure.mgmt.datatransfer.models.PipelinesPatchProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.datatransfer.models.ManagedServiceIdentity + """ + + properties: Optional["_models.PipelinesPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of pipelines patch body.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.PipelinesPatchProperties"] = None, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PipelinesPatchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of pipelines patch body. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use the FlowProfile resource instead. + + :ivar flow_types: The flow types allowed for this pipeline. FlowTypes has reached end of life + support starting version 2025-05-30-preview. Please create and use the FlowProfile property + instead. + :vartype flow_types: list[str or ~azure.mgmt.datatransfer.models.FlowType] + """ + + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = rest_field( + name="flowTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The flow types allowed for this pipeline. FlowTypes has reached end of life support starting + version 2025-05-30-preview. Please create and use the FlowProfile property instead.""" + + @overload + def __init__( + self, + *, + flow_types: Optional[list[Union[str, "_models.FlowType"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Plan(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Plan for the resource. + + :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required. + :vartype name: str + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + Required. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A user defined name of the 3rd Party Artifact that is being procured. Required.""" + publisher: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. Required.""" + product: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID + specified for the artifact at the time of Data Market onboarding. Required.""" + promotion_code: Optional[str] = rest_field( + name="promotionCode", visibility=["read", "create", "update", "delete", "query"] + ) + """A publisher provided promotion code as provisioned in Data Market for the said + product/artifact.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the desired product/artifact.""" + + @overload + def __init__( + self, + *, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReadPipelineConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ReadPipelineconnection. + + :ivar id: Connection id inside pipeline. Required. + :vartype id: str + :ivar name: Connection name inside pipeline. + :vartype name: str + :ivar type: Connection type inside pipeline. + :vartype type: str + :ivar location: Connection location inside pipeline. + :vartype location: str + :ivar etag: Connection etag inside pipeline. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.datatransfer.models.SystemData + :ivar properties: Connection properties inside pipeline. + :vartype properties: ~azure.mgmt.datatransfer.models.PipelineConnectionProperties + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection id inside pipeline. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection name inside pipeline.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection type inside pipeline.""" + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection location inside pipeline.""" + etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection etag inside pipeline.""" + system_data: Optional["_models.SystemData"] = rest_field( + name="systemData", visibility=["read", "create", "update", "delete", "query"] + ) + """Metadata pertaining to creation and last modification of the resource.""" + properties: Optional["_models.PipelineConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Connection properties inside pipeline.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + system_data: Optional["_models.SystemData"] = None, + properties: Optional["_models.PipelineConnectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RemoteEndpointSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties to configure the destination remote endpoint for API calls. + + :ivar endpoint: The remote endpoint uri all API calls. Required. + :vartype endpoint: str + :ivar authentication: Optional and for advanced used only. A list of authentication methods to + use when accessing the remote endpoint. If not provided, the default S2S authentication using + Entra (API Flow Managed Identity) and RBAC will be applied. + :vartype authentication: list[~azure.mgmt.datatransfer.models.Authentication] + """ + + endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The remote endpoint uri all API calls. Required.""" + authentication: Optional[list["_models.Authentication"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional and for advanced used only. A list of authentication methods to use when accessing the + remote endpoint. If not provided, the default S2S authentication using Entra (API Flow Managed + Identity) and RBAC will be applied.""" + + @overload + def __init__( + self, + *, + endpoint: str, + authentication: Optional[list["_models.Authentication"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The resource to reference. + + :ivar id: ID of the resource. Required. + :vartype id: str + :ivar status_reason: Reason for resource operation. + :vartype status_reason: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """ID of the resource. Required.""" + status_reason: Optional[str] = rest_field( + name="statusReason", visibility=["read", "create", "update", "delete", "query"] + ) + """Reason for resource operation.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status_reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Schema(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The schema object. Schemas has reached end of life support starting version 2025-05-30-preview. + Please manage schemas with a FlowProfile resource instead. + + :ivar id: ID associated with this schema. + :vartype id: str + :ivar connection_id: Connection ID associated with this schema. + :vartype connection_id: str + :ivar status: Status of the schema. Known values are: "New" and "Approved". + :vartype status: str or ~azure.mgmt.datatransfer.models.SchemaStatus + :ivar name: Name of the schema. + :vartype name: str + :ivar content: Content of the schema. + :vartype content: str + :ivar direction: The direction of the schema. Known values are: "Send" and "Receive". + :vartype direction: str or ~azure.mgmt.datatransfer.models.Direction + :ivar schema_uri: Uri containing SAS token for the zipped schema. + :vartype schema_uri: str + :ivar schema_type: The Schema Type. Known values are: "Xsd" and "Zip". + :vartype schema_type: str or ~azure.mgmt.datatransfer.models.SchemaType + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """ID associated with this schema.""" + connection_id: Optional[str] = rest_field( + name="connectionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Connection ID associated with this schema.""" + status: Optional[Union[str, "_models.SchemaStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Status of the schema. Known values are: \"New\" and \"Approved\".""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the schema.""" + content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Content of the schema.""" + direction: Optional[Union[str, "_models.Direction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The direction of the schema. Known values are: \"Send\" and \"Receive\".""" + schema_uri: Optional[str] = rest_field(name="schemaUri", visibility=["read", "create", "update", "delete", "query"]) + """Uri containing SAS token for the zipped schema.""" + schema_type: Optional[Union[str, "_models.SchemaType"]] = rest_field( + name="schemaType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Schema Type. Known values are: \"Xsd\" and \"Zip\".""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + connection_id: Optional[str] = None, + status: Optional[Union[str, "_models.SchemaStatus"]] = None, + name: Optional[str] = None, + content: Optional[str] = None, + direction: Optional[Union[str, "_models.Direction"]] = None, + schema_uri: Optional[str] = None, + schema_type: Optional[Union[str, "_models.SchemaType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SchemasListResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The schemas list result. SchemaListResults has reached end of life support starting version + 2025-05-30-preview. Please manage schemas with a FlowProfile resource instead. + + :ivar value: Schemas array. + :vartype value: list[~azure.mgmt.datatransfer.models.Schema] + """ + + value: Optional[list["_models.Schema"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schemas array.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.Schema"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SelectedResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A resource selected from ARM. + + :ivar name: Name of the connection. + :vartype name: str + :ivar id: Id of the connection. Required. + :vartype id: str + :ivar location: Location of the connection. + :vartype location: str + :ivar subscription_name: Name of the subscription with the connection. + :vartype subscription_name: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the connection.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Id of the connection. Required.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """Location of the connection.""" + subscription_name: Optional[str] = rest_field( + name="subscriptionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the subscription with the connection.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: Optional[str] = None, + location: Optional[str] = None, + subscription_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SetDestinationEndpointPorts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Set the destination endpoint ports for the specified flow. + + :ivar ports: The specified flow destination endpoint ports. + :vartype ports: list[int] + """ + + ports: Optional[list[int]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The specified flow destination endpoint ports.""" + + @overload + def __init__( + self, + *, + ports: Optional[list[int]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SetDestinationEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Set the destination endpoints for the specified flow. + + :ivar endpoints: The specified flow destination endpoints. + :vartype endpoints: list[str] + """ + + endpoints: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The specified flow destination endpoints.""" + + @overload + def __init__( + self, + *, + endpoints: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SetSourceAddresses(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Set the source addresses for the specified flow. + + :ivar values_property: Source addresses. + :vartype values_property: list[str] + """ + + values_property: Optional[list[str]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + """Source addresses.""" + + @overload + def __init__( + self, + *, + values_property: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SetStreamPassphrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Set the passphrase used for SRT streams. + + :ivar value: The passphrase used for SRT streams. + :vartype value: str + """ + + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The passphrase used for SRT streams.""" + + @overload + def __init__( + self, + *, + value: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StreamSourceAddresses(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The source IP address and CIDR ranges of the stream. + + :ivar source_addresses: A source IP address or CIDR range. + :vartype source_addresses: list[str] + """ + + source_addresses: Optional[list[str]] = rest_field( + name="sourceAddresses", visibility=["read", "create", "update", "delete", "query"] + ) + """A source IP address or CIDR range.""" + + @overload + def __init__( + self, + *, + source_addresses: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Subscriber(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An individual that would like to subscribe to events that occur on a pipeline. + + :ivar email: Email of the subscriber. + :vartype email: str + :ivar notifications: Number specifying what notifications to receive. + :vartype notifications: int + """ + + email: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Email of the subscriber.""" + notifications: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number specifying what notifications to receive.""" + + @overload + def __init__( + self, + *, + email: Optional[str] = None, + notifications: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.datatransfer.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.datatransfer.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TextMatchingRuleset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rules for detecting and blocking specific text patterns. If a file contains a text pattern that + is part of the configured deny list, the file will be denied. + + :ivar deny: A list of text patterns to block, each with matching rules and case sensitivity + options. + :vartype deny: list[~azure.mgmt.datatransfer.models.TextMatchingRulesetDeny] + """ + + deny: Optional[list["_models.TextMatchingRulesetDeny"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of text patterns to block, each with matching rules and case sensitivity options.""" + + @overload + def __init__( + self, + *, + deny: Optional[list["_models.TextMatchingRulesetDeny"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TextMatchingRulesetDeny(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """TextMatchingRulesetDeny. + + :ivar text: The word or phrase to match against replicated content. A phrase with spaces will + be considered a single substring. Required. + :vartype text: str + :ivar match_type: Specifies the text matching condition for text comparison. For more detail + please refer to the MatchType model. Required. Known values are: "Partial" and "Complete". + :vartype match_type: str or ~azure.mgmt.datatransfer.models.MatchType + :ivar case_sensitivity: Specifies the text matching conditions based on casing. For more detail + please refer to the Casing model. Required. Known values are: "Insensitive" and "Sensitive". + :vartype case_sensitivity: str or ~azure.mgmt.datatransfer.models.Casing + """ + + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The word or phrase to match against replicated content. A phrase with spaces will be considered + a single substring. Required.""" + match_type: Union[str, "_models.MatchType"] = rest_field( + name="matchType", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the text matching condition for text comparison. For more detail please refer to the + MatchType model. Required. Known values are: \"Partial\" and \"Complete\".""" + case_sensitivity: Union[str, "_models.Casing"] = rest_field( + name="caseSensitivity", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the text matching conditions based on casing. For more detail please refer to the + Casing model. Required. Known values are: \"Insensitive\" and \"Sensitive\".""" + + @overload + def __init__( + self, + *, + text: str, + match_type: Union[str, "_models.MatchType"], + case_sensitivity: Union[str, "_models.Casing"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" + + +class ValidateSchemaResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Result of the schema validation. ValidateSchemaResult has reached end of life support starting + version 2025-05-30-preview. Please manage schemas with a FlowProfile resource instead. + + :ivar status: Validation status of the schema. Known values are: "Succeeded" and "Failed". + :vartype status: str or ~azure.mgmt.datatransfer.models.ValidateSchemaStatus + :ivar message: Message describing the schema validation. + :vartype message: str + """ + + status: Optional[Union[str, "_models.ValidateSchemaStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Validation status of the schema. Known values are: \"Succeeded\" and \"Failed\".""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Message describing the schema validation.""" + + @overload + def __init__( + self, + *, + status: Optional[Union[str, "_models.ValidateSchemaStatus"]] = None, + message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class XmlFilterRuleset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rules for filtering XML content using XSD schemas. + + :ivar default_namespace: The default XML namespace used for schema validation. + :vartype default_namespace: str + :ivar reference: Defines the method for referencing the xml schema. "Inline" + :vartype reference: str or ~azure.mgmt.datatransfer.models.XmlReferenceType + :ivar schema: The inline XSD schema to be used for validation. + :vartype schema: str + """ + + default_namespace: Optional[str] = rest_field( + name="defaultNamespace", visibility=["read", "create", "update", "delete", "query"] + ) + """The default XML namespace used for schema validation.""" + reference: Optional[Union[str, "_models.XmlReferenceType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the method for referencing the xml schema. \"Inline\"""" + schema: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The inline XSD schema to be used for validation.""" + + @overload + def __init__( + self, + *, + default_namespace: Optional[str] = None, + reference: Optional[Union[str, "_models.XmlReferenceType"]] = None, + schema: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_patch.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/models/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/__init__.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/__init__.py new file mode 100644 index 000000000000..c10849cb4a3f --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/__init__.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import FlowProfilesOperations # type: ignore +from ._operations import PipelinesOperations # type: ignore +from ._operations import ConnectionsOperations # type: ignore +from ._operations import FlowsOperations # type: ignore +from ._operations import AzureDataTransferOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "FlowProfilesOperations", + "PipelinesOperations", + "ConnectionsOperations", + "FlowsOperations", + "AzureDataTransferOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_operations.py new file mode 100644 index 000000000000..39bc28109bbf --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_operations.py @@ -0,0 +1,8942 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models, types as _types +from .._configuration import DataTransferMgmtClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.AzureDataTransfer/operations" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_profiles_get_request( + resource_group_name: str, pipeline_name: str, flow_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + "flowProfileName": _SERIALIZER.url("flow_profile_name", flow_profile_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_profiles_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, pipeline_name: str, flow_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + "flowProfileName": _SERIALIZER.url("flow_profile_name", flow_profile_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_profiles_update_request( + resource_group_name: str, pipeline_name: str, flow_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + "flowProfileName": _SERIALIZER.url("flow_profile_name", flow_profile_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_profiles_delete_request( + resource_group_name: str, pipeline_name: str, flow_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + "flowProfileName": _SERIALIZER.url("flow_profile_name", flow_profile_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_flow_profiles_list_by_pipeline_request( # pylint: disable=name-too-long + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_get_request( + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_create_or_update_request( + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_update_request( + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_delete_request( + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_pipelines_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/pipelines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_approve_connection_request( # pylint: disable=name-too-long + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/approveConnection" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_execute_action_request( + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/executeAction" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_list_request( + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listFlows" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_list_schemas_list_request( # pylint: disable=name-too-long + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listSchemas" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pipelines_reject_connection_request( # pylint: disable=name-too-long + resource_group_name: str, pipeline_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/rejectConnection" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "pipelineName": _SERIALIZER.url("pipeline_name", pipeline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_get_request( + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_update_request( + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_delete_request( + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_connections_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/connections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_link_request( + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/link" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_list_request( + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingConnections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_list_pending_flows_list_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingFlows" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_get_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_create_or_update_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_update_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_delete_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_flows_list_by_connection_request( + resource_group_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_disable_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/disable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_enable_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/enable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_generate_passphrase_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/generatePassphrase" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_get_destination_endpoint_ports_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getDestinationEndpointPorts" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_get_destination_endpoints_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getDestinationEndpoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_get_source_addresses_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getSourceAddresses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_get_stream_connection_string_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getStreamConnectionString" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_link_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/link" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_set_destination_endpoint_ports_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpointPorts" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_set_destination_endpoints_request( # pylint: disable=name-too-long + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_set_passphrase_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setPassphrase" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flows_set_source_addresses_request( + resource_group_name: str, connection_name: str, flow_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setSourceAddresses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "flowName": _SERIALIZER.url("flow_name", flow_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_data_transfer_list_approved_schemas_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.AzureDataTransfer/listApprovedSchemas" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_data_transfer_list_flow_profiles_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.AzureDataTransfer/listFlowProfiles" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_data_transfer_validate_schema_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.AzureDataTransfer/validateSchema" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_data_transfer_list_pipeline_metadata_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-06-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.AzureDataTransfer/listPipelineMetadata" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.DataTransferMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FlowProfilesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.DataTransferMgmtClient`'s + :attr:`flow_profiles` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def get( + self, resource_group_name: str, pipeline_name: str, flow_profile_name: str, **kwargs: Any + ) -> _models.FlowProfile: + """Retrieves the specified FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :return: FlowProfile. The FlowProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FlowProfile] = kwargs.pop("cls", None) + + _request = build_flow_profiles_get_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FlowProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: Union[_models.FlowProfile, _types.FlowProfile, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flow_profiles_create_or_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: _models.FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Required. + :type resource: ~azure.mgmt.datatransfer.models.FlowProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: _types.FlowProfile, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Required. + :type resource: ~azure.mgmt.datatransfer.types.FlowProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + resource: Union[_models.FlowProfile, _types.FlowProfile, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Creates a new FlowProfile or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param resource: The FlowProfile resource definition to create or update. Is either a + FlowProfile type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.datatransfer.models.FlowProfile or + ~azure.mgmt.datatransfer.types.FlowProfile or IO[bytes] + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowProfile] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FlowProfile, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FlowProfile].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FlowProfile]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def _update_initial( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: Union[_models.FlowProfilePatch, _types.FlowProfilePatch, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flow_profiles_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: _models.FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. + Required. + :type properties: ~azure.mgmt.datatransfer.models.FlowProfilePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: _types.FlowProfilePatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. + Required. + :type properties: ~azure.mgmt.datatransfer.types.FlowProfilePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. + Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + flow_profile_name: str, + properties: Union[_models.FlowProfilePatch, _types.FlowProfilePatch, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.FlowProfile]: + """Applies partial updates to an existing FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :param properties: The FlowProfile patch definition containing the properties to update. Is + either a FlowProfilePatch type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.datatransfer.models.FlowProfilePatch or + ~azure.mgmt.datatransfer.types.FlowProfilePatch or IO[bytes] + :return: An instance of LROPoller that returns FlowProfile. The FlowProfile is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowProfile] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FlowProfile, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FlowProfile].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FlowProfile]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def _delete_initial( + self, resource_group_name: str, pipeline_name: str, flow_profile_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flow_profiles_delete_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "pipeline_name", + "flow_profile_name", + ] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def begin_delete( + self, resource_group_name: str, pipeline_name: str, flow_profile_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param flow_profile_name: The name of the FlowProfile resource to operate on. Must be 3 to 64 + characters long and contain only alphanumeric characters or hyphens. Required. + :type flow_profile_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + flow_profile_name=flow_profile_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-05-30-preview", + params_added_on={ + "2025-05-30-preview": ["api_version", "subscription_id", "resource_group_name", "pipeline_name", "accept"] + }, + api_versions_list=["2025-05-30-preview", "2025-10-10-preview", "2026-02-06-preview"], + ) + def list_by_pipeline( + self, resource_group_name: str, pipeline_name: str, **kwargs: Any + ) -> ItemPaged["_models.FlowProfile"]: + """Lists all FlowProfiles under a given Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :return: An iterator like instance of FlowProfile + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.FlowProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FlowProfile]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flow_profiles_list_by_pipeline_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FlowProfile], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PipelinesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.DataTransferMgmtClient`'s + :attr:`pipelines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, pipeline_name: str, **kwargs: Any) -> _models.Pipeline: + """Retrieves the specified Pipeline resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :return: Pipeline. The Pipeline is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.Pipeline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Pipeline] = kwargs.pop("cls", None) + + _request = build_pipelines_get_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Pipeline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.Pipeline, _types.Pipeline, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pipeline, (IOBase, bytes)): + _content = pipeline + else: + _content = json.dumps(pipeline, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_create_or_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _models.Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.Pipeline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _types.Pipeline, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Required. + :type pipeline: ~azure.mgmt.datatransfer.types.Pipeline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Required. + :type pipeline: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.Pipeline, _types.Pipeline, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and + returns the resulting Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the Pipeline definition. Is either a Pipeline type + or a IO[bytes] type. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.Pipeline or + ~azure.mgmt.datatransfer.types.Pipeline or IO[bytes] + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pipeline] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + pipeline=pipeline, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pipeline, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pipeline].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pipeline]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.PipelinesPatch, _types.PipelinesPatch, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pipeline, (IOBase, bytes)): + _content = pipeline + else: + _content = json.dumps(pipeline, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_update_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _models.PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.PipelinesPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: _types.PipelinesPatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Required. + :type pipeline: ~azure.mgmt.datatransfer.types.PipelinesPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Required. + :type pipeline: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + pipeline_name: str, + pipeline: Union[_models.PipelinesPatch, _types.PipelinesPatch, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[None]: + """Applies partial updates to an existing Pipeline resource. This operation supports patch + semantics and returns the updated Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param pipeline: The request body containing the updated Pipeline properties. Is either a + PipelinesPatch type or a IO[bytes] type. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.PipelinesPatch or + ~azure.mgmt.datatransfer.types.PipelinesPatch or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + pipeline=pipeline, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_initial(self, resource_group_name: str, pipeline_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_pipelines_delete_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, pipeline_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified Pipeline resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Pipeline"]: + """Lists all Pipeline resources within the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Pipeline + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pipeline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_pipelines_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Pipeline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Pipeline"]: + """Lists all Pipeline resources within the current subscription. + + :return: An iterator like instance of Pipeline + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pipeline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_pipelines_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Pipeline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _approve_connection_initial( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_approve_connection_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Required. + :type connection: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_approve_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Approves a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to approve. Is either a + ResourceBody type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._approve_connection_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _execute_action_initial( + self, + resource_group_name: str, + pipeline_name: str, + action: Union[_models.Action, _types.Action, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(action, (IOBase, bytes)): + _content = action + else: + _content = json.dumps(action, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_execute_action_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: _models.Action, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Required. + :type action: ~azure.mgmt.datatransfer.models.Action + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: _types.Action, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Required. + :type action: ~azure.mgmt.datatransfer.types.Action + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Required. + :type action: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_execute_action( + self, + resource_group_name: str, + pipeline_name: str, + action: Union[_models.Action, _types.Action, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Pipeline]: + """Executes a privileged or administrative action on the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param action: The action to be executed on the Pipeline. Is either a Action type or a + IO[bytes] type. Required. + :type action: ~azure.mgmt.datatransfer.models.Action or ~azure.mgmt.datatransfer.types.Action + or IO[bytes] + :return: An instance of LROPoller that returns Pipeline. The Pipeline is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Pipeline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pipeline] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._execute_action_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + action=action, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Pipeline, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Pipeline].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Pipeline]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[_models.ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Default value is None. + :type connections: ~azure.mgmt.datatransfer.models.ConnectionIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[_types.ConnectionIdList] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Default value is None. + :type connections: ~azure.mgmt.datatransfer.types.ConnectionIdList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Default value is None. + :type connections: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list( + self, + resource_group_name: str, + pipeline_name: str, + connections: Optional[Union[_models.ConnectionIdList, _types.ConnectionIdList, IO[bytes]]] = None, + **kwargs: Any, + ) -> _models.ListFlowsByPipelineResult: + """Lists all Flows associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connections: A list of connection identifiers used to filter the Flows to be retrieved. + Is either a ConnectionIdList type or a IO[bytes] type. Default value is None. + :type connections: ~azure.mgmt.datatransfer.models.ConnectionIdList or + ~azure.mgmt.datatransfer.types.ConnectionIdList or IO[bytes] + :return: ListFlowsByPipelineResult. The ListFlowsByPipelineResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListFlowsByPipelineResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if connections else None + cls: ClsType[_models.ListFlowsByPipelineResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if connections else None + _content = None + if isinstance(connections, (IOBase, bytes)): + _content = connections + else: + if connections is not None: + _content = json.dumps(connections, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_pipelines_list_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ListFlowsByPipelineResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: _models.Schema, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: _types.Schema, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Required. + :type schema: ~azure.mgmt.datatransfer.types.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Required. + :type schema: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_schemas_list( + self, + resource_group_name: str, + pipeline_name: str, + schema: Union[_models.Schema, _types.Schema, IO[bytes]], + **kwargs: Any, + ) -> _models.SchemasListResult: + """Lists the schemas associated with a specific connection in the Pipeline. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param schema: The schema(s) to retrieve for the specified connection. Is either a Schema type + or a IO[bytes] type. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema or ~azure.mgmt.datatransfer.types.Schema + or IO[bytes] + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SchemasListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(schema, (IOBase, bytes)): + _content = schema + else: + _content = json.dumps(schema, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_list_schemas_list_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemasListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _reject_connection_initial( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pipelines_reject_connection_request( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Required. + :type connection: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reject_connection( + self, + resource_group_name: str, + pipeline_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Rejects a pending connection request associated with the specified Pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param pipeline_name: The name of the pipeline on which to operate. Required. + :type pipeline_name: str + :param connection: The request body containing the connection to reject. Is either a + ResourceBody type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reject_connection_initial( + resource_group_name=resource_group_name, + pipeline_name=pipeline_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ConnectionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.DataTransferMgmtClient`'s + :attr:`connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, connection_name: str, **kwargs: Any) -> _models.Connection: + """Gets connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + + _request = build_connections_get_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Connection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.Connection, _types.Connection, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_create_or_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: _models.Connection, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.models.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: _types.Connection, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.types.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.Connection, _types.Connection, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Creates or updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Is either a Connection type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.datatransfer.models.Connection or + ~azure.mgmt.datatransfer.types.Connection or IO[bytes] + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ConnectionsPatch, _types.ConnectionsPatch, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: _models.ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.models.ConnectionsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: _types.ConnectionsPatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.types.ConnectionsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ConnectionsPatch, _types.ConnectionsPatch, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Is either a ConnectionsPatch type or a IO[bytes] type. + Required. + :type connection: ~azure.mgmt.datatransfer.models.ConnectionsPatch or + ~azure.mgmt.datatransfer.types.ConnectionsPatch or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_initial(self, resource_group_name: str, connection_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_connections_delete_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, connection_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the connection resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Connection"]: + """Gets connections in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Connection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Connection"]: + """Gets connections in a subscription. + + :return: An iterator like instance of Connection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _link_initial( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_link_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Required. + :type connection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_link( + self, + resource_group_name: str, + connection_name: str, + connection: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Connection]: + """Links the connection to its pending connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param connection: Connection body. Is either a ResourceBody type or a IO[bytes] type. + Required. + :type connection: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of LROPoller that returns Connection. The Connection is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._link_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + connection=connection, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Connection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Connection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Connection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> ItemPaged["_models.PendingConnection"]: + """Lists all pending remote connections that are linkable to this connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An iterator like instance of PendingConnection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.PendingConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PendingConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PendingConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_pending_flows_list( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> ItemPaged["_models.PendingFlow"]: + """Lists all remote flows that have not yet been linked to local flows. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An iterator like instance of PendingFlow + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.PendingFlow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PendingFlow]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_pending_flows_list_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PendingFlow], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FlowsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.DataTransferMgmtClient`'s + :attr:`flows` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any) -> _models.Flow: + """Gets flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.Flow + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + + _request = build_flows_get_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Flow, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.Flow, _types.Flow, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(flow, (IOBase, bytes)): + _content = flow + else: + _content = json.dumps(flow, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_create_or_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _models.Flow, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.models.Flow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _types.Flow, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.types.Flow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.Flow, _types.Flow, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Creates or updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Is either a Flow type or a IO[bytes] type. Required. + :type flow: ~azure.mgmt.datatransfer.models.Flow or ~azure.mgmt.datatransfer.types.Flow or + IO[bytes] + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + flow=flow, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.FlowsPatch, _types.FlowsPatch, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(flow, (IOBase, bytes)): + _content = flow + else: + _content = json.dumps(flow, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_update_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _models.FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.models.FlowsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _types.FlowsPatch, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.types.FlowsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.FlowsPatch, _types.FlowsPatch, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[None]: + """Updates the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Is either a FlowsPatch type or a IO[bytes] type. Required. + :type flow: ~azure.mgmt.datatransfer.models.FlowsPatch or + ~azure.mgmt.datatransfer.types.FlowsPatch or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + flow=flow, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_delete_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the flow resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_connection( + self, resource_group_name: str, connection_name: str, **kwargs: Any + ) -> ItemPaged["_models.Flow"]: + """Gets flows in a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :return: An iterator like instance of Flow + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Flow]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flows_list_by_connection_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Flow], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _disable_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_disable_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_disable( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> LROPoller[_models.Flow]: + """Disables the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._disable_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _enable_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_enable_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_enable( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> LROPoller[_models.Flow]: + """Enables the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._enable_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _generate_passphrase_initial( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_flows_generate_passphrase_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_generate_passphrase( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> LROPoller[_models.Flow]: + """Generate a compliant passphrase for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generate_passphrase_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_destination_endpoint_ports( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.GetDestinationEndpointPortsResult: + """Get the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: GetDestinationEndpointPortsResult. The GetDestinationEndpointPortsResult is compatible + with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.GetDestinationEndpointPortsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetDestinationEndpointPortsResult] = kwargs.pop("cls", None) + + _request = build_flows_get_destination_endpoint_ports_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GetDestinationEndpointPortsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_destination_endpoints( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.GetDestinationEndpointsResult: + """Get the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: GetDestinationEndpointsResult. The GetDestinationEndpointsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.GetDestinationEndpointsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetDestinationEndpointsResult] = kwargs.pop("cls", None) + + _request = build_flows_get_destination_endpoints_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GetDestinationEndpointsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_source_addresses( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.StreamSourceAddresses: + """Get the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: StreamSourceAddresses. The StreamSourceAddresses is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.StreamSourceAddresses + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StreamSourceAddresses] = kwargs.pop("cls", None) + + _request = build_flows_get_source_addresses_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StreamSourceAddresses, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_stream_connection_string( + self, resource_group_name: str, connection_name: str, flow_name: str, **kwargs: Any + ) -> _models.GetStreamConnectionStringResult: + """Get the connection string for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :return: GetStreamConnectionStringResult. The GetStreamConnectionStringResult is compatible + with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.GetStreamConnectionStringResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetStreamConnectionStringResult] = kwargs.pop("cls", None) + + _request = build_flows_get_stream_connection_string_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GetStreamConnectionStringResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _link_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(flow, (IOBase, bytes)): + _content = flow + else: + _content = json.dumps(flow, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_link_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _models.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.models.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: _types.ResourceBody, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: ~azure.mgmt.datatransfer.types.ResourceBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Required. + :type flow: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_link( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + flow: Union[_models.ResourceBody, _types.ResourceBody, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Links the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param flow: Flow body. Is either a ResourceBody type or a IO[bytes] type. Required. + :type flow: ~azure.mgmt.datatransfer.models.ResourceBody or + ~azure.mgmt.datatransfer.types.ResourceBody or IO[bytes] + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._link_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + flow=flow, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_destination_endpoint_ports_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: Union[ + _models.SetDestinationEndpointPorts, _types.SetDestinationEndpointPorts, IO[bytes] + ], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(stream_destination_endpoint_ports, (IOBase, bytes)): + _content = stream_destination_endpoint_ports + else: + _content = json.dumps(stream_destination_endpoint_ports, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_destination_endpoint_ports_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: _models.SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Required. + :type stream_destination_endpoint_ports: + ~azure.mgmt.datatransfer.models.SetDestinationEndpointPorts + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: _types.SetDestinationEndpointPorts, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Required. + :type stream_destination_endpoint_ports: + ~azure.mgmt.datatransfer.types.SetDestinationEndpointPorts + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Required. + :type stream_destination_endpoint_ports: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_destination_endpoint_ports( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoint_ports: Union[ + _models.SetDestinationEndpointPorts, _types.SetDestinationEndpointPorts, IO[bytes] + ], + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoint ports for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoint_ports: The destination endpoint ports wanted. Is either a + SetDestinationEndpointPorts type or a IO[bytes] type. Required. + :type stream_destination_endpoint_ports: + ~azure.mgmt.datatransfer.models.SetDestinationEndpointPorts or + ~azure.mgmt.datatransfer.types.SetDestinationEndpointPorts or IO[bytes] + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_destination_endpoint_ports_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + stream_destination_endpoint_ports=stream_destination_endpoint_ports, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_destination_endpoints_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: Union[_models.SetDestinationEndpoints, _types.SetDestinationEndpoints, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(stream_destination_endpoints, (IOBase, bytes)): + _content = stream_destination_endpoints + else: + _content = json.dumps(stream_destination_endpoints, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_destination_endpoints_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: _models.SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Required. + :type stream_destination_endpoints: ~azure.mgmt.datatransfer.models.SetDestinationEndpoints + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: _types.SetDestinationEndpoints, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Required. + :type stream_destination_endpoints: ~azure.mgmt.datatransfer.types.SetDestinationEndpoints + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Required. + :type stream_destination_endpoints: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_destination_endpoints( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + stream_destination_endpoints: Union[_models.SetDestinationEndpoints, _types.SetDestinationEndpoints, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the destination endpoints for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param stream_destination_endpoints: Destination endpoints wanted. Is either a + SetDestinationEndpoints type or a IO[bytes] type. Required. + :type stream_destination_endpoints: ~azure.mgmt.datatransfer.models.SetDestinationEndpoints or + ~azure.mgmt.datatransfer.types.SetDestinationEndpoints or IO[bytes] + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_destination_endpoints_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + stream_destination_endpoints=stream_destination_endpoints, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_passphrase_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: Union[_models.SetStreamPassphrase, _types.SetStreamPassphrase, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(passphrase, (IOBase, bytes)): + _content = passphrase + else: + _content = json.dumps(passphrase, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_passphrase_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: _models.SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Required. + :type passphrase: ~azure.mgmt.datatransfer.models.SetStreamPassphrase + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: _types.SetStreamPassphrase, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Required. + :type passphrase: ~azure.mgmt.datatransfer.types.SetStreamPassphrase + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Required. + :type passphrase: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_passphrase( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + passphrase: Union[_models.SetStreamPassphrase, _types.SetStreamPassphrase, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Sets the passphrase of the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param passphrase: Passphrase to set. Is either a SetStreamPassphrase type or a IO[bytes] type. + Required. + :type passphrase: ~azure.mgmt.datatransfer.models.SetStreamPassphrase or + ~azure.mgmt.datatransfer.types.SetStreamPassphrase or IO[bytes] + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_passphrase_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + passphrase=passphrase, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_source_addresses_initial( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: Union[_models.SetSourceAddresses, _types.SetSourceAddresses, IO[bytes]], + **kwargs: Any, + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(source_addresses, (IOBase, bytes)): + _content = source_addresses + else: + _content = json.dumps(source_addresses, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_flows_set_source_addresses_request( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: _models.SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Required. + :type source_addresses: ~azure.mgmt.datatransfer.models.SetSourceAddresses + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: _types.SetSourceAddresses, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Required. + :type source_addresses: ~azure.mgmt.datatransfer.types.SetSourceAddresses + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Required. + :type source_addresses: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_source_addresses( + self, + resource_group_name: str, + connection_name: str, + flow_name: str, + source_addresses: Union[_models.SetSourceAddresses, _types.SetSourceAddresses, IO[bytes]], + **kwargs: Any, + ) -> LROPoller[_models.Flow]: + """Set the source addresses for the specified flow. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connection_name: The name for the connection to perform the operation on. Required. + :type connection_name: str + :param flow_name: The name for the flow to perform the operation on. Required. + :type flow_name: str + :param source_addresses: Source addresses wanted. Is either a SetSourceAddresses type or a + IO[bytes] type. Required. + :type source_addresses: ~azure.mgmt.datatransfer.models.SetSourceAddresses or + ~azure.mgmt.datatransfer.types.SetSourceAddresses or IO[bytes] + :return: An instance of LROPoller that returns Flow. The Flow is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datatransfer.models.Flow] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Flow] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_source_addresses_initial( + resource_group_name=resource_group_name, + connection_name=connection_name, + flow_name=flow_name, + source_addresses=source_addresses, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Flow, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Flow].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Flow]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class AzureDataTransferOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.datatransfer.DataTransferMgmtClient`'s + :attr:`azure_data_transfer` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataTransferMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def list_approved_schemas( + self, pipeline: _models.ListApprovedSchemasRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.ListApprovedSchemasRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_approved_schemas( + self, pipeline: _types.ListApprovedSchemasRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Required. + :type pipeline: ~azure.mgmt.datatransfer.types.ListApprovedSchemasRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_approved_schemas( + self, pipeline: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Required. + :type pipeline: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_approved_schemas( + self, + pipeline: Union[_models.ListApprovedSchemasRequest, _types.ListApprovedSchemasRequest, IO[bytes]], + **kwargs: Any, + ) -> _models.SchemasListResult: + """Retrieves the list of approved schemas available for Azure Data Transfer. This operation has + reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param pipeline: The request payload for listing approved schemas. Is either a + ListApprovedSchemasRequest type or a IO[bytes] type. Required. + :type pipeline: ~azure.mgmt.datatransfer.models.ListApprovedSchemasRequest or + ~azure.mgmt.datatransfer.types.ListApprovedSchemasRequest or IO[bytes] + :return: SchemasListResult. The SchemasListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.SchemasListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SchemasListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pipeline, (IOBase, bytes)): + _content = pipeline + else: + _content = json.dumps(pipeline, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_list_approved_schemas_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemasListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_flow_profiles( + self, body: _models.ListFlowProfilesRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.models.ListFlowProfilesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_flow_profiles( + self, body: _types.ListFlowProfilesRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.types.ListFlowProfilesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_flow_profiles( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-10-preview", + params_added_on={"2025-10-10-preview": ["api_version", "content_type", "accept"]}, + api_versions_list=["2025-10-10-preview", "2026-02-06-preview"], + ) + def list_flow_profiles( + self, body: Union[_models.ListFlowProfilesRequest, _types.ListFlowProfilesRequest, IO[bytes]], **kwargs: Any + ) -> _models.FlowProfilesListResult: + """Retrieves a list of FlowProfile resources associated with a specified pipeline. + + :param body: The request body. Is either a ListFlowProfilesRequest type or a IO[bytes] type. + Required. + :type body: ~azure.mgmt.datatransfer.models.ListFlowProfilesRequest or + ~azure.mgmt.datatransfer.types.ListFlowProfilesRequest or IO[bytes] + :return: FlowProfilesListResult. The FlowProfilesListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.FlowProfilesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowProfilesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_list_flow_profiles_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FlowProfilesListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def validate_schema( + self, schema: _models.Schema, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_schema( + self, schema: _types.Schema, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Required. + :type schema: ~azure.mgmt.datatransfer.types.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_schema( + self, schema: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Required. + :type schema: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_schema( + self, schema: Union[_models.Schema, _types.Schema, IO[bytes]], **kwargs: Any + ) -> _models.ValidateSchemaResult: + """Validates the structure and content of a schema for use in Azure Data Transfer. This operation + has reached end of life support starting version 2025-05-30-preview. For schema support please + create and use a FlowProfile resource. + + :param schema: The request body. Is either a Schema type or a IO[bytes] type. Required. + :type schema: ~azure.mgmt.datatransfer.models.Schema or ~azure.mgmt.datatransfer.types.Schema + or IO[bytes] + :return: ValidateSchemaResult. The ValidateSchemaResult is compatible with MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ValidateSchemaResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateSchemaResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(schema, (IOBase, bytes)): + _content = schema + else: + _content = json.dumps(schema, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_validate_schema_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidateSchemaResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_pipeline_metadata( + self, body: _models.ListPipelineMetadataRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.models.ListPipelineMetadataRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_pipeline_metadata( + self, body: _types.ListPipelineMetadataRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Required. + :type body: ~azure.mgmt.datatransfer.types.ListPipelineMetadataRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_pipeline_metadata( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-06-preview", + params_added_on={"2026-02-06-preview": ["api_version", "content_type", "accept"]}, + api_versions_list=["2026-02-06-preview"], + ) + def list_pipeline_metadata( + self, + body: Union[_models.ListPipelineMetadataRequest, _types.ListPipelineMetadataRequest, IO[bytes]], + **kwargs: Any, + ) -> _models.ListPipelineMetadataResult: + """Retrieves the pipeline metadata associated with a specified pipeline. + + :param body: The request body. Is either a ListPipelineMetadataRequest type or a IO[bytes] + type. Required. + :type body: ~azure.mgmt.datatransfer.models.ListPipelineMetadataRequest or + ~azure.mgmt.datatransfer.types.ListPipelineMetadataRequest or IO[bytes] + :return: ListPipelineMetadataResult. The ListPipelineMetadataResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.datatransfer.models.ListPipelineMetadataResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ListPipelineMetadataResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_azure_data_transfer_list_pipeline_metadata_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ListPipelineMetadataResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_patch.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_patch.py new file mode 100644 index 000000000000..ea765788358a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/operations/_patch.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/py.typed b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/types.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/types.py new file mode 100644 index 000000000000..223dee08d519 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/azure/mgmt/datatransfer/types.py @@ -0,0 +1,1573 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + AntivirusSolutions, + ApiMode, + AuthenticationType, + Casing, + ConnectionStatus, + CreatedByType, + DataClass, + DataClassType, + DataType, + DateTransferActionType, + Direction, + EnablementStatus, + FilterType, + FlowBillingTier, + FlowProfileStatus, + FlowStatus, + FlowType, + ForceDisabledStatus, + IdentityTranslation, + LinkStatus, + ManagedServiceIdentityType, + MatchType, + OperationStatusEnum, + PipelineStatus, + ProvisioningState, + SchemaStatus, + SchemaType, + StreamProtocol, + TargetType, + XmlReferenceType, + ) + + +class Action(TypedDict, total=False): + """The action to be executed. + + :ivar actionType: Type of action to be executed. Required. Known values are: "AllowUpdates" and + "ForceDisable". + :vartype actionType: Union[str, "DateTransferActionType"] + :ivar targetType: Type of target to execute the action on. Required. Known values are: + "Pipeline", "Connection", "FlowType", and "FlowProfile". + :vartype targetType: Union[str, "TargetType"] + :ivar targets: Targets for the action. + :vartype targets: list[str] + :ivar justification: Business justification for the action. + :vartype justification: str + """ + + actionType: Required[Union[str, "DateTransferActionType"]] + """Type of action to be executed. Required. Known values are: \"AllowUpdates\" and + \"ForceDisable\".""" + targetType: Required[Union[str, "TargetType"]] + """Type of target to execute the action on. Required. Known values are: \"Pipeline\", + \"Connection\", \"FlowType\", and \"FlowProfile\".""" + targets: list[str] + """Targets for the action.""" + justification: str + """Business justification for the action.""" + + +class AntivirusRuleset(TypedDict, total=False): + """Antivirus scanning rules for replicating data. By default, all antivirus scanning solutions are + disabled. + + :ivar avSolutions: Optional. The list of antiviruses to be used as a scanning solution for + replicating data. + :vartype avSolutions: list[Union[str, "AntivirusSolutions"]] + """ + + avSolutions: list[Union[str, "AntivirusSolutions"]] + """Optional. The list of antiviruses to be used as a scanning solution for replicating data.""" + + +class ApiFlowOptions(TypedDict, total=False): + """Properties specific to API Flow Type. + + :ivar remoteEndpoint: Remote host to which communication needs to be made. The property has + reached end of life support starting version 2025-05-30-preview. Please create and use the + remoteEndpointSettings.endpoint property instead. + :vartype remoteEndpoint: str + :ivar cname: Unique CNAME to represent the Azure Data Transfer API Flow instance. + :vartype cname: str + :ivar apiMode: Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the + API Flow will be invoked. Known values are: "SDK" and "Endpoint". + :vartype apiMode: Union[str, "ApiMode"] + :ivar identityTranslation: Determines which identity to use for extracting the user token for + Azure Data Transfer API Flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use the authentication property instead. Known values + are: "UserIdentity" and "ServiceIdentity". + :vartype identityTranslation: Union[str, "IdentityTranslation"] + :ivar senderClientId: Sender's app user assigned Manage Identity client ID. The property has + reached end of life support starting version 2025-05-30-preview. Please create and use the + authentication property instead. + :vartype senderClientId: str + :ivar remoteCallingModeClientId: Remote stub app registration Client ID. The property has + reached end of life support starting version 2025-05-30-preview. Please create and use the + authentication property instead. + :vartype remoteCallingModeClientId: str + :ivar audienceOverride: Optional field to override the audience of the remote endpoint. The + property has reached end of life support starting version 2025-05-30-preview. Please create and + use the authentication property instead. + :vartype audienceOverride: str + :ivar authentication: Optional and for advanced used only. A list of authentication methods to + use when accessing the Azure Data Transfer API Flow. If not provided, the default S2S + authentication using Entra (API Flow Managed Identity) and RBAC will be applied. + :vartype authentication: list["Authentication"] + :ivar remoteEndpointSettings: Defines the destination remote endpoint for the API calls. + :vartype remoteEndpointSettings: "RemoteEndpointSettings" + """ + + remoteEndpoint: str + """Remote host to which communication needs to be made. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use the + remoteEndpointSettings.endpoint property instead.""" + cname: str + """Unique CNAME to represent the Azure Data Transfer API Flow instance.""" + apiMode: Union[str, "ApiMode"] + """Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API Flow will + be invoked. Known values are: \"SDK\" and \"Endpoint\".""" + identityTranslation: Union[str, "IdentityTranslation"] + """Determines which identity to use for extracting the user token for Azure Data Transfer API + Flow. The property has reached end of life support starting version 2025-05-30-preview. Please + create and use the authentication property instead. Known values are: \"UserIdentity\" and + \"ServiceIdentity\".""" + senderClientId: str + """Sender's app user assigned Manage Identity client ID. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use the authentication property + instead.""" + remoteCallingModeClientId: str + """Remote stub app registration Client ID. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use the authentication property instead.""" + audienceOverride: str + """Optional field to override the audience of the remote endpoint. The property has reached end of + life support starting version 2025-05-30-preview. Please create and use the authentication + property instead.""" + authentication: list["Authentication"] + """Optional and for advanced used only. A list of authentication methods to use when accessing the + Azure Data Transfer API Flow. If not provided, the default S2S authentication using Entra (API + Flow Managed Identity) and RBAC will be applied.""" + remoteEndpointSettings: "RemoteEndpointSettings" + """Defines the destination remote endpoint for the API calls.""" + + +class ArchiveRuleset(TypedDict, total=False): + """Rules for regulating supported archive files (BZip2, Cpio, Deb, GZip, Rpm, Tar, Zip) during + data replication. All properties are optional and only the configured options will be applied + against archives. As an example, suppose minimumSizeForExpansion is 10 MiB and + maximumExpansionSizeLimit is 1 GiB. Then all archives smaller than 10 MiB will be treated as + though the archive ruleset is disabled, although other rulesets will apply as usual. + Furthermore, all archives at least 10 MiB in size but with a decompressed size greater than 1 + GiB will fail the ruleset. All other archives will have their contents extracted and each + extracted element will be applied to all rulesets. + + :ivar minimumSizeForExpansion: Optional. Default is 0. The minimum archive file size (in bytes) + required to trigger expansion during replication. Any archive file size below the configured + threshold will skip the rest of the configured rulesets for archives. + :vartype minimumSizeForExpansion: int + :ivar maximumExpansionSizeLimit: Optional. The combined maximum size (in bytes) of all + extracted files that an expanded archive is allowed to reach. Archives exceeding the max limit + will be denied for replication. + :vartype maximumExpansionSizeLimit: int + :ivar maximumDepthLimit: Optional. The maximum depth of nested archives that can be expanded. + Limits how many layers of embedded archives will be processed. Archives exceeding the max limit + will be denied for replication. + :vartype maximumDepthLimit: int + :ivar maximumCompressionRatioLimit: Optional. Provides the multiplication value for an archive + in total based on the initial object being validated. This value takes the root object size and + multiplies it by this value to create a maximum. Once this maximum is exceeded, the archive is + failed. Used to detect and block archives with suspiciously high compression (e.g., zip bombs). + :vartype maximumCompressionRatioLimit: float + """ + + minimumSizeForExpansion: int + """Optional. Default is 0. The minimum archive file size (in bytes) required to trigger expansion + during replication. Any archive file size below the configured threshold will skip the rest of + the configured rulesets for archives.""" + maximumExpansionSizeLimit: int + """Optional. The combined maximum size (in bytes) of all extracted files that an expanded archive + is allowed to reach. Archives exceeding the max limit will be denied for replication.""" + maximumDepthLimit: int + """Optional. The maximum depth of nested archives that can be expanded. Limits how many layers of + embedded archives will be processed. Archives exceeding the max limit will be denied for + replication.""" + maximumCompressionRatioLimit: float + """Optional. Provides the multiplication value for an archive in total based on the initial object + being validated. This value takes the root object size and multiplies it by this value to + create a maximum. Once this maximum is exceeded, the archive is failed. Used to detect and + block archives with suspiciously high compression (e.g., zip bombs).""" + + +class Authentication(TypedDict, total=False): + """Configures the authentication method and parameters for an Azure Data Transfer API Flow. + + :ivar type: Type of authentication mechanism. JWT by default. Known values are: "JWT" and + "None". + :vartype type: Union[str, "AuthenticationType"] + :ivar instance: The identity provider's token service instance. + :vartype instance: str + :ivar tenantId: A unique identifier representing the tenant of the identity provider's token + service. + :vartype tenantId: str + :ivar authority: The full URL endpoint used to acquire tokens, typically combining the instance + and tenant ID to target a specific authentication context. + :vartype authority: str + :ivar applicationIds: List of applicationIds allowed to authorize to this flow. This is used as + an alternative to the RBAC authorization check. + :vartype applicationIds: list[str] + :ivar audience: Audience of the identity of the remote endpoint service. By default, + remoteEndpointSettings.endpoint will be used if a value is not provided. + :vartype audience: str + :ivar clientIdOverride: The Flow can use an Entra app identity that is provided by the Flow + user to obtain the token to call the remote endpoint. This field specifies the user provided + app's clientId. + :vartype clientIdOverride: str + :ivar identityTranslation: Determines which identity to use for extracting the user token for + Azure Data Transfer API Flow. Known values are: "UserIdentity" and "ServiceIdentity". + :vartype identityTranslation: Union[str, "IdentityTranslation"] + """ + + type: Union[str, "AuthenticationType"] + """Type of authentication mechanism. JWT by default. Known values are: \"JWT\" and \"None\".""" + instance: str + """The identity provider's token service instance.""" + tenantId: str + """A unique identifier representing the tenant of the identity provider's token service.""" + authority: str + """The full URL endpoint used to acquire tokens, typically combining the instance and tenant ID to + target a specific authentication context.""" + applicationIds: list[str] + """List of applicationIds allowed to authorize to this flow. This is used as an alternative to the + RBAC authorization check.""" + audience: str + """Audience of the identity of the remote endpoint service. By default, + remoteEndpointSettings.endpoint will be used if a value is not provided.""" + clientIdOverride: str + """The Flow can use an Entra app identity that is provided by the Flow user to obtain the token to + call the remote endpoint. This field specifies the user provided app's clientId.""" + identityTranslation: Union[str, "IdentityTranslation"] + """Determines which identity to use for extracting the user token for Azure Data Transfer API + Flow. Known values are: \"UserIdentity\" and \"ServiceIdentity\".""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class Connection(TrackedResource): + """The connection resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of connection. + :vartype properties: "ConnectionProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "ConnectionProperties" + """Properties of connection.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class ConnectionIdList(TypedDict, total=False): + """An array of connection id resources. + + :ivar value: Connection ID to target. + :vartype value: list[str] + """ + + value: list[str] + """Connection ID to target.""" + + +class ConnectionProperties(TypedDict, total=False): + """Properties of connection. + + :ivar pipeline: Pipeline to use to transfer data. Required. + :vartype pipeline: str + :ivar direction: Direction of data movement. Known values are: "Send" and "Receive". + :vartype direction: Union[str, "Direction"] + :ivar justification: Justification for the connection request. + :vartype justification: str + :ivar status: Status of the connection. Known values are: "InReview", "Approved", "Rejected", + and "Accepted". + :vartype status: Union[str, "ConnectionStatus"] + :ivar forceDisabledStatus: Force disablement status of the current connection. + :vartype forceDisabledStatus: list[Union[str, "ForceDisabledStatus"]] + :ivar statusReason: Reason for status. + :vartype statusReason: str + :ivar linkStatus: Link status of the current connection. Known values are: "Linked" and + "Unlinked". + :vartype linkStatus: Union[str, "LinkStatus"] + :ivar linkedConnectionId: Resource ID of the linked connection. + :vartype linkedConnectionId: str + :ivar flowTypes: The flow types being requested for this connection. This FlowType property has + reached end of life support starting version 2025-05-30-preview. Please create a FlowProfile + resource instead. + :vartype flowTypes: list[Union[str, "FlowType"]] + :ivar flowProfileList: Provides a list of FlowProfiles . + :vartype flowProfileList: list["FlowProfileMetadata"] + :ivar requirementId: Requirement ID of the connection. + :vartype requirementId: str + :ivar remoteSubscriptionId: Subscription ID to link cloud subscriptions together. + :vartype remoteSubscriptionId: str + :ivar approver: Approver of this connection request. + :vartype approver: str + :ivar pin: PIN to link requests together. + :vartype pin: str + :ivar dateSubmitted: The timestamp that this connection request was submitted at. + :vartype dateSubmitted: str + :ivar primaryContact: The primary contact for this connection request. + :vartype primaryContact: str + :ivar secondaryContacts: The secondary contacts for this connection request. + :vartype secondaryContacts: list[str] + :ivar provisioningState: Provisioning state of the connection. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar policies: The policies for this connection. The policies property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype policies: list[str] + :ivar schemas: The schemas for this connection. The schemas property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype schemas: list["Schema"] + :ivar schemaUris: The schema URIs for this connection. The schemaUris property has reached end + of life support starting version 2025-05-30-preview. Please create and use a FlowProfile + resource instead. + :vartype schemaUris: list[str] + :ivar apiHostname: Hostname specific to API Flows. + :vartype apiHostname: str + """ + + pipeline: Required[str] + """Pipeline to use to transfer data. Required.""" + direction: Union[str, "Direction"] + """Direction of data movement. Known values are: \"Send\" and \"Receive\".""" + justification: str + """Justification for the connection request.""" + status: Union[str, "ConnectionStatus"] + """Status of the connection. Known values are: \"InReview\", \"Approved\", \"Rejected\", and + \"Accepted\".""" + forceDisabledStatus: list[Union[str, "ForceDisabledStatus"]] + """Force disablement status of the current connection.""" + statusReason: str + """Reason for status.""" + linkStatus: Union[str, "LinkStatus"] + """Link status of the current connection. Known values are: \"Linked\" and \"Unlinked\".""" + linkedConnectionId: str + """Resource ID of the linked connection.""" + flowTypes: list[Union[str, "FlowType"]] + """The flow types being requested for this connection. This FlowType property has reached end of + life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead.""" + flowProfileList: list["FlowProfileMetadata"] + """Provides a list of FlowProfiles .""" + requirementId: str + """Requirement ID of the connection.""" + remoteSubscriptionId: str + """Subscription ID to link cloud subscriptions together.""" + approver: str + """Approver of this connection request.""" + pin: str + """PIN to link requests together.""" + dateSubmitted: str + """The timestamp that this connection request was submitted at.""" + primaryContact: str + """The primary contact for this connection request.""" + secondaryContacts: list[str] + """The secondary contacts for this connection request.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the connection. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Accepted\".""" + policies: list[str] + """The policies for this connection. The policies property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schemas: list["Schema"] + """The schemas for this connection. The schemas property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schemaUris: list[str] + """The schema URIs for this connection. The schemaUris property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + apiHostname: str + """Hostname specific to API Flows.""" + + +class ConnectionsPatch(TypedDict, total=False): + """The connections resource patch definition. + + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + tags: dict[str, str] + """Resource tags.""" + + +class DataSizeRuleset(TypedDict, total=False): + """Defines rules that enforce minimum and maximum file size limits for data replication. + + :ivar maximum: Optional. Specifies the maximum allowed size (in bytes) for files to be + replicated. Any file size greater than maximum will be denied replication. + :vartype maximum: int + :ivar minimum: Optional. Default is 0. Specifies the minimum required size (in bytes) for a + file to be eligible for replication. Any file size less than minimum will be denied + replication. + :vartype minimum: int + """ + + maximum: int + """Optional. Specifies the maximum allowed size (in bytes) for files to be replicated. Any file + size greater than maximum will be denied replication.""" + minimum: int + """Optional. Default is 0. Specifies the minimum required size (in bytes) for a file to be + eligible for replication. Any file size less than minimum will be denied replication.""" + + +class Flow(TrackedResource): + """The flow resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of flow. + :vartype properties: "FlowProperties" + :ivar plan: Details of the resource plan. + :vartype plan: "Plan" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "FlowProperties" + """Properties of flow.""" + plan: "Plan" + """Details of the resource plan.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class FlowProfile(TrackedResource): + """Represents a FlowProfile Azure resource, which defines a data replication scenario with a + specific data classification and a set of configurable policy rules. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The set of configuration properties that define the behavior and rules of the + FlowProfile. + :vartype properties: "FlowProfileProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "FlowProfileProperties" + """The set of configuration properties that define the behavior and rules of the FlowProfile.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class FlowProfileMetadata(TypedDict, total=False): + """The FlowProfile Metadata used to concisely provide all publicly viewable information. + + :ivar pipeline: The name of the parent Pipeline Azure resource associated with this + FlowProfile. Required. + :vartype pipeline: str + :ivar name: The name of the FlowProfile. Required. + :vartype name: str + :ivar replicationScenario: The data replication scenario handled by this FlowProfile. Please + note, that this value cannot be updated after creation. See the FlowProfilePatchProperties to + see updateable properties. Required. Known values are: "Messaging", "API", "Stream", "Files", + "SoftwareArtifacts", and "Complex". + :vartype replicationScenario: Union[str, "DataClassType"] + :ivar flowProfileId: A guid represented as a string for the FlowProfile resource, assigned by + the system. Required. + :vartype flowProfileId: str + :ivar status: The operational status of the FlowProfile. Required. Known values are: + "Obsolete", "Enabled", and "Disabled". + :vartype status: Union[str, "FlowProfileStatus"] + :ivar description: A description of the FlowProfile and its rulesets. The description should + describe the flowprofile's purpose and rulesets applied. Required. + :vartype description: str + """ + + pipeline: Required[str] + """The name of the parent Pipeline Azure resource associated with this FlowProfile. Required.""" + name: Required[str] + """The name of the FlowProfile. Required.""" + replicationScenario: Required[Union[str, "DataClassType"]] + """The data replication scenario handled by this FlowProfile. Please note, that this value cannot + be updated after creation. See the FlowProfilePatchProperties to see updateable properties. + Required. Known values are: \"Messaging\", \"API\", \"Stream\", \"Files\", + \"SoftwareArtifacts\", and \"Complex\".""" + flowProfileId: Required[str] + """A guid represented as a string for the FlowProfile resource, assigned by the system. Required.""" + status: Required[Union[str, "FlowProfileStatus"]] + """The operational status of the FlowProfile. Required. Known values are: \"Obsolete\", + \"Enabled\", and \"Disabled\".""" + description: Required[str] + """A description of the FlowProfile and its rulesets. The description should describe the + flowprofile's purpose and rulesets applied. Required.""" + + +class FlowProfilePatch(TypedDict, total=False): + """Defines the patchable properties for a FlowProfile resource. + + :ivar properties: Properties of FlowProfile patch body. + :vartype properties: "FlowProfilePatchProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: "FlowProfilePatchProperties" + """Properties of FlowProfile patch body.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + tags: dict[str, str] + """Resource tags.""" + + +class FlowProfilePatchProperties(TypedDict, total=False): + """Represents the updatable properties of a FlowProfile. + + :ivar provisioningState: The current provisioning state of the FlowProfile resource. Known + values are: "Succeeded", "Failed", "Canceled", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar description: A description of the FlowProfile that defines the replication scenario. + :vartype description: str + :ivar rulesets: A set of configurable rulesets applied to this FlowProfile. + :vartype rulesets: "FlowProfileRulesets" + :ivar status: The operational status of the FlowProfile. Known values are: "Obsolete", + "Enabled", and "Disabled". + :vartype status: Union[str, "FlowProfileStatus"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The current provisioning state of the FlowProfile resource. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", and \"Accepted\".""" + description: str + """A description of the FlowProfile that defines the replication scenario.""" + rulesets: "FlowProfileRulesets" + """A set of configurable rulesets applied to this FlowProfile.""" + status: Union[str, "FlowProfileStatus"] + """The operational status of the FlowProfile. Known values are: \"Obsolete\", \"Enabled\", and + \"Disabled\".""" + + +class FlowProfileProperties(TypedDict, total=False): + """Defines the full set of properties for a FlowProfile resource. + + :ivar provisioningState: The current provisioning state of the FlowProfile. Known values are: + "Succeeded", "Failed", "Canceled", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar flowProfileId: A guid represented as a string for the FlowProfile resource, assigned by + the system. + :vartype flowProfileId: str + :ivar replicationScenario: The data replication scenario handled by this FlowProfile. Please + not, that this value cannot be updated after creation. Required. Known values are: "Messaging", + "API", "Stream", "Files", "SoftwareArtifacts", and "Complex". + :vartype replicationScenario: Union[str, "DataClassType"] + :ivar status: The operational status of the FlowProfile. Required. Known values are: + "Obsolete", "Enabled", and "Disabled". + :vartype status: Union[str, "FlowProfileStatus"] + :ivar description: A user-defined description of the FlowProfile. Required. + :vartype description: str + :ivar rulesets: A set of configurable rulesets applied to this FlowProfile. + :vartype rulesets: "FlowProfileRulesets" + """ + + provisioningState: Union[str, "ProvisioningState"] + """The current provisioning state of the FlowProfile. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Accepted\".""" + flowProfileId: str + """A guid represented as a string for the FlowProfile resource, assigned by the system.""" + replicationScenario: Required[Union[str, "DataClassType"]] + """The data replication scenario handled by this FlowProfile. Please not, that this value cannot + be updated after creation. Required. Known values are: \"Messaging\", \"API\", \"Stream\", + \"Files\", \"SoftwareArtifacts\", and \"Complex\".""" + status: Required[Union[str, "FlowProfileStatus"]] + """The operational status of the FlowProfile. Required. Known values are: \"Obsolete\", + \"Enabled\", and \"Disabled\".""" + description: Required[str] + """A user-defined description of the FlowProfile. Required.""" + rulesets: "FlowProfileRulesets" + """A set of configurable rulesets applied to this FlowProfile.""" + + +class FlowProfileRulesets(TypedDict, total=False): + """The allowed set of configurable rulesets for a FlowProfile resource, used during data + replication. All rulesets are optional, and any ruleset configured will be applied to every + applicable replicating data. Any data that fails a ruleset will be denied replication. If a + ruleset is not configured then the ruleset is considered disabled and will not apply towards + replicating data. + + :ivar antivirus: Antivirus scanning rules for replicated data. + :vartype antivirus: "AntivirusRuleset" + :ivar archives: Rules for handling archive files during replication. + :vartype archives: "ArchiveRuleset" + :ivar dataSize: Rules that enforce minimum and maximum data size limits. + :vartype dataSize: "DataSizeRuleset" + :ivar mimeFilters: Rules for filtering files based on MIME types. + :vartype mimeFilters: "MimeFilterRuleset" + :ivar xmlFilters: Rules for filtering XML content using XSD schemas. + :vartype xmlFilters: "XmlFilterRuleset" + :ivar textMatching: Rules for detecting and blocking specific text patterns. + :vartype textMatching: "TextMatchingRuleset" + """ + + antivirus: "AntivirusRuleset" + """Antivirus scanning rules for replicated data.""" + archives: "ArchiveRuleset" + """Rules for handling archive files during replication.""" + dataSize: "DataSizeRuleset" + """Rules that enforce minimum and maximum data size limits.""" + mimeFilters: "MimeFilterRuleset" + """Rules for filtering files based on MIME types.""" + xmlFilters: "XmlFilterRuleset" + """Rules for filtering XML content using XSD schemas.""" + textMatching: "TextMatchingRuleset" + """Rules for detecting and blocking specific text patterns.""" + + +class FlowProperties(TypedDict, total=False): + """Properties of flow. + + :ivar connection: The connection associated with this flow. + :vartype connection: "SelectedResource" + :ivar flowId: Dataflow GUID associated with this flow. + :vartype flowId: str + :ivar keyVaultUri: URI to a Key Vault Secret containing a SAS token. + :vartype keyVaultUri: str + :ivar linkStatus: Link status of the current flow. Known values are: "Linked" and "Unlinked". + :vartype linkStatus: Union[str, "LinkStatus"] + :ivar linkedFlowId: Resource ID of the linked flow. + :vartype linkedFlowId: str + :ivar status: Status of the current flow. Known values are: "Enabled" and "Disabled". + :vartype status: Union[str, "FlowStatus"] + :ivar forceDisabledStatus: Force disablement status of the current flow. + :vartype forceDisabledStatus: list[Union[str, "ForceDisabledStatus"]] + :ivar storageAccountName: Storage Account. + :vartype storageAccountName: str + :ivar storageAccountId: Storage Account ID. + :vartype storageAccountId: str + :ivar storageContainerName: Storage Container Name. + :vartype storageContainerName: str + :ivar storageTableName: Storage Table Name. + :vartype storageTableName: str + :ivar serviceBusQueueId: Service Bus Queue ID. + :vartype serviceBusQueueId: str + :ivar flowProfile: Type of FlowProfile to use for transfer via the flow. + :vartype flowProfile: "FlowProfileMetadata" + :ivar flowDataType: The Flow's data class. Known values are: "ServiceBus", "EventHub", + "ApiEndpoint", "ApiSDK", "Video", "Blob", and "Table". + :vartype flowDataType: Union[str, "DataClass"] + :ivar flowType: The flow type for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + Known values are: "Unknown", "Complex", "DevSecOps", "Messaging", "Mission", + "MicrosoftInternal", "BasicFiles", "Data", "Standard", "StreamingVideo", "Opaque", + "MissionOpaqueXML", "DiskImages", and "API". + :vartype flowType: Union[str, "FlowType"] + :ivar dataType: Type of data to transfer via the flow. The property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. Known values are: "Blob" and "Table". + :vartype dataType: Union[str, "DataType"] + :ivar provisioningState: Provisioning state of the flow. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar policies: The policies for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + :vartype policies: list[str] + :ivar schema: The selected schema for this flow. The property has reached end of life support + starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + :vartype schema: "Schema" + :ivar messagingOptions: The messaging options for this flow. + :vartype messagingOptions: "MessagingOptions" + :ivar apiFlowOptions: The API Flow configuration options for Azure Data Transfer API Flow type. + :vartype apiFlowOptions: "ApiFlowOptions" + :ivar customerManagedKeyVaultUri: The URI to the customer managed key for this flow. + :vartype customerManagedKeyVaultUri: str + :ivar streamId: The flow stream identifier. + :vartype streamId: str + :ivar streamProtocol: The protocol of the stream. Known values are: "UDP", "SRT", and "RTP". + :vartype streamProtocol: Union[str, "StreamProtocol"] + :ivar streamLatency: The latency of the stream in milliseconds. + :vartype streamLatency: int + :ivar passphrase: The passphrase used for SRT streams. + :vartype passphrase: str + :ivar sourceAddresses: The source IP address and CIDR ranges of the stream. + :vartype sourceAddresses: "StreamSourceAddresses" + :ivar destinationEndpoints: The destination endpoints of the stream. + :vartype destinationEndpoints: list[str] + :ivar destinationEndpointPorts: The destination endpoint ports of the stream. + :vartype destinationEndpointPorts: list[int] + :ivar eventHubId: Event Hub ID. + :vartype eventHubId: str + :ivar consumerGroup: Event Hub Consumer Group. + :vartype consumerGroup: str + """ + + connection: "SelectedResource" + """The connection associated with this flow.""" + flowId: str + """Dataflow GUID associated with this flow.""" + keyVaultUri: str + """URI to a Key Vault Secret containing a SAS token.""" + linkStatus: Union[str, "LinkStatus"] + """Link status of the current flow. Known values are: \"Linked\" and \"Unlinked\".""" + linkedFlowId: str + """Resource ID of the linked flow.""" + status: Union[str, "FlowStatus"] + """Status of the current flow. Known values are: \"Enabled\" and \"Disabled\".""" + forceDisabledStatus: list[Union[str, "ForceDisabledStatus"]] + """Force disablement status of the current flow.""" + storageAccountName: str + """Storage Account.""" + storageAccountId: str + """Storage Account ID.""" + storageContainerName: str + """Storage Container Name.""" + storageTableName: str + """Storage Table Name.""" + serviceBusQueueId: str + """Service Bus Queue ID.""" + flowProfile: "FlowProfileMetadata" + """Type of FlowProfile to use for transfer via the flow.""" + flowDataType: Union[str, "DataClass"] + """The Flow's data class. Known values are: \"ServiceBus\", \"EventHub\", \"ApiEndpoint\", + \"ApiSDK\", \"Video\", \"Blob\", and \"Table\".""" + flowType: Union[str, "FlowType"] + """The flow type for this flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use a FlowProfile resource instead. Known values are: + \"Unknown\", \"Complex\", \"DevSecOps\", \"Messaging\", \"Mission\", \"MicrosoftInternal\", + \"BasicFiles\", \"Data\", \"Standard\", \"StreamingVideo\", \"Opaque\", \"MissionOpaqueXML\", + \"DiskImages\", and \"API\".""" + dataType: Union[str, "DataType"] + """Type of data to transfer via the flow. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead. Known values + are: \"Blob\" and \"Table\".""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the flow. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", and + \"Accepted\".""" + policies: list[str] + """The policies for this flow. The property has reached end of life support starting version + 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + schema: "Schema" + """The selected schema for this flow. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + messagingOptions: "MessagingOptions" + """The messaging options for this flow.""" + apiFlowOptions: "ApiFlowOptions" + """The API Flow configuration options for Azure Data Transfer API Flow type.""" + customerManagedKeyVaultUri: str + """The URI to the customer managed key for this flow.""" + streamId: str + """The flow stream identifier.""" + streamProtocol: Union[str, "StreamProtocol"] + """The protocol of the stream. Known values are: \"UDP\", \"SRT\", and \"RTP\".""" + streamLatency: int + """The latency of the stream in milliseconds.""" + passphrase: str + """The passphrase used for SRT streams.""" + sourceAddresses: "StreamSourceAddresses" + """The source IP address and CIDR ranges of the stream.""" + destinationEndpoints: list[str] + """The destination endpoints of the stream.""" + destinationEndpointPorts: list[int] + """The destination endpoint ports of the stream.""" + eventHubId: str + """Event Hub ID.""" + consumerGroup: str + """Event Hub Consumer Group.""" + + +class FlowsPatch(TypedDict, total=False): + """The flows resource patch definition. + + :ivar properties: Properties of flows patch body. + :vartype properties: "FlowsPatchProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: "FlowsPatchProperties" + """Properties of flows patch body.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + tags: dict[str, str] + """Resource tags.""" + + +class FlowsPatchProperties(TypedDict, total=False): + """Properties of flows patch body. + + :ivar streamProtocol: The protocol of the stream. Known values are: "UDP", "SRT", and "RTP". + :vartype streamProtocol: Union[str, "StreamProtocol"] + :ivar passphrase: The passphrase used for SRT streams. + :vartype passphrase: str + :ivar streamId: The flow stream identifier. + :vartype streamId: str + :ivar streamLatency: The latency of the stream in milliseconds. + :vartype streamLatency: int + """ + + streamProtocol: Union[str, "StreamProtocol"] + """The protocol of the stream. Known values are: \"UDP\", \"SRT\", and \"RTP\".""" + passphrase: str + """The passphrase used for SRT streams.""" + streamId: str + """The flow stream identifier.""" + streamLatency: int + """The latency of the stream in milliseconds.""" + + +class InternalMetadataProperties(TypedDict, total=False): + """Internal metadata of the connection inside pipeline. + + :ivar operationStatus: Operation status associated with the last patch request. + :vartype operationStatus: "OperationStatusProperties" + :ivar statusSetBy: User that last set the approved status for this connection. + :vartype statusSetBy: str + """ + + operationStatus: "OperationStatusProperties" + """Operation status associated with the last patch request.""" + statusSetBy: str + """User that last set the approved status for this connection.""" + + +class ListApprovedSchemasRequest(TypedDict, total=False): + """The request used to list approved schemas within the resource provider. + ListApprovedSchemaRequest has reached end of life support starting version 2025-05-30-preview. + Please manage schemas with a FlowProfile resource instead. + + :ivar pipeline: The name of the pipeline to filter approved schemas. + :vartype pipeline: str + :ivar direction: The direction pipeline to filter approved schemas. Known values are: "Send" + and "Receive". + :vartype direction: Union[str, "Direction"] + """ + + pipeline: str + """The name of the pipeline to filter approved schemas.""" + direction: Union[str, "Direction"] + """The direction pipeline to filter approved schemas. Known values are: \"Send\" and \"Receive\".""" + + +class ListFlowProfilesRequest(TypedDict, total=False): + """Defines the required request body for retrieving FlowProfile information for a provided + pipeline. + + :ivar pipeline: The name of the pipeline for which to retrieve associated FlowProfiles. + :vartype pipeline: str + """ + + pipeline: str + """The name of the pipeline for which to retrieve associated FlowProfiles.""" + + +class ListPipelineMetadataRequest(TypedDict, total=False): + """Defines the required request body for retrieving Pipeline metadata for a provided pipeline. + + :ivar pipeline: The name of the pipeline for which to retrieve associated metadata. Required. + :vartype pipeline: str + """ + + pipeline: Required[str] + """The name of the pipeline for which to retrieve associated metadata. Required.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class MessagingOptions(TypedDict, total=False): + """The option associated with messaging flows. + + :ivar billingTier: Billing tier for this messaging flow. Known values are: "BlobTransport", + "Standard", and "Premium". + :vartype billingTier: Union[str, "FlowBillingTier"] + :ivar performancePriority: Field indicating whether to enable guaranteed delivery on the flow + or not. The default disabled option chooses speed over consistency. When enabled, messages are + delivered with minimal delay, but delivery is not guaranteed under all conditions. Known values + are: "Enabled" and "Disabled". + :vartype performancePriority: Union[str, "EnablementStatus"] + """ + + billingTier: Union[str, "FlowBillingTier"] + """Billing tier for this messaging flow. Known values are: \"BlobTransport\", \"Standard\", and + \"Premium\".""" + performancePriority: Union[str, "EnablementStatus"] + """Field indicating whether to enable guaranteed delivery on the flow or not. The default disabled + option chooses speed over consistency. When enabled, messages are delivered with minimal delay, + but delivery is not guaranteed under all conditions. Known values are: \"Enabled\" and + \"Disabled\".""" + + +class MimeFilterRuleset(TypedDict, total=False): + """Rules for filtering files based on Media types (f.k.a MIME types). + + :ivar type: Specifies whether the filter is an allow list or deny list. For more detail, please + refer to the FilterType model. Known values are: "Allow" and "Deny". + :vartype type: Union[str, "FilterType"] + :ivar filters: Defines the Media types (f.k.a MIME types) and associated file extensions to be + filtered. For more detail, please refer to the MimeTypeFiler model. + :vartype filters: list["MimeTypeFilter"] + """ + + type: Union[str, "FilterType"] + """Specifies whether the filter is an allow list or deny list. For more detail, please refer to + the FilterType model. Known values are: \"Allow\" and \"Deny\".""" + filters: list["MimeTypeFilter"] + """Defines the Media types (f.k.a MIME types) and associated file extensions to be filtered. For + more detail, please refer to the MimeTypeFiler model.""" + + +class MimeTypeFilter(TypedDict, total=False): + """Defines a list of Media types (f.k.a MIME Types) and associated file extensions subject to + filtering. + + :ivar media: The Media Types (f.k.a MIME types), following IANA standards (e.g., + application/json, image/png). For a more detailed list of allowed media types please refer to + the Tika documentation: + `https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml + `_. + :vartype media: str + :ivar extensions: A list of file extensions associated with the specified Media type (e.g., + .json, .png). To specify files with no extension, use an empty string "".". + :vartype extensions: list[str] + """ + + media: str + """The Media Types (f.k.a MIME types), following IANA standards (e.g., application/json, + image/png). For a more detailed list of allowed media types please refer to the Tika + documentation: + `https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml + `_.""" + extensions: list[str] + """A list of file extensions associated with the specified Media type (e.g., .json, .png). To + specify files with no extension, use an empty string \"\".\".""" + + +class OperationStatusProperties(TypedDict, total=False): + """Operation status associated with the last patch request. + + :ivar status: Operation status for the last patch request for this connection. Known values + are: "Failed" and "Succeeded". + :vartype status: Union[str, "OperationStatusEnum"] + :ivar id: Operation status ID of the last patch request for this connection. + :vartype id: str + :ivar message: Message for the operation for the last patch request for this connection. + :vartype message: str + """ + + status: Union[str, "OperationStatusEnum"] + """Operation status for the last patch request for this connection. Known values are: \"Failed\" + and \"Succeeded\".""" + id: str + """Operation status ID of the last patch request for this connection.""" + message: str + """Message for the operation for the last patch request for this connection.""" + + +class Pipeline(TrackedResource): + """The pipeline resource definition. A Pipeline defines the scope and identity under which data + replication scenarios are managed. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The set of configurable properties for the Pipeline resource. + :vartype properties: "PipelineProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "PipelineProperties" + """The set of configurable properties for the Pipeline resource.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class PipelineConnectionProperties(TypedDict, total=False): + """Connection properties inside pipeline. + + :ivar internalMetadata: Internal metadata of the connection inside pipeline. + :vartype internalMetadata: "InternalMetadataProperties" + """ + + internalMetadata: "InternalMetadataProperties" + """Internal metadata of the connection inside pipeline.""" + + +class PipelineProperties(TypedDict, total=False): + """Properties of pipeline. + + :ivar remoteCloud: Remote cloud of the data to be transferred or received. Required. + :vartype remoteCloud: str + :ivar displayName: Display name of this pipeline. + :vartype displayName: str + :ivar connections: Connections associated with pipeline. + :vartype connections: list["ReadPipelineConnection"] + :ivar subscribers: Subscribers of this resource. + :vartype subscribers: list["Subscriber"] + :ivar provisioningState: Provisioning state of the pipeline. Known values are: "Succeeded", + "Failed", "Canceled", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar policies: The policies for this pipeline. The policies property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype policies: list[str] + :ivar flowTypes: The flow type for this flow. The flowTypes property has reached end of life + support starting version 2025-05-30-preview. Please create and use a FlowProfile resource + instead. + :vartype flowTypes: list[Union[str, "FlowType"]] + :ivar disabledFlowTypes: The flow types that are disabled for this pipeline. + :vartype disabledFlowTypes: list[Union[str, "FlowType"]] + :ivar disabledDataClass: The DataClasses that are disabled for this pipeline. + :vartype disabledDataClass: list[Union[str, "DataClass"]] + :ivar quarantineDownloadStorageAccount: Quarantine Download Storage Account. + :vartype quarantineDownloadStorageAccount: str + :ivar quarantineDownloadStorageContainer: Quarantine Download Storage Container. + :vartype quarantineDownloadStorageContainer: str + :ivar status: Status of the current pipeline. Known values are: "Enabled" and "Disabled". + :vartype status: Union[str, "PipelineStatus"] + """ + + remoteCloud: Required[str] + """Remote cloud of the data to be transferred or received. Required.""" + displayName: str + """Display name of this pipeline.""" + connections: list["ReadPipelineConnection"] + """Connections associated with pipeline.""" + subscribers: list["Subscriber"] + """Subscribers of this resource.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the pipeline. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Accepted\".""" + policies: list[str] + """The policies for this pipeline. The policies property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + flowTypes: list[Union[str, "FlowType"]] + """The flow type for this flow. The flowTypes property has reached end of life support starting + version 2025-05-30-preview. Please create and use a FlowProfile resource instead.""" + disabledFlowTypes: list[Union[str, "FlowType"]] + """The flow types that are disabled for this pipeline.""" + disabledDataClass: list[Union[str, "DataClass"]] + """The DataClasses that are disabled for this pipeline.""" + quarantineDownloadStorageAccount: str + """Quarantine Download Storage Account.""" + quarantineDownloadStorageContainer: str + """Quarantine Download Storage Container.""" + status: Union[str, "PipelineStatus"] + """Status of the current pipeline. Known values are: \"Enabled\" and \"Disabled\".""" + + +class PipelinesPatch(TypedDict, total=False): + """The pipelines resource patch definition. + + :ivar properties: Properties of pipelines patch body. + :vartype properties: "PipelinesPatchProperties" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "PipelinesPatchProperties" + """Properties of pipelines patch body.""" + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class PipelinesPatchProperties(TypedDict, total=False): + """Properties of pipelines patch body. The property has reached end of life support starting + version 2025-05-30-preview. Please create and use the FlowProfile resource instead. + + :ivar flowTypes: The flow types allowed for this pipeline. FlowTypes has reached end of life + support starting version 2025-05-30-preview. Please create and use the FlowProfile property + instead. + :vartype flowTypes: list[Union[str, "FlowType"]] + """ + + flowTypes: list[Union[str, "FlowType"]] + """The flow types allowed for this pipeline. FlowTypes has reached end of life support starting + version 2025-05-30-preview. Please create and use the FlowProfile property instead.""" + + +class Plan(TypedDict, total=False): + """Plan for the resource. + + :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required. + :vartype name: str + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + Required. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :vartype product: str + :ivar promotionCode: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotionCode: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + name: Required[str] + """A user defined name of the 3rd Party Artifact that is being procured. Required.""" + publisher: Required[str] + """The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. Required.""" + product: Required[str] + """The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID + specified for the artifact at the time of Data Market onboarding. Required.""" + promotionCode: str + """A publisher provided promotion code as provisioned in Data Market for the said + product/artifact.""" + version: str + """The version of the desired product/artifact.""" + + +class ReadPipelineConnection(TypedDict, total=False): + """The ReadPipelineconnection. + + :ivar id: Connection id inside pipeline. Required. + :vartype id: str + :ivar name: Connection name inside pipeline. + :vartype name: str + :ivar type: Connection type inside pipeline. + :vartype type: str + :ivar location: Connection location inside pipeline. + :vartype location: str + :ivar etag: Connection etag inside pipeline. + :vartype etag: str + :ivar systemData: Metadata pertaining to creation and last modification of the resource. + :vartype systemData: "SystemData" + :ivar properties: Connection properties inside pipeline. + :vartype properties: "PipelineConnectionProperties" + """ + + id: Required[str] + """Connection id inside pipeline. Required.""" + name: str + """Connection name inside pipeline.""" + type: str + """Connection type inside pipeline.""" + location: str + """Connection location inside pipeline.""" + etag: str + """Connection etag inside pipeline.""" + systemData: "SystemData" + """Metadata pertaining to creation and last modification of the resource.""" + properties: "PipelineConnectionProperties" + """Connection properties inside pipeline.""" + + +class RemoteEndpointSettings(TypedDict, total=False): + """Properties to configure the destination remote endpoint for API calls. + + :ivar endpoint: The remote endpoint uri all API calls. Required. + :vartype endpoint: str + :ivar authentication: Optional and for advanced used only. A list of authentication methods to + use when accessing the remote endpoint. If not provided, the default S2S authentication using + Entra (API Flow Managed Identity) and RBAC will be applied. + :vartype authentication: list["Authentication"] + """ + + endpoint: Required[str] + """The remote endpoint uri all API calls. Required.""" + authentication: list["Authentication"] + """Optional and for advanced used only. A list of authentication methods to use when accessing the + remote endpoint. If not provided, the default S2S authentication using Entra (API Flow Managed + Identity) and RBAC will be applied.""" + + +class ResourceBody(TypedDict, total=False): + """The resource to reference. + + :ivar id: ID of the resource. Required. + :vartype id: str + :ivar statusReason: Reason for resource operation. + :vartype statusReason: str + """ + + id: Required[str] + """ID of the resource. Required.""" + statusReason: str + """Reason for resource operation.""" + + +class Schema(TypedDict, total=False): + """The schema object. Schemas has reached end of life support starting version 2025-05-30-preview. + Please manage schemas with a FlowProfile resource instead. + + :ivar id: ID associated with this schema. + :vartype id: str + :ivar connectionId: Connection ID associated with this schema. + :vartype connectionId: str + :ivar status: Status of the schema. Known values are: "New" and "Approved". + :vartype status: Union[str, "SchemaStatus"] + :ivar name: Name of the schema. + :vartype name: str + :ivar content: Content of the schema. + :vartype content: str + :ivar direction: The direction of the schema. Known values are: "Send" and "Receive". + :vartype direction: Union[str, "Direction"] + :ivar schemaUri: Uri containing SAS token for the zipped schema. + :vartype schemaUri: str + :ivar schemaType: The Schema Type. Known values are: "Xsd" and "Zip". + :vartype schemaType: Union[str, "SchemaType"] + """ + + id: str + """ID associated with this schema.""" + connectionId: str + """Connection ID associated with this schema.""" + status: Union[str, "SchemaStatus"] + """Status of the schema. Known values are: \"New\" and \"Approved\".""" + name: str + """Name of the schema.""" + content: str + """Content of the schema.""" + direction: Union[str, "Direction"] + """The direction of the schema. Known values are: \"Send\" and \"Receive\".""" + schemaUri: str + """Uri containing SAS token for the zipped schema.""" + schemaType: Union[str, "SchemaType"] + """The Schema Type. Known values are: \"Xsd\" and \"Zip\".""" + + +class SelectedResource(TypedDict, total=False): + """A resource selected from ARM. + + :ivar name: Name of the connection. + :vartype name: str + :ivar id: Id of the connection. Required. + :vartype id: str + :ivar location: Location of the connection. + :vartype location: str + :ivar subscriptionName: Name of the subscription with the connection. + :vartype subscriptionName: str + """ + + name: str + """Name of the connection.""" + id: Required[str] + """Id of the connection. Required.""" + location: str + """Location of the connection.""" + subscriptionName: str + """Name of the subscription with the connection.""" + + +class SetDestinationEndpointPorts(TypedDict, total=False): + """Set the destination endpoint ports for the specified flow. + + :ivar ports: The specified flow destination endpoint ports. + :vartype ports: list[int] + """ + + ports: list[int] + """The specified flow destination endpoint ports.""" + + +class SetDestinationEndpoints(TypedDict, total=False): + """Set the destination endpoints for the specified flow. + + :ivar endpoints: The specified flow destination endpoints. + :vartype endpoints: list[str] + """ + + endpoints: list[str] + """The specified flow destination endpoints.""" + + +class SetSourceAddresses(TypedDict, total=False): + """Set the source addresses for the specified flow. + + :ivar values: Source addresses. + :vartype values: list[str] + """ + + values: list[str] + """Source addresses.""" + + +class SetStreamPassphrase(TypedDict, total=False): + """Set the passphrase used for SRT streams. + + :ivar value: The passphrase used for SRT streams. + :vartype value: str + """ + + value: str + """The passphrase used for SRT streams.""" + + +class StreamSourceAddresses(TypedDict, total=False): + """The source IP address and CIDR ranges of the stream. + + :ivar sourceAddresses: A source IP address or CIDR range. + :vartype sourceAddresses: list[str] + """ + + sourceAddresses: list[str] + """A source IP address or CIDR range.""" + + +class Subscriber(TypedDict, total=False): + """An individual that would like to subscribe to events that occur on a pipeline. + + :ivar email: Email of the subscriber. + :vartype email: str + :ivar notifications: Number specifying what notifications to receive. + :vartype notifications: int + """ + + email: str + """Email of the subscriber.""" + notifications: int + """Number specifying what notifications to receive.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TextMatchingRuleset(TypedDict, total=False): + """Rules for detecting and blocking specific text patterns. If a file contains a text pattern that + is part of the configured deny list, the file will be denied. + + :ivar deny: A list of text patterns to block, each with matching rules and case sensitivity + options. + :vartype deny: list["TextMatchingRulesetDeny"] + """ + + deny: list["TextMatchingRulesetDeny"] + """A list of text patterns to block, each with matching rules and case sensitivity options.""" + + +class TextMatchingRulesetDeny(TypedDict, total=False): + """TextMatchingRulesetDeny. + + :ivar text: The word or phrase to match against replicated content. A phrase with spaces will + be considered a single substring. Required. + :vartype text: str + :ivar matchType: Specifies the text matching condition for text comparison. For more detail + please refer to the MatchType model. Required. Known values are: "Partial" and "Complete". + :vartype matchType: Union[str, "MatchType"] + :ivar caseSensitivity: Specifies the text matching conditions based on casing. For more detail + please refer to the Casing model. Required. Known values are: "Insensitive" and "Sensitive". + :vartype caseSensitivity: Union[str, "Casing"] + """ + + text: Required[str] + """The word or phrase to match against replicated content. A phrase with spaces will be considered + a single substring. Required.""" + matchType: Required[Union[str, "MatchType"]] + """Specifies the text matching condition for text comparison. For more detail please refer to the + MatchType model. Required. Known values are: \"Partial\" and \"Complete\".""" + caseSensitivity: Required[Union[str, "Casing"]] + """Specifies the text matching conditions based on casing. For more detail please refer to the + Casing model. Required. Known values are: \"Insensitive\" and \"Sensitive\".""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" + + +class XmlFilterRuleset(TypedDict, total=False): + """Rules for filtering XML content using XSD schemas. + + :ivar defaultNamespace: The default XML namespace used for schema validation. + :vartype defaultNamespace: str + :ivar reference: Defines the method for referencing the xml schema. "Inline" + :vartype reference: Union[str, "XmlReferenceType"] + :ivar schema: The inline XSD schema to be used for validation. + :vartype schema: str + """ + + defaultNamespace: str + """The default XML namespace used for schema validation.""" + reference: Union[str, "XmlReferenceType"] + """Defines the method for referencing the xml schema. \"Inline\"""" + schema: str + """The inline XSD schema to be used for validation.""" diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/dev_requirements.txt b/sdk/azuredatatransfer/azure-mgmt-datatransfer/dev_requirements.txt new file mode 100644 index 000000000000..ece056fe0984 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/dev_requirements.txt @@ -0,0 +1,5 @@ +-e ../../../eng/tools/azure-sdk-tools +../../core/azure-core +../../identity/azure-identity +../../core/azure-mgmt-core +aiohttp \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/approve_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/approve_connection.py new file mode 100644 index 000000000000..e049578e6302 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/approve_connection.py @@ -0,0 +1,47 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python approve_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.begin_approve_connection( + resource_group_name="testRG", + pipeline_name="testPipeline", + connection={ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection", + "statusReason": "Example reason", + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/approveConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_flow_profiles_maximum_set_gen.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_flow_profiles_maximum_set_gen.py new file mode 100644 index 000000000000..a053166c06c7 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_flow_profiles_maximum_set_gen.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python azure_data_transfer_list_flow_profiles_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.azure_data_transfer.list_flow_profiles( + body={"pipeline": "str"}, + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/AzureDataTransfer_ListFlowProfiles_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_pipeline_metadata.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_pipeline_metadata.py new file mode 100644 index 000000000000..656c70b733bc --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/azure_data_transfer_list_pipeline_metadata.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python azure_data_transfer_list_pipeline_metadata.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.azure_data_transfer.list_pipeline_metadata( + body={"pipeline": "testPipeline"}, + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/AzureDataTransfer_ListPipelineMetadata.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_connection.py new file mode 100644 index 000000000000..30ed6ec8c10e --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_connection.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python create_or_update_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.begin_create_or_update( + resource_group_name="testRG", + connection_name="testConnection", + connection={ + "location": "East US", + "properties": { + "flowProfileList": [ + { + "description": "Testing 123", + "flowProfileId": "25f2c41a-6e29-4c40-a033-b4de81d4a681", + "name": "flowProfileNamea", + "pipeline": "pipelinea", + "replicationScenario": "Files", + "status": "Enabled", + }, + { + "description": "Testing 123", + "flowProfileId": "66b00598-cabb-4a85-b3d8-88905ac899b8", + "name": "flowProfileNameb", + "pipeline": "pipelinea", + "replicationScenario": "Files", + "status": "Enabled", + }, + ], + "justification": "justification", + "pipeline": "testdc", + "requirementId": "id", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/createOrUpdateConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow.py new file mode 100644 index 000000000000..7da8dd85bb40 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow.py @@ -0,0 +1,63 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python create_or_update_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_create_or_update( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + flow={ + "location": "East US", + "properties": { + "connection": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection" + }, + "flowDataType": "Blob", + "flowProfile": { + "description": "Testing 123", + "flowProfileId": "25f2c41a-6e29-4c40-a033-b4de81d4a681", + "name": "flowProfileName", + "pipeline": "testPipeline", + "replicationScenario": "Files", + "status": "Enabled", + }, + "storageAccountName": "testsa", + "storageContainerName": "testcontainer", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/createOrUpdateFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow_profile.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow_profile.py new file mode 100644 index 000000000000..1ac9324a7916 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_flow_profile.py @@ -0,0 +1,77 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python create_or_update_flow_profile.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flow_profiles.begin_create_or_update( + resource_group_name="testRG", + pipeline_name="testPipeline", + flow_profile_name="testFlowProfile", + resource={ + "location": "East US", + "properties": { + "description": "Hello world description", + "replicationScenario": "Files", + "rulesets": { + "antivirus": {"avSolutions": ["Defender", "ClamAv"]}, + "archives": { + "maximumCompressionRatioLimit": 123, + "maximumDepthLimit": 12, + "maximumExpansionSizeLimit": 123456, + "minimumSizeForExpansion": 1, + }, + "dataSize": {"maximum": 123456789, "minimum": 1}, + "mimeFilters": { + "filters": [{"extensions": [".json", ".app", ".js"], "media": "application/json"}], + "type": "Allow", + }, + "textMatching": { + "deny": [ + {"caseSensitivity": "Insensitive", "matchType": "Partial", "text": "hello world"}, + {"caseSensitivity": "Sensitive", "matchType": "Complete", "text": "hello"}, + ] + }, + "xmlFilters": { + "defaultNamespace": "testnamespace", + "reference": "Inline", + "schema": ' ', + }, + }, + "status": "Enabled", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/createOrUpdateFlowProfile.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_pipeline.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_pipeline.py new file mode 100644 index 000000000000..7a1ae7d80c3e --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/create_or_update_pipeline.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python create_or_update_pipeline.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.begin_create_or_update( + resource_group_name="testRG", + pipeline_name="testPipeline", + pipeline={"location": "East US", "properties": {"remoteCloud": "testdc"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/createOrUpdatePipeline.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_connection.py new file mode 100644 index 000000000000..1c9cff2fd032 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_connection.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python delete_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.connections.begin_delete( + resource_group_name="testRG", + connection_name="testConnection", + ).result() + + +# x-ms-original-file: 2026-02-06-preview/deleteConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow.py new file mode 100644 index 000000000000..2340bf05061b --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python delete_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.flows.begin_delete( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ).result() + + +# x-ms-original-file: 2026-02-06-preview/deleteFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow_profile.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow_profile.py new file mode 100644 index 000000000000..816ed9a17c50 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_flow_profile.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python delete_flow_profile.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.flow_profiles.begin_delete( + resource_group_name="testRG", + pipeline_name="testPipeline", + flow_profile_name="testFlowProfile", + ).result() + + +# x-ms-original-file: 2026-02-06-preview/deleteFlowProfile.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_pipeline.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_pipeline.py new file mode 100644 index 000000000000..8932a151801d --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/delete_pipeline.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python delete_pipeline.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.pipelines.begin_delete( + resource_group_name="testRG", + pipeline_name="testPipeline", + ).result() + + +# x-ms-original-file: 2026-02-06-preview/deletePipeline.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/disable_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/disable_flow.py new file mode 100644 index 000000000000..93caca2ae797 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/disable_flow.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python disable_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_disable( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/disableFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/enable_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/enable_flow.py new file mode 100644 index 000000000000..5ab56e20b61a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/enable_flow.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python enable_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_enable( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/enableFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/execute_action.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/execute_action.py new file mode 100644 index 000000000000..b783f642a98f --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/execute_action.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python execute_action.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.begin_execute_action( + resource_group_name="testRG", + pipeline_name="testPipeline", + action={ + "actionType": "ForceDisable", + "targetType": "Connection", + "targets": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection" + ], + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/executeAction.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/generate_flow_passphrase.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/generate_flow_passphrase.py new file mode 100644 index 000000000000..c020a17e44e2 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/generate_flow_passphrase.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python generate_flow_passphrase.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_generate_passphrase( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/generateFlowPassphrase.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_connection.py new file mode 100644 index 000000000000..a75dea59ca79 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_connection.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.get( + resource_group_name="testRG", + connection_name="testConnection", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow.py new file mode 100644 index 000000000000..25ccd79bbc5d --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.get( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoint_ports.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoint_ports.py new file mode 100644 index 000000000000..9234c29d3269 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoint_ports.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_flow_destination_endpoint_ports.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.get_destination_endpoint_ports( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getFlowDestinationEndpointPorts.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoints.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoints.py new file mode 100644 index 000000000000..3c93137b0a3b --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_destination_endpoints.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_flow_destination_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.get_destination_endpoints( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getFlowDestinationEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_profile.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_profile.py new file mode 100644 index 000000000000..affb7388325d --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_profile.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_flow_profile.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flow_profiles.get( + resource_group_name="testRG", + pipeline_name="testPipeline", + flow_profile_name="testFlowProfile", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getFlowProfile.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_source_addresses.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_source_addresses.py new file mode 100644 index 000000000000..0510f221a0f5 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_flow_source_addresses.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_flow_source_addresses.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.get_source_addresses( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getFlowSourceAddresses.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_pipeline.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_pipeline.py new file mode 100644 index 000000000000..55d33a008305 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_pipeline.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_pipeline.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.get( + resource_group_name="testRG", + pipeline_name="testPipeline", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getPipeline.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_stream_connection_string.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_stream_connection_string.py new file mode 100644 index 000000000000..9949728d9c6c --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/get_stream_connection_string.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python get_stream_connection_string.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.get_stream_connection_string( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/getStreamConnectionString.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_connection.py new file mode 100644 index 000000000000..0c7e5fece2ff --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_connection.py @@ -0,0 +1,46 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python link_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.begin_link( + resource_group_name="testRG", + connection_name="testConnection", + connection={ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection" + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/linkConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_flow.py new file mode 100644 index 000000000000..f163ba6412f7 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/link_flow.py @@ -0,0 +1,47 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python link_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_link( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + flow={ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection/flows/testFlow" + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/linkFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_resource_group.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_resource_group.py new file mode 100644 index 000000000000..21126cde114a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_resource_group.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_connections_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.list_by_resource_group( + resource_group_name="testRG", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listConnectionsByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_subscription.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_subscription.py new file mode 100644 index 000000000000..9196f2b0e51e --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_connections_by_subscription.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_connections_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listConnectionsBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flow_profiles_by_pipeline.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flow_profiles_by_pipeline.py new file mode 100644 index 000000000000..9578b8a1c68d --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flow_profiles_by_pipeline.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_flow_profiles_by_pipeline.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flow_profiles.list_by_pipeline( + resource_group_name="testRG", + pipeline_name="testPipeline", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listFlowProfilesByPipeline.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_connection.py new file mode 100644 index 000000000000..cb163cc6803d --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_connection.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_flows_by_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.list_by_connection( + resource_group_name="testRG", + connection_name="testConnection", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listFlowsByConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_pipeline.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_pipeline.py new file mode 100644 index 000000000000..33a904a74a8f --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_flows_by_pipeline.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_flows_by_pipeline.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.list( + resource_group_name="testRG", + pipeline_name="testPipeline", + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/listFlowsByPipeline.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_operations.py new file mode 100644 index 000000000000..a4a9058214e9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_operations.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_connections.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_connections.py new file mode 100644 index 000000000000..d8615cc6a609 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_connections.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_pending_connections.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.list( + resource_group_name="testRG", + connection_name="testConnection", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listPendingConnections.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_flows.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_flows.py new file mode 100644 index 000000000000..8b8fa41b9852 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pending_flows.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_pending_flows.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.list_pending_flows_list( + resource_group_name="testRG", + connection_name="testConnection", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listPendingFlows.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_resource_group.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_resource_group.py new file mode 100644 index 000000000000..af6aaa052b06 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_resource_group.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_pipelines_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.list_by_resource_group( + resource_group_name="testRG", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listPipelinesByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_subscription.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_subscription.py new file mode 100644 index 000000000000..452ff76cdf7d --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_pipelines_by_subscription.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_pipelines_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2026-02-06-preview/listPipelinesBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_schemas.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_schemas.py new file mode 100644 index 000000000000..e3c910cda91f --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/list_schemas.py @@ -0,0 +1,47 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python list_schemas.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.list_schemas_list( + resource_group_name="testRG", + pipeline_name="testPipeline", + schema={ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection", + "name": "test.xsd", + }, + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/listSchemas.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_connection.py new file mode 100644 index 000000000000..a893b3e9251b --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_connection.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python patch_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.connections.begin_update( + resource_group_name="testRG", + connection_name="testConnection", + connection={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ).result() + + +# x-ms-original-file: 2026-02-06-preview/patchConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow.py new file mode 100644 index 000000000000..551a0a3a4517 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python patch_flow.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.flows.begin_update( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + flow={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"passphrase": "str", "streamId": "str", "streamLatency": 0, "streamProtocol": "str"}, + "tags": {"str": "str"}, + }, + ).result() + + +# x-ms-original-file: 2026-02-06-preview/patchFlow.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow_profile.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow_profile.py new file mode 100644 index 000000000000..025e7c8122fe --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_flow_profile.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python patch_flow_profile.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flow_profiles.begin_update( + resource_group_name="testRG", + pipeline_name="testPipeline", + flow_profile_name="testFlowProfile", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "description": "str", + "provisioningState": "str", + "rulesets": { + "antivirus": {"avSolutions": ["str"]}, + "archives": { + "maximumCompressionRatioLimit": 0.0, + "maximumDepthLimit": 0, + "maximumExpansionSizeLimit": 0, + "minimumSizeForExpansion": 0, + }, + "dataSize": {"maximum": 0, "minimum": 0}, + "mimeFilters": {"filters": [{"extensions": ["str"], "media": "str"}], "type": "str"}, + "textMatching": {"deny": [{"caseSensitivity": "str", "matchType": "str", "text": "str"}]}, + "xmlFilters": {"defaultNamespace": "str", "reference": "str", "schema": "str"}, + }, + "status": "str", + }, + "tags": {"str": "str"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/patchFlowProfile.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_pipeline.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_pipeline.py new file mode 100644 index 000000000000..beb7469f686b --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/patch_pipeline.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python patch_pipeline.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.pipelines.begin_update( + resource_group_name="testRG", + pipeline_name="testPipeline", + pipeline={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"flowTypes": ["str"]}, + "tags": {"str": "str"}, + }, + ).result() + + +# x-ms-original-file: 2026-02-06-preview/patchPipeline.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_list_approved_schemas.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_list_approved_schemas.py new file mode 100644 index 000000000000..839b7b5f9288 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_list_approved_schemas.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python post_list_approved_schemas.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.azure_data_transfer.list_approved_schemas( + pipeline={"direction": "Send", "pipeline": "test"}, + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/postListApprovedSchemas.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_validate_schema.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_validate_schema.py new file mode 100644 index 000000000000..317da0cb412a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/post_validate_schema.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python post_validate_schema.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.azure_data_transfer.validate_schema( + schema={"name": "schema.xml"}, + ) + print(response) + + +# x-ms-original-file: 2026-02-06-preview/postValidateSchema.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/reject_connection.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/reject_connection.py new file mode 100644 index 000000000000..eb8e15bd6684 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/reject_connection.py @@ -0,0 +1,47 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python reject_connection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.pipelines.begin_reject_connection( + resource_group_name="testRG", + pipeline_name="testPipeline", + connection={ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection", + "statusReason": "Example reason", + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/rejectConnection.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoint_ports.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoint_ports.py new file mode 100644 index 000000000000..7ba67f154bd2 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoint_ports.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python set_flow_destination_endpoint_ports.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_set_destination_endpoint_ports( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + stream_destination_endpoint_ports={"ports": [1234]}, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/setFlowDestinationEndpointPorts.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoints.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoints.py new file mode 100644 index 000000000000..42a2f748cf0a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_destination_endpoints.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python set_flow_destination_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_set_destination_endpoints( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + stream_destination_endpoints={"endpoints": ["10.0.0.1"]}, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/setFlowDestinationEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_passphrase.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_passphrase.py new file mode 100644 index 000000000000..2eee4f849104 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_passphrase.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python set_flow_passphrase.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_set_passphrase( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + passphrase={"value": "password123"}, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/setFlowPassphrase.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_source_addresses.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_source_addresses.py new file mode 100644 index 000000000000..75132fbb58da --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_samples/set_flow_source_addresses.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.datatransfer import DataTransferMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-datatransfer +# USAGE + python set_flow_source_addresses.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DataTransferMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.flows.begin_set_source_addresses( + resource_group_name="testRG", + connection_name="testConnection", + flow_name="testFlow", + source_addresses={"values": ["0.0.0.0", "1.0.0.0/24"]}, + ).result() + print(response) + + +# x-ms-original-file: 2026-02-06-preview/setFlowSourceAddresses.json +if __name__ == "__main__": + main() diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/conftest.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/conftest.py new file mode 100644 index 000000000000..f3cbca846674 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + datatransfermgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + datatransfermgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + datatransfermgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + datatransfermgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=datatransfermgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=datatransfermgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=datatransfermgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=datatransfermgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations.py new file mode 100644 index 000000000000..c60ea58fd125 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtAzureDataTransferOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_azure_data_transfer_list_approved_schemas(self, resource_group): + response = self.client.azure_data_transfer.list_approved_schemas( + pipeline={"direction": "str", "pipeline": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_azure_data_transfer_list_flow_profiles(self, resource_group): + response = self.client.azure_data_transfer.list_flow_profiles( + body={"pipeline": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_azure_data_transfer_validate_schema(self, resource_group): + response = self.client.azure_data_transfer.validate_schema( + schema={ + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_azure_data_transfer_list_pipeline_metadata(self, resource_group): + response = self.client.azure_data_transfer.list_pipeline_metadata( + body={"pipeline": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations_async.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations_async.py new file mode 100644 index 000000000000..daafa3adf905 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_azure_data_transfer_operations_async.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer.aio import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtAzureDataTransferOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_azure_data_transfer_list_approved_schemas(self, resource_group): + response = await self.client.azure_data_transfer.list_approved_schemas( + pipeline={"direction": "str", "pipeline": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_azure_data_transfer_list_flow_profiles(self, resource_group): + response = await self.client.azure_data_transfer.list_flow_profiles( + body={"pipeline": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_azure_data_transfer_validate_schema(self, resource_group): + response = await self.client.azure_data_transfer.validate_schema( + schema={ + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_azure_data_transfer_list_pipeline_metadata(self, resource_group): + response = await self.client.azure_data_transfer.list_pipeline_metadata( + body={"pipeline": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations.py new file mode 100644 index 000000000000..e004ac7a29fe --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations.py @@ -0,0 +1,189 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtConnectionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_get(self, resource_group): + response = self.client.connections.get( + resource_group_name=resource_group.name, + connection_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_begin_create_or_update(self, resource_group): + response = self.client.connections.begin_create_or_update( + resource_group_name=resource_group.name, + connection_name="str", + connection={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "pipeline": "str", + "apiHostname": "str", + "approver": "str", + "dateSubmitted": "2020-02-20 00:00:00", + "direction": "str", + "flowProfileList": [ + { + "description": "str", + "flowProfileId": "str", + "name": "str", + "pipeline": "str", + "replicationScenario": "str", + "status": "str", + } + ], + "flowTypes": ["str"], + "forceDisabledStatus": ["str"], + "justification": "str", + "linkStatus": "str", + "linkedConnectionId": "str", + "pin": "str", + "policies": ["str"], + "primaryContact": "str", + "provisioningState": "str", + "remoteSubscriptionId": "str", + "requirementId": "str", + "schemaUris": ["str"], + "schemas": [ + { + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + } + ], + "secondaryContacts": ["str"], + "status": "str", + "statusReason": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_begin_update(self, resource_group): + response = self.client.connections.begin_update( + resource_group_name=resource_group.name, + connection_name="str", + connection={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_begin_delete(self, resource_group): + response = self.client.connections.begin_delete( + resource_group_name=resource_group.name, + connection_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_list_by_resource_group(self, resource_group): + response = self.client.connections.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_list_by_subscription(self, resource_group): + response = self.client.connections.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_begin_link(self, resource_group): + response = self.client.connections.begin_link( + resource_group_name=resource_group.name, + connection_name="str", + connection={"id": "str", "statusReason": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_list(self, resource_group): + response = self.client.connections.list( + resource_group_name=resource_group.name, + connection_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_list_pending_flows_list(self, resource_group): + response = self.client.connections.list_pending_flows_list( + resource_group_name=resource_group.name, + connection_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations_async.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations_async.py new file mode 100644 index 000000000000..37194d681711 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_connections_operations_async.py @@ -0,0 +1,198 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer.aio import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtConnectionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_get(self, resource_group): + response = await self.client.connections.get( + resource_group_name=resource_group.name, + connection_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_begin_create_or_update(self, resource_group): + response = await ( + await self.client.connections.begin_create_or_update( + resource_group_name=resource_group.name, + connection_name="str", + connection={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "pipeline": "str", + "apiHostname": "str", + "approver": "str", + "dateSubmitted": "2020-02-20 00:00:00", + "direction": "str", + "flowProfileList": [ + { + "description": "str", + "flowProfileId": "str", + "name": "str", + "pipeline": "str", + "replicationScenario": "str", + "status": "str", + } + ], + "flowTypes": ["str"], + "forceDisabledStatus": ["str"], + "justification": "str", + "linkStatus": "str", + "linkedConnectionId": "str", + "pin": "str", + "policies": ["str"], + "primaryContact": "str", + "provisioningState": "str", + "remoteSubscriptionId": "str", + "requirementId": "str", + "schemaUris": ["str"], + "schemas": [ + { + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + } + ], + "secondaryContacts": ["str"], + "status": "str", + "statusReason": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_begin_update(self, resource_group): + response = await ( + await self.client.connections.begin_update( + resource_group_name=resource_group.name, + connection_name="str", + connection={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_begin_delete(self, resource_group): + response = await ( + await self.client.connections.begin_delete( + resource_group_name=resource_group.name, + connection_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_list_by_resource_group(self, resource_group): + response = self.client.connections.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_list_by_subscription(self, resource_group): + response = self.client.connections.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_begin_link(self, resource_group): + response = await ( + await self.client.connections.begin_link( + resource_group_name=resource_group.name, + connection_name="str", + connection={"id": "str", "statusReason": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_list(self, resource_group): + response = self.client.connections.list( + resource_group_name=resource_group.name, + connection_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_list_pending_flows_list(self, resource_group): + response = self.client.connections.list_pending_flows_list( + resource_group_name=resource_group.name, + connection_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations.py new file mode 100644 index 000000000000..7e2d18c51e84 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations.py @@ -0,0 +1,146 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtFlowProfilesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flow_profiles_get(self, resource_group): + response = self.client.flow_profiles.get( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flow_profiles_begin_create_or_update(self, resource_group): + response = self.client.flow_profiles.begin_create_or_update( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + resource={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "description": "str", + "replicationScenario": "str", + "status": "str", + "flowProfileId": "str", + "provisioningState": "str", + "rulesets": { + "antivirus": {"avSolutions": ["str"]}, + "archives": { + "maximumCompressionRatioLimit": 0.0, + "maximumDepthLimit": 0, + "maximumExpansionSizeLimit": 0, + "minimumSizeForExpansion": 0, + }, + "dataSize": {"maximum": 0, "minimum": 0}, + "mimeFilters": {"filters": [{"extensions": ["str"], "media": "str"}], "type": "str"}, + "textMatching": {"deny": [{"caseSensitivity": "str", "matchType": "str", "text": "str"}]}, + "xmlFilters": {"defaultNamespace": "str", "reference": "str", "schema": "str"}, + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flow_profiles_begin_update(self, resource_group): + response = self.client.flow_profiles.begin_update( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "description": "str", + "provisioningState": "str", + "rulesets": { + "antivirus": {"avSolutions": ["str"]}, + "archives": { + "maximumCompressionRatioLimit": 0.0, + "maximumDepthLimit": 0, + "maximumExpansionSizeLimit": 0, + "minimumSizeForExpansion": 0, + }, + "dataSize": {"maximum": 0, "minimum": 0}, + "mimeFilters": {"filters": [{"extensions": ["str"], "media": "str"}], "type": "str"}, + "textMatching": {"deny": [{"caseSensitivity": "str", "matchType": "str", "text": "str"}]}, + "xmlFilters": {"defaultNamespace": "str", "reference": "str", "schema": "str"}, + }, + "status": "str", + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flow_profiles_begin_delete(self, resource_group): + response = self.client.flow_profiles.begin_delete( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flow_profiles_list_by_pipeline(self, resource_group): + response = self.client.flow_profiles.list_by_pipeline( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations_async.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations_async.py new file mode 100644 index 000000000000..afefc9cd0364 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flow_profiles_operations_async.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer.aio import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtFlowProfilesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flow_profiles_get(self, resource_group): + response = await self.client.flow_profiles.get( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flow_profiles_begin_create_or_update(self, resource_group): + response = await ( + await self.client.flow_profiles.begin_create_or_update( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + resource={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "description": "str", + "replicationScenario": "str", + "status": "str", + "flowProfileId": "str", + "provisioningState": "str", + "rulesets": { + "antivirus": {"avSolutions": ["str"]}, + "archives": { + "maximumCompressionRatioLimit": 0.0, + "maximumDepthLimit": 0, + "maximumExpansionSizeLimit": 0, + "minimumSizeForExpansion": 0, + }, + "dataSize": {"maximum": 0, "minimum": 0}, + "mimeFilters": {"filters": [{"extensions": ["str"], "media": "str"}], "type": "str"}, + "textMatching": {"deny": [{"caseSensitivity": "str", "matchType": "str", "text": "str"}]}, + "xmlFilters": {"defaultNamespace": "str", "reference": "str", "schema": "str"}, + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flow_profiles_begin_update(self, resource_group): + response = await ( + await self.client.flow_profiles.begin_update( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "description": "str", + "provisioningState": "str", + "rulesets": { + "antivirus": {"avSolutions": ["str"]}, + "archives": { + "maximumCompressionRatioLimit": 0.0, + "maximumDepthLimit": 0, + "maximumExpansionSizeLimit": 0, + "minimumSizeForExpansion": 0, + }, + "dataSize": {"maximum": 0, "minimum": 0}, + "mimeFilters": {"filters": [{"extensions": ["str"], "media": "str"}], "type": "str"}, + "textMatching": {"deny": [{"caseSensitivity": "str", "matchType": "str", "text": "str"}]}, + "xmlFilters": {"defaultNamespace": "str", "reference": "str", "schema": "str"}, + }, + "status": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flow_profiles_begin_delete(self, resource_group): + response = await ( + await self.client.flow_profiles.begin_delete( + resource_group_name=resource_group.name, + pipeline_name="str", + flow_profile_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flow_profiles_list_by_pipeline(self, resource_group): + response = self.client.flow_profiles.list_by_pipeline( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations.py new file mode 100644 index 000000000000..9863d9bd0dae --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations.py @@ -0,0 +1,343 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtFlowsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_get(self, resource_group): + response = self.client.flows.get( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_create_or_update(self, resource_group): + response = self.client.flows.begin_create_or_update( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + flow={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "plan": {"name": "str", "product": "str", "publisher": "str", "promotionCode": "str", "version": "str"}, + "properties": { + "apiFlowOptions": { + "apiMode": "str", + "audienceOverride": "str", + "authentication": [ + { + "applicationIds": ["str"], + "audience": "str", + "authority": "str", + "clientIdOverride": "str", + "identityTranslation": "str", + "instance": "str", + "tenantId": "str", + "type": "str", + } + ], + "cname": "str", + "identityTranslation": "str", + "remoteCallingModeClientId": "str", + "remoteEndpoint": "str", + "remoteEndpointSettings": { + "endpoint": "str", + "authentication": [ + { + "applicationIds": ["str"], + "audience": "str", + "authority": "str", + "clientIdOverride": "str", + "identityTranslation": "str", + "instance": "str", + "tenantId": "str", + "type": "str", + } + ], + }, + "senderClientId": "str", + }, + "connection": {"id": "str", "location": "str", "name": "str", "subscriptionName": "str"}, + "consumerGroup": "str", + "customerManagedKeyVaultUri": "str", + "dataType": "str", + "destinationEndpointPorts": [0], + "destinationEndpoints": ["str"], + "eventHubId": "str", + "flowDataType": "str", + "flowId": "str", + "flowProfile": { + "description": "str", + "flowProfileId": "str", + "name": "str", + "pipeline": "str", + "replicationScenario": "str", + "status": "str", + }, + "flowType": "str", + "forceDisabledStatus": ["str"], + "keyVaultUri": "str", + "linkStatus": "str", + "linkedFlowId": "str", + "messagingOptions": {"billingTier": "str", "performancePriority": "str"}, + "passphrase": "str", + "policies": ["str"], + "provisioningState": "str", + "schema": { + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + }, + "serviceBusQueueId": "str", + "sourceAddresses": {"sourceAddresses": ["str"]}, + "status": "str", + "storageAccountId": "str", + "storageAccountName": "str", + "storageContainerName": "str", + "storageTableName": "str", + "streamId": "str", + "streamLatency": 0, + "streamProtocol": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_update(self, resource_group): + response = self.client.flows.begin_update( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + flow={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"passphrase": "str", "streamId": "str", "streamLatency": 0, "streamProtocol": "str"}, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_delete(self, resource_group): + response = self.client.flows.begin_delete( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_list_by_connection(self, resource_group): + response = self.client.flows.list_by_connection( + resource_group_name=resource_group.name, + connection_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_disable(self, resource_group): + response = self.client.flows.begin_disable( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_enable(self, resource_group): + response = self.client.flows.begin_enable( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_generate_passphrase(self, resource_group): + response = self.client.flows.begin_generate_passphrase( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_get_destination_endpoint_ports(self, resource_group): + response = self.client.flows.get_destination_endpoint_ports( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_get_destination_endpoints(self, resource_group): + response = self.client.flows.get_destination_endpoints( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_get_source_addresses(self, resource_group): + response = self.client.flows.get_source_addresses( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_get_stream_connection_string(self, resource_group): + response = self.client.flows.get_stream_connection_string( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_link(self, resource_group): + response = self.client.flows.begin_link( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + flow={"id": "str", "statusReason": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_set_destination_endpoint_ports(self, resource_group): + response = self.client.flows.begin_set_destination_endpoint_ports( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + stream_destination_endpoint_ports={"ports": [0]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_set_destination_endpoints(self, resource_group): + response = self.client.flows.begin_set_destination_endpoints( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + stream_destination_endpoints={"endpoints": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_set_passphrase(self, resource_group): + response = self.client.flows.begin_set_passphrase( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + passphrase={"value": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flows_begin_set_source_addresses(self, resource_group): + response = self.client.flows.begin_set_source_addresses( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + source_addresses={"values": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations_async.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations_async.py new file mode 100644 index 000000000000..174aac0315a2 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_flows_operations_async.py @@ -0,0 +1,372 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer.aio import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtFlowsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_get(self, resource_group): + response = await self.client.flows.get( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_create_or_update(self, resource_group): + response = await ( + await self.client.flows.begin_create_or_update( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + flow={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "plan": { + "name": "str", + "product": "str", + "publisher": "str", + "promotionCode": "str", + "version": "str", + }, + "properties": { + "apiFlowOptions": { + "apiMode": "str", + "audienceOverride": "str", + "authentication": [ + { + "applicationIds": ["str"], + "audience": "str", + "authority": "str", + "clientIdOverride": "str", + "identityTranslation": "str", + "instance": "str", + "tenantId": "str", + "type": "str", + } + ], + "cname": "str", + "identityTranslation": "str", + "remoteCallingModeClientId": "str", + "remoteEndpoint": "str", + "remoteEndpointSettings": { + "endpoint": "str", + "authentication": [ + { + "applicationIds": ["str"], + "audience": "str", + "authority": "str", + "clientIdOverride": "str", + "identityTranslation": "str", + "instance": "str", + "tenantId": "str", + "type": "str", + } + ], + }, + "senderClientId": "str", + }, + "connection": {"id": "str", "location": "str", "name": "str", "subscriptionName": "str"}, + "consumerGroup": "str", + "customerManagedKeyVaultUri": "str", + "dataType": "str", + "destinationEndpointPorts": [0], + "destinationEndpoints": ["str"], + "eventHubId": "str", + "flowDataType": "str", + "flowId": "str", + "flowProfile": { + "description": "str", + "flowProfileId": "str", + "name": "str", + "pipeline": "str", + "replicationScenario": "str", + "status": "str", + }, + "flowType": "str", + "forceDisabledStatus": ["str"], + "keyVaultUri": "str", + "linkStatus": "str", + "linkedFlowId": "str", + "messagingOptions": {"billingTier": "str", "performancePriority": "str"}, + "passphrase": "str", + "policies": ["str"], + "provisioningState": "str", + "schema": { + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + }, + "serviceBusQueueId": "str", + "sourceAddresses": {"sourceAddresses": ["str"]}, + "status": "str", + "storageAccountId": "str", + "storageAccountName": "str", + "storageContainerName": "str", + "storageTableName": "str", + "streamId": "str", + "streamLatency": 0, + "streamProtocol": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_update(self, resource_group): + response = await ( + await self.client.flows.begin_update( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + flow={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"passphrase": "str", "streamId": "str", "streamLatency": 0, "streamProtocol": "str"}, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_delete(self, resource_group): + response = await ( + await self.client.flows.begin_delete( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_list_by_connection(self, resource_group): + response = self.client.flows.list_by_connection( + resource_group_name=resource_group.name, + connection_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_disable(self, resource_group): + response = await ( + await self.client.flows.begin_disable( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_enable(self, resource_group): + response = await ( + await self.client.flows.begin_enable( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_generate_passphrase(self, resource_group): + response = await ( + await self.client.flows.begin_generate_passphrase( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_get_destination_endpoint_ports(self, resource_group): + response = await self.client.flows.get_destination_endpoint_ports( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_get_destination_endpoints(self, resource_group): + response = await self.client.flows.get_destination_endpoints( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_get_source_addresses(self, resource_group): + response = await self.client.flows.get_source_addresses( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_get_stream_connection_string(self, resource_group): + response = await self.client.flows.get_stream_connection_string( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_link(self, resource_group): + response = await ( + await self.client.flows.begin_link( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + flow={"id": "str", "statusReason": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_set_destination_endpoint_ports(self, resource_group): + response = await ( + await self.client.flows.begin_set_destination_endpoint_ports( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + stream_destination_endpoint_ports={"ports": [0]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_set_destination_endpoints(self, resource_group): + response = await ( + await self.client.flows.begin_set_destination_endpoints( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + stream_destination_endpoints={"endpoints": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_set_passphrase(self, resource_group): + response = await ( + await self.client.flows.begin_set_passphrase( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + passphrase={"value": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flows_begin_set_source_addresses(self, resource_group): + response = await ( + await self.client.flows.begin_set_source_addresses( + resource_group_name=resource_group.name, + connection_name="str", + flow_name="str", + source_addresses={"values": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations.py new file mode 100644 index 000000000000..2d105fe5520a --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations_async.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations_async.py new file mode 100644 index 000000000000..46cbcf3a3325 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_operations_async.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer.aio import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations.py new file mode 100644 index 000000000000..852d7c4b1a78 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations.py @@ -0,0 +1,216 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtPipelinesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_get(self, resource_group): + response = self.client.pipelines.get( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_begin_create_or_update(self, resource_group): + response = self.client.pipelines.begin_create_or_update( + resource_group_name=resource_group.name, + pipeline_name="str", + pipeline={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "remoteCloud": "str", + "connections": [ + { + "id": "str", + "etag": "str", + "location": "str", + "name": "str", + "properties": { + "internalMetadata": { + "operationStatus": {"id": "str", "message": "str", "status": "str"}, + "statusSetBy": "str", + } + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + } + ], + "disabledDataClass": ["str"], + "disabledFlowTypes": ["str"], + "displayName": "str", + "flowTypes": ["str"], + "policies": ["str"], + "provisioningState": "str", + "quarantineDownloadStorageAccount": "str", + "quarantineDownloadStorageContainer": "str", + "status": "str", + "subscribers": [{"email": "str", "notifications": 0}], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_begin_update(self, resource_group): + response = self.client.pipelines.begin_update( + resource_group_name=resource_group.name, + pipeline_name="str", + pipeline={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"flowTypes": ["str"]}, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_begin_delete(self, resource_group): + response = self.client.pipelines.begin_delete( + resource_group_name=resource_group.name, + pipeline_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_list_by_resource_group(self, resource_group): + response = self.client.pipelines.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_list_by_subscription(self, resource_group): + response = self.client.pipelines.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_begin_approve_connection(self, resource_group): + response = self.client.pipelines.begin_approve_connection( + resource_group_name=resource_group.name, + pipeline_name="str", + connection={"id": "str", "statusReason": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_begin_execute_action(self, resource_group): + response = self.client.pipelines.begin_execute_action( + resource_group_name=resource_group.name, + pipeline_name="str", + action={"actionType": "str", "targetType": "str", "justification": "str", "targets": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_list(self, resource_group): + response = self.client.pipelines.list( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_list_schemas_list(self, resource_group): + response = self.client.pipelines.list_schemas_list( + resource_group_name=resource_group.name, + pipeline_name="str", + schema={ + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pipelines_begin_reject_connection(self, resource_group): + response = self.client.pipelines.begin_reject_connection( + resource_group_name=resource_group.name, + pipeline_name="str", + connection={"id": "str", "statusReason": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations_async.py b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations_async.py new file mode 100644 index 000000000000..829b8fc579ac --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/generated_tests/test_data_transfer_mgmt_pipelines_operations_async.py @@ -0,0 +1,229 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.datatransfer.aio import DataTransferMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataTransferMgmtPipelinesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataTransferMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_get(self, resource_group): + response = await self.client.pipelines.get( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_begin_create_or_update(self, resource_group): + response = await ( + await self.client.pipelines.begin_create_or_update( + resource_group_name=resource_group.name, + pipeline_name="str", + pipeline={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "remoteCloud": "str", + "connections": [ + { + "id": "str", + "etag": "str", + "location": "str", + "name": "str", + "properties": { + "internalMetadata": { + "operationStatus": {"id": "str", "message": "str", "status": "str"}, + "statusSetBy": "str", + } + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + } + ], + "disabledDataClass": ["str"], + "disabledFlowTypes": ["str"], + "displayName": "str", + "flowTypes": ["str"], + "policies": ["str"], + "provisioningState": "str", + "quarantineDownloadStorageAccount": "str", + "quarantineDownloadStorageContainer": "str", + "status": "str", + "subscribers": [{"email": "str", "notifications": 0}], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_begin_update(self, resource_group): + response = await ( + await self.client.pipelines.begin_update( + resource_group_name=resource_group.name, + pipeline_name="str", + pipeline={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"flowTypes": ["str"]}, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_begin_delete(self, resource_group): + response = await ( + await self.client.pipelines.begin_delete( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_list_by_resource_group(self, resource_group): + response = self.client.pipelines.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_list_by_subscription(self, resource_group): + response = self.client.pipelines.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_begin_approve_connection(self, resource_group): + response = await ( + await self.client.pipelines.begin_approve_connection( + resource_group_name=resource_group.name, + pipeline_name="str", + connection={"id": "str", "statusReason": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_begin_execute_action(self, resource_group): + response = await ( + await self.client.pipelines.begin_execute_action( + resource_group_name=resource_group.name, + pipeline_name="str", + action={"actionType": "str", "targetType": "str", "justification": "str", "targets": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_list(self, resource_group): + response = await self.client.pipelines.list( + resource_group_name=resource_group.name, + pipeline_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_list_schemas_list(self, resource_group): + response = await self.client.pipelines.list_schemas_list( + resource_group_name=resource_group.name, + pipeline_name="str", + schema={ + "connectionId": "str", + "content": "str", + "direction": "str", + "id": "str", + "name": "str", + "schemaType": "str", + "schemaUri": "str", + "status": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pipelines_begin_reject_connection(self, resource_group): + response = await ( + await self.client.pipelines.begin_reject_connection( + resource_group_name=resource_group.name, + pipeline_name="str", + connection={"id": "str", "statusReason": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/pyproject.toml b/sdk/azuredatatransfer/azure-mgmt-datatransfer/pyproject.toml new file mode 100644 index 000000000000..23132bb982ec --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/pyproject.toml @@ -0,0 +1,86 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-datatransfer" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Datatransfer Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.datatransfer._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + +[tool.azure-sdk-build] +breaking = false +pyright = false +mypy = false + +[packaging] +package_name = "azure-mgmt-datatransfer" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Datatransfer Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "DataTransferMgmtClient" diff --git a/sdk/azuredatatransfer/azure-mgmt-datatransfer/tsp-location.yaml b/sdk/azuredatatransfer/azure-mgmt-datatransfer/tsp-location.yaml new file mode 100644 index 000000000000..fa1345485052 --- /dev/null +++ b/sdk/azuredatatransfer/azure-mgmt-datatransfer/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/AzureDataTransfer +commit: 9969c2f086105356220a370bb316291fd26d87af +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/azuredatatransfer/ci.yml b/sdk/azuredatatransfer/ci.yml new file mode 100644 index 000000000000..52b60dcdfa0c --- /dev/null +++ b/sdk/azuredatatransfer/ci.yml @@ -0,0 +1,34 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/azuredatatransfer/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/azuredatatransfer/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azuredatatransfer + TestProxy: true + Artifacts: + - name: azure-mgmt-datatransfer + safeName: azuremgmtdatatransfer From fe534326ff3e5bd9808a382d22d3d6baed9d0e8a Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 10:51:33 -0600 Subject: [PATCH 33/35] Sync eng/common directory with azure-sdk-tools for PR 17391 (#49683) * Remove ios repo references. * Remove android and C rep references. --------- Co-authored-by: Travis Prescott --- eng/common/pipelines/templates/jobs/prepare-pipelines.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/prepare-pipelines.yml b/eng/common/pipelines/templates/jobs/prepare-pipelines.yml index 64225f00cd94..7b0cdc8ebc0b 100644 --- a/eng/common/pipelines/templates/jobs/prepare-pipelines.yml +++ b/eng/common/pipelines/templates/jobs/prepare-pipelines.yml @@ -93,9 +93,6 @@ jobs: $internalVariableGroups = '$(AzureSDK_Maven_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' $testVariableGroups = '$(Secrets_for_Resource_Provisioner)' } - "android" { - $internalVariableGroups = '$(AzureSDK_Maven_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' - } "js" { $generatePublicCIPipeline = 'false' $internalVariableGroups = '$(NPM_Registry_Authentication) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' @@ -119,9 +116,6 @@ jobs: "cpp" { $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner)' } - "ios" { - $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner) $(AzureSDK_CocoaPods_Release_Pipeline_Secrets)' - } "go" { $generatePublicCIPipeline = 'false' $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner)' From 2b95412280db54d34340e7afbf1b802d3c5aef46 Mon Sep 17 00:00:00 2001 From: Radhika Gupta Date: Fri, 23 Oct 2026 12:03:14 -0700 Subject: [PATCH 34/35] Add experimental feature flag (#49682) * [azure-monitor-opentelemetry-exporter] Add support for experimental features flag * Add CHANGELOG * Update CHANGELOG * Add flag guidance * Add support for the feature flag in spans and metrics --- .../CHANGELOG.md | 2 + .../README.md | 14 ++ .../opentelemetry/exporter/_constants.py | 10 +- .../monitor/opentelemetry/exporter/_utils.py | 4 +- .../opentelemetry/exporter/export/_base.py | 35 ++++- .../exporter/export/logs/_exporter.py | 13 +- .../exporter/export/metrics/_exporter.py | 17 ++- .../exporter/export/trace/_exporter.py | 29 ++++- .../tests/test_base_exporter.py | 122 ++++++++++++++++++ 9 files changed, 230 insertions(+), 16 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md b/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md index 89212237018c..d3766ab1e30d 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md @@ -3,6 +3,8 @@ ## 1.0.0b59 (Unreleased) ### Features Added +- Add support for experimental features flag + ([#49682](https://github.com/Azure/azure-sdk-for-python/pull/49682)) ### Breaking Changes diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md b/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md index b9f0c16f9563..507a8c75b532 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md @@ -139,6 +139,20 @@ All configuration options can be passed through the constructors of exporters th * `storage_directory`: Storage directory in which to store retry files. Defaults to `/Microsoft/AzureMonitor/opentelemetry-python-`. * `credential`: Token credential, such as ManagedIdentityCredential or ClientSecretCredential, used for [Azure Active Directory (AAD) authentication][aad_for_ai_docs]. Defaults to None. See [samples][exporter_samples] for examples. The credential will be automatically created from the `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable if not explicitly passed in. See [documentation][aad_env_var_docs] for more. +### Experimental features + +Use the `APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES` environment variable to opt in to named experimental +features. Set it before constructing any exporter or calling `configure_azure_monitor()`. + +```powershell +$env:APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES = "gen_ai_input_output_limit_increase" +``` + +Separate multiple feature names with commas. Names are case-insensitive; surrounding whitespace is +ignored. Unset or empty values enable no experimental features. Unknown names are ignored with a warning. +The selection is shared across exporters in the same Python interpreter and cannot be changed after +the first exporter is constructed. Experimental features may change or be removed in future releases. + ## Examples ### Logging (experimental) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py index e3754df96f7e..df776061261d 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py @@ -3,7 +3,7 @@ # cSpell:disable from enum import Enum -from typing import Union +from typing import FrozenSet, Union from opentelemetry.semconv.metrics import MetricInstruments from opentelemetry.semconv.metrics.http_metrics import ( HTTP_CLIENT_REQUEST_DURATION, @@ -16,12 +16,20 @@ # Environment variables +_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES = "APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES" _APPLICATIONINSIGHTS_STATSBEAT_DISABLED_ALL = "APPLICATIONINSIGHTS_STATSBEAT_DISABLED_ALL" _APPLICATIONINSIGHTS_OPENTELEMETRY_RESOURCE_METRIC_DISABLED = ( "APPLICATIONINSIGHTS_OPENTELEMETRY_RESOURCE_METRIC_DISABLED" ) _APPLICATIONINSIGHTS_METRIC_NAMESPACE_OPT_IN = "APPLICATIONINSIGHTS_METRIC_NAMESPACE_OPT_IN" +# Add feature names only when their implementations are available. +_SUPPORTED_EXPERIMENTAL_FEATURES: FrozenSet[str] = frozenset( + { + "gen_ai_input_output_limit_increase", + } +) + # SDK version _AZURE_MONITOR_DISTRO_VERSION = "AZURE_MONITOR_DISTRO_VERSION" _MICROSOFT_OPENTELEMETRY_VERSION = "MICROSOFT_OPENTELEMETRY_VERSION" diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py index 25fcb9b86782..e5816f1e4da3 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py @@ -429,7 +429,9 @@ def _is_any_synthetic_source(properties: Optional[Any]) -> bool: # pylint: disable=W0622 -def _filter_custom_properties(properties: Attributes, filter=None) -> Dict[str, str]: +def _filter_custom_properties( + properties: Attributes, filter=None, *, increase_truncation_limit: bool = False # pylint: disable=unused-argument +) -> Dict[str, str]: max_length = 8 * 1024 max_length_for_gen_ai_attributes = 256 * 1024 processed_properties: Dict[str, str] = {} diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py index c06142d68647..17340d3a4b67 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py @@ -8,7 +8,8 @@ import sys from pathlib import Path from enum import Enum -from typing import Dict, List, Optional, Any +from threading import Lock +from typing import Dict, FrozenSet, List, Optional, Any from urllib.parse import urlparse import psutil @@ -31,6 +32,7 @@ _ALLOWED_REDIRECT_DOMAIN_SUFFIXES, _AZURE_MONITOR_DISTRO_VERSION_ARG, _APPLICATIONINSIGHTS_AUTHENTICATION_STRING, + _APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES, _INVALID_STATUS_CODES, _REACHED_INGESTION_STATUS_CODES, _REDIRECT_STATUS_CODES, @@ -43,6 +45,7 @@ _RETRYABLE_STATUS_CODES, _THROTTLE_STATUS_CODES, _ONE_SETTINGS_FEATURE_LOCAL_STORAGE, + _SUPPORTED_EXPERIMENTAL_FEATURES, DropCode, _exception_categories, ) @@ -95,6 +98,9 @@ _TEMPDIR_PREFIX = "opentelemetry-python-" _SERVICE_API_LATEST = "2020-09-15_Preview" +_enabled_experimental_features: Optional[FrozenSet[str]] = None +_experimental_features_lock = Lock() + class ExportResult(Enum): SUCCESS = 0 @@ -120,6 +126,7 @@ def __init__(self, **kwargs: Any) -> None: :keyword int max_envelopes_per_second: Maximum number of telemetry envelopes sent per second. Acts as a client-side safety cap to prevent overloading shared ingestion infrastructure during telemetry bursts. Defaults to 10000. Set to 0 to disable rate limiting. :rtype: None """ + _get_experimental_features() parsed_connection_string = ConnectionStringParser(kwargs.get("connection_string")) self._api_version = kwargs.get("api_version") or _SERVICE_API_LATEST @@ -257,6 +264,10 @@ def __init__(self, **kwargs: Any) -> None: # Collect customer sdkstats metrics collect_customer_sdkstats(self) + def _is_experimental_feature_enabled(self, feature_name: str) -> bool: + # Return whether the named experimental feature was explicitly enabled at startup. + return feature_name.strip().lower() in _get_experimental_features() + # Maximum number of blobs to drain from storage per invocation. # Prevents a retry storm when many blobs have accumulated during # sustained throttling (e.g. 429). @@ -962,3 +973,25 @@ def _safe_psutil_call(func, default=""): _TEMPDIR_PREFIX + instrumentation_key, ) return storage_directory + + +def _get_experimental_features() -> FrozenSet[str]: + """Read and freeze the enabled features on the first internal lookup or exporter construction.""" + global _enabled_experimental_features # pylint: disable=global-statement + if _enabled_experimental_features is None: + with _experimental_features_lock: + if _enabled_experimental_features is None: + requested_features = frozenset( + name.strip().lower() + for name in os.environ.get(_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES, "").split(",") + if name.strip() + ) + unknown_features = requested_features - _SUPPORTED_EXPERIMENTAL_FEATURES + if unknown_features: + logger.warning( + "Ignoring unknown experimental features in %s: %s", + _APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES, + ", ".join(sorted(unknown_features)), + ) + _enabled_experimental_features = requested_features & _SUPPORTED_EXPERIMENTAL_FEATURES + return _enabled_experimental_features diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/logs/_exporter.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/logs/_exporter.py index e7f9f6f71fa3..62cc189ba266 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/logs/_exporter.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/logs/_exporter.py @@ -124,7 +124,10 @@ def shutdown(self) -> None: self.storage.close() def _log_to_envelope(self, readable_log_record: ReadableLogRecord) -> TelemetryItem: - envelope = _convert_log_to_envelope(readable_log_record) + envelope = _convert_log_to_envelope( + readable_log_record, + increase_truncation_limit=self._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + ) envelope.instrumentation_key = self._instrumentation_key return envelope @@ -161,7 +164,9 @@ def _log_data_is_event(readable_log_record: ReadableLogRecord) -> bool: # pylint: disable=protected-access # pylint: disable=too-many-statements # pylint: disable=too-many-branches -def _convert_log_to_envelope(readable_log_record: ReadableLogRecord) -> TelemetryItem: +def _convert_log_to_envelope( + readable_log_record: ReadableLogRecord, *, increase_truncation_limit: bool = False +) -> TelemetryItem: log_record = readable_log_record.log_record time_stamp = log_record.timestamp if log_record.timestamp is not None else log_record.observed_timestamp envelope = _utils._create_telemetry_item(time_stamp) @@ -194,7 +199,9 @@ def _convert_log_to_envelope(readable_log_record: ReadableLogRecord) -> Telemetr if location_ip: tags[ContextTagKeys.AI_LOCATION_IP] = location_ip # type: ignore properties = _utils._filter_custom_properties( - log_record.attributes, lambda key, val: not _is_ignored_attribute(key) # type: ignore + log_record.attributes, + lambda key, val: not _is_ignored_attribute(key), # type: ignore + increase_truncation_limit=increase_truncation_limit, ) measurements = _utils._filter_custom_measurements(log_record.attributes) availability_data = _get_availability_data(log_record) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/metrics/_exporter.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/metrics/_exporter.py index 9faf3103725a..39d13b56a641 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/metrics/_exporter.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/metrics/_exporter.py @@ -173,7 +173,13 @@ def _point_to_envelope( if self._is_customer_sdkstats and name in _CUSTOMER_SDKSTATS_METRIC_NAME_MAPPINGS: final_metric_name = _CUSTOMER_SDKSTATS_METRIC_NAME_MAPPINGS[name] - envelope = _convert_point_to_envelope(point, final_metric_name, resource, scope) + envelope = _convert_point_to_envelope( + point, + final_metric_name, + resource, + scope, + increase_truncation_limit=self._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + ) # Note that Performance Counters are not counted as "Autocollected standard metrics" if name in _AUTOCOLLECTED_INSTRUMENT_NAMES: envelope = _handle_std_metric_envelope(envelope, name, point.attributes) # type: ignore @@ -231,7 +237,12 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "AzureMonitorMe # pylint: disable=protected-access def _convert_point_to_envelope( - point: DataPointT, name: str, resource: Optional[Resource] = None, scope: Optional[InstrumentationScope] = None + point: DataPointT, + name: str, + resource: Optional[Resource] = None, + scope: Optional[InstrumentationScope] = None, + *, + increase_truncation_limit: bool = False, ) -> TelemetryItem: envelope = _utils._create_telemetry_item(point.time_unix_nano) envelope.name = _METRIC_ENVELOPE_NAME @@ -256,7 +267,7 @@ def _convert_point_to_envelope( max_ = point.max # truncation logic - properties = _utils._filter_custom_properties(point.attributes) + properties = _utils._filter_custom_properties(point.attributes, increase_truncation_limit=increase_truncation_limit) # Map OTel-friendly name to Breeze Performance Counter name # Note that Performance Counters are not counted as "Autocollected standard metrics" diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py index 5b6dac5f486e..21416fb59af0 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py @@ -185,7 +185,10 @@ def _get_otel_resource_envelope(self, resource: Resource, application_id: Option # coming from the SDK are not JSON-serializable as-is. attributes: Dict[str, str] = {} if resource: - attributes = _utils._filter_custom_properties(dict(resource.attributes)) # type: ignore[arg-type] + attributes = _utils._filter_custom_properties( + dict(resource.attributes), # type: ignore[arg-type] + increase_truncation_limit=self._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + ) envelope = _utils._create_telemetry_item(time_ns()) envelope.name = _METRIC_ENVELOPE_NAME envelope.tags.update(_utils._populate_part_a_fields(resource)) # pylint: disable=W0212 @@ -210,14 +213,20 @@ def _get_otel_resource_envelope(self, resource: Resource, application_id: Option return envelope def _span_to_envelope(self, span: ReadableSpan) -> TelemetryItem: - envelope = _convert_span_to_envelope(span) + envelope = _convert_span_to_envelope( + span, + increase_truncation_limit=self._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + ) envelope.instrumentation_key = self._instrumentation_key return envelope # type: ignore def _span_events_to_envelopes(self, span: ReadableSpan) -> Sequence[TelemetryItem]: if not span or len(span.events) == 0: return [] - envelopes = _convert_span_events_to_envelopes(span) + envelopes = _convert_span_events_to_envelopes( + span, + increase_truncation_limit=self._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + ) for envelope in envelopes: envelope.instrumentation_key = self._instrumentation_key return envelopes @@ -252,7 +261,7 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "AzureMonitorTr # pylint: disable=too-many-locals # mypy: disable-error-code="assignment,attr-defined,index,operator,union-attr" @no_type_check -def _convert_span_to_envelope(span: ReadableSpan) -> TelemetryItem: +def _convert_span_to_envelope(span: ReadableSpan, *, increase_truncation_limit: bool = False) -> TelemetryItem: # Update instrumentation bitmap if span was generated from instrumentation _check_instrumentation_span(span) duration = 0 @@ -532,7 +541,9 @@ def _convert_span_to_envelope(span: ReadableSpan) -> TelemetryItem: envelope.sample_rate = span.attributes[_SAMPLE_RATE_KEY] data.properties = _utils._filter_custom_properties( - span.attributes, lambda key, val: not _is_standard_attribute(key) + span.attributes, + lambda key, val: not _is_standard_attribute(key), + increase_truncation_limit=increase_truncation_limit, ) # Standard metrics special properties @@ -558,7 +569,9 @@ def _convert_span_to_envelope(span: ReadableSpan) -> TelemetryItem: # pylint: disable=protected-access -def _convert_span_events_to_envelopes(span: ReadableSpan) -> Sequence[TelemetryItem]: +def _convert_span_events_to_envelopes( + span: ReadableSpan, *, increase_truncation_limit: bool = False +) -> Sequence[TelemetryItem]: envelopes = [] for event in span.events: envelope = _utils._create_telemetry_item(event.timestamp) @@ -577,7 +590,9 @@ def _convert_span_events_to_envelopes(span: ReadableSpan) -> Sequence[TelemetryI envelope.sample_rate = span.attributes[_SAMPLE_RATE_KEY] properties = _utils._filter_custom_properties( - event.attributes, lambda key, val: not _is_standard_attribute(key) + event.attributes, + lambda key, val: not _is_standard_attribute(key), + increase_truncation_limit=increase_truncation_limit, ) measurements = _utils._filter_custom_measurements(event.attributes) if event.name == "exception": diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py index 943b13251182..1d219990e456 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py @@ -25,6 +25,7 @@ ) from azure.monitor.opentelemetry.exporter.export.metrics._exporter import AzureMonitorMetricExporter from azure.monitor.opentelemetry.exporter._constants import ( + _APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES, _DEFAULT_AAD_SCOPE, _REQ_DURATION_NAME, _REQ_EXCEPTION_NAME, @@ -1866,3 +1867,124 @@ def __init__(self, status_code, text, headers=None, reason="test", content="{}") class MockRaw: def __init__(self): self.enforce_content_length = False + + +class TestBaseExporterExperimentalFeatures(unittest.TestCase): + def setUp(self): + patches = [ + mock.patch.dict("os.environ"), + mock.patch("azure.monitor.opentelemetry.exporter.export._base._enabled_experimental_features", None), + mock.patch( + "azure.monitor.opentelemetry.exporter.export._base.get_configuration_manager", return_value=None + ), + mock.patch( + "azure.monitor.opentelemetry.exporter.export._base.BaseExporter._should_collect_stats", + return_value=False, + ), + mock.patch( + "azure.monitor.opentelemetry.exporter.export._base.BaseExporter._should_collect_customer_sdkstats", + return_value=False, + ), + ] + for patch in patches: + patch.start() + self.addCleanup(patch.stop) + os.environ.pop(_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES, None) + + def _create_exporter(self): + exporter = BaseExporter( + connection_string="InstrumentationKey=1234abcd-5678-4efa-8abc-1234567890ab", + disable_offline_storage=True, + ) + self.addCleanup(exporter.client.close) + return exporter + + def test_experimental_feature_disabled_by_default(self): + for value in (None, "", " ", ", ,,,"): + with self.subTest(value=value): + with mock.patch( + "azure.monitor.opentelemetry.exporter.export._base._enabled_experimental_features", None + ): + if value is not None: + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = value + exporter = self._create_exporter() + self.assertFalse(exporter._is_experimental_feature_enabled("gen_ai_input_output_limit_increase")) + + def test_experimental_feature_enabled_from_environment(self): + for value in ( + "gen_ai_input_output_limit_increase", + " GEN_AI_INPUT_OUTPUT_LIMIT_INCREASE ", + "gen_ai_input_output_limit_increase, ,gen_ai_input_output_limit_increase,", + ): + with self.subTest(value=value): + with mock.patch( + "azure.monitor.opentelemetry.exporter.export._base._enabled_experimental_features", None + ): + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = value + exporter = self._create_exporter() + self.assertTrue(exporter._is_experimental_feature_enabled("gen_ai_input_output_limit_increase")) + + @mock.patch( + "azure.monitor.opentelemetry.exporter.export._base._SUPPORTED_EXPERIMENTAL_FEATURES", + frozenset({"gen_ai_input_output_limit_increase", "another_feature"}), + ) + def test_experimental_features_enabled_only_when_selected(self): + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = "gen_ai_input_output_limit_increase" + exporter = self._create_exporter() + self.assertTrue(exporter._is_experimental_feature_enabled("gen_ai_input_output_limit_increase")) + self.assertFalse(exporter._is_experimental_feature_enabled("another_feature")) + + @mock.patch( + "azure.monitor.opentelemetry.exporter.export._base._SUPPORTED_EXPERIMENTAL_FEATURES", + frozenset({"gen_ai_input_output_limit_increase", "another_feature"}), + ) + def test_multiple_experimental_features_enabled(self): + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = "gen_ai_input_output_limit_increase,another_feature" + exporter = self._create_exporter() + self.assertTrue(exporter._is_experimental_feature_enabled("gen_ai_input_output_limit_increase")) + self.assertTrue(exporter._is_experimental_feature_enabled("another_feature")) + + def test_unknown_experimental_features_warn_once_and_remain_disabled(self): + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = ( + "gen_ai_input_output_limit_increase,unknown_feature,unknown_feature" + ) + with mock.patch("azure.monitor.opentelemetry.exporter.export._base.logger.warning") as warning: + first = self._create_exporter() + second = self._create_exporter() + self.assertTrue(first._is_experimental_feature_enabled("gen_ai_input_output_limit_increase")) + self.assertFalse(second._is_experimental_feature_enabled("unknown_feature")) + warning.assert_called_once_with( + "Ignoring unknown experimental features in %s: %s", + _APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES, + "unknown_feature", + ) + + def test_experimental_feature_wildcard_does_not_enable_features(self): + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = "*" + with self.assertLogs("azure.monitor.opentelemetry.exporter.export._base", level="WARNING"): + exporter = self._create_exporter() + self.assertFalse(exporter._is_experimental_feature_enabled("gen_ai_input_output_limit_increase")) + self.assertFalse(exporter._is_experimental_feature_enabled("*")) + + def test_exporter_construction_freezes_experimental_feature_selection(self): + for initially_enabled in (False, True): + with self.subTest(initially_enabled=initially_enabled): + with mock.patch( + "azure.monitor.opentelemetry.exporter.export._base._enabled_experimental_features", None + ): + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = ( + "gen_ai_input_output_limit_increase" if initially_enabled else "" + ) + first = self._create_exporter() + os.environ[_APPLICATIONINSIGHTS_EXPERIMENTAL_FEATURES] = ( + "" if initially_enabled else "gen_ai_input_output_limit_increase" + ) + second = self._create_exporter() + self.assertEqual( + first._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + initially_enabled, + ) + self.assertEqual( + second._is_experimental_feature_enabled("gen_ai_input_output_limit_increase"), + initially_enabled, + ) From 762d184ec36fe4c1082a2c2939382e70dd942b59 Mon Sep 17 00:00:00 2001 From: jenny <63012604+JennyPng@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:12:22 -0700 Subject: [PATCH 35/35] [Identity] Prepare 1.27.0 stable release with AKS identity bindings (#49612) * Restore Workload Identity binding mode beta Restores changes from #43287 and the enable_azure_proxy rename from #44147. Original commits: 4250940049ef8a9a8f5feb4a4f48dbfb57451553, 06a83c8c20a148377d7a7d00f302a433a857aea5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Restore credential pipeline policy overrides beta Restores the beta changes from #46072. Original commit: 8ee83e6c3066aed9e71f77c96b802a67c42848bb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Restore Azure Developer CLI error parsing Restores the changes from #46711. Original commit: 2240bf9eda2be1a43462cc531b827544a1898e2f Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Start azure-identity 1.27.0b1 development Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Prepare Azure Identity 1.27.0 stable release Promote the beta version and classifier, update the release notes, and document AKS identity binding opt-in for sync and async credentials. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a948ec8-c74c-4b82-86a8-03f911bd3538 * address ccr * remove override feat for now * Fix CA rotation test file replacement on Windows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72672081-9f02-41bf-9f12-845073743ebe * account for older aiohttp versions lacking param * forward nonconflicting kwargs from workload identity, address older aiohttp incompat * Fix identity binding token cache endpoint and checks Preserve the original Entra endpoint for cache bookkeeping when the binding transport rewrites the request URL. Cover prefixed proxies, retries, and CAE across all binding transports, and fix spelling and lint checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 971d1bd8-4d07-4f3a-a701-c01e5a94448e --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a948ec8-c74c-4b82-86a8-03f911bd3538 Copilot-Session: 31f45d49-d082-4af0-b593-69816d20dce1 Copilot-Session: 72672081-9f02-41bf-9f12-845073743ebe Copilot-Session: 971d1bd8-4d07-4f3a-a701-c01e5a94448e --- .../changes/azure-identity-1-27-stable.md | 7 + sdk/identity/azure-identity/CHANGELOG.md | 8 +- sdk/identity/azure-identity/README.md | 15 + .../azure-identity/TROUBLESHOOTING.md | 12 + .../azure/identity/_constants.py | 4 + .../azure/identity/_credentials/azd_cli.py | 52 +- .../_credentials/workload_identity.py | 57 ++ .../azure/identity/_internal/aad_client.py | 3 +- .../identity/_internal/aad_client_base.py | 7 +- .../token_binding_transport_mixin.py | 140 +++ .../token_binding_transport_requests.py | 62 ++ .../azure-identity/azure/identity/_version.py | 2 +- .../aio/_credentials/workload_identity.py | 66 ++ .../identity/aio/_internal/aad_client.py | 5 +- .../token_binding_transport_aiohttp.py | 37 + .../token_binding_transport_asyncio.py | 57 ++ .../azure-identity/design-decisions.md | 9 + .../azure-identity/tests/test_aad_client.py | 6 +- .../tests/test_azd_cli_credential.py | 173 ++-- .../tests/test_azd_cli_credential_async.py | 6 +- .../tests/test_token_binding_transport.py | 326 +++++++ .../test_workload_identity_credential.py | 572 ++++++++++- ...test_workload_identity_credential_async.py | 887 +++++++++++++++++- 23 files changed, 2423 insertions(+), 90 deletions(-) create mode 100644 .chronus/changes/azure-identity-1-27-stable.md create mode 100644 sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_mixin.py create mode 100644 sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_requests.py create mode 100644 sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_aiohttp.py create mode 100644 sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_asyncio.py create mode 100644 sdk/identity/azure-identity/tests/test_token_binding_transport.py diff --git a/.chronus/changes/azure-identity-1-27-stable.md b/.chronus/changes/azure-identity-1-27-stable.md new file mode 100644 index 000000000000..225ee54f9e47 --- /dev/null +++ b/.chronus/changes/azure-identity-1-27-stable.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - sdk/identity/azure-identity +--- + +Prepare the 1.27.0 stable release metadata and document AKS identity binding configuration. The existing release entries remain in CHANGELOG.md. diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index 15e5d69dd824..319f46f208bf 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -1,9 +1,15 @@ # Release History -## 1.26.1 (Unreleased) +## 1.27.0 (Unreleased) + +### Features Added + +- Added support for `WorkloadIdentityCredential` identity binding mode in AKS environments. This feature uses an AKS proxy to handle FIC exchanges on behalf of pods, addressing Entra's limit on federated identity credentials per managed identity. Enable it by constructing `WorkloadIdentityCredential` directly with `enable_azure_proxy=True`. Identity binding mode isn't supported through `DefaultAzureCredential`. ([#43287](https://github.com/Azure/azure-sdk-for-python/pull/43287), [#44147](https://github.com/Azure/azure-sdk-for-python/pull/44147)) ### Bugs Fixed +- Fixed `AzureDeveloperCliCredential` to correctly parse error messages from Azure Developer CLI v1.23.7 and later, which previously caused raw JSON to surface in `ClientAuthenticationError` instead of the underlying error text. ([#46711](https://github.com/Azure/azure-sdk-for-python/pull/46711)) +- Fixed persistent token cache isolation on macOS when using custom cache names or CAE-enabled caches. ([#49314](https://github.com/Azure/azure-sdk-for-python/pull/49314)) - Fixed a regression in 1.26.0 where asynchronous `OnBehalfOfCredential` instances could not reuse access or refresh tokens cached by another instance with the same user assertion. Cache entries are now isolated by user assertion, allowing safe reuse across instances, including with `TokenCachePersistenceOptions`. Existing cache entries without assertion binding require a fresh token exchange. ([#49533](https://github.com/Azure/azure-sdk-for-python/pull/49533)) ## 1.26.0 (2026-09-30) diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 98b7f4a21d3b..e9356be024a5 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -102,6 +102,21 @@ client = SecretClient("https://my-vault.vault.azure.net", default_credential) - [Azure Virtual Machines](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token) - [Azure Virtual Machines Scale Sets](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-powershell-windows-vmss) +## AKS identity bindings + +[`WorkloadIdentityCredential`][workload_id_cred_ref] supports [AKS identity bindings](https://learn.microsoft.com/azure/aks/identity-bindings), which allow multiple clusters to share a federated identity credential for a user-assigned managed identity. + +After configuring an identity binding and authorizing the pod's Kubernetes service account, construct `WorkloadIdentityCredential` directly with `enable_azure_proxy=True`: + +```python +from azure.identity import WorkloadIdentityCredential + +with WorkloadIdentityCredential(enable_azure_proxy=True) as credential: + token = credential.get_token("https://management.azure.com/.default") +``` + +AKS supplies the pod's identity, projected-token, proxy, SNI, and CA configuration. Identity binding mode isn't supported through `DefaultAzureCredential`. The asynchronous `WorkloadIdentityCredential` in `azure.identity.aio` supports the same option. + ## Cloud configuration Credentials default to authenticating to the Microsoft Entra endpoint for Azure Public Cloud. To access resources in other clouds, such as Azure Government or a private cloud, configure credentials with the `authority` argument. [AzureAuthorityHosts](https://aka.ms/azsdk/python/identity/docs#azure.identity.AzureAuthorityHosts) defines authorities for well-known clouds: diff --git a/sdk/identity/azure-identity/TROUBLESHOOTING.md b/sdk/identity/azure-identity/TROUBLESHOOTING.md index 777f9c7944de..db1019455a17 100644 --- a/sdk/identity/azure-identity/TROUBLESHOOTING.md +++ b/sdk/identity/azure-identity/TROUBLESHOOTING.md @@ -287,6 +287,18 @@ Get-AzAccessToken -ResourceUrl "https://management.core.windows.net" |---|---|---| |WorkloadIdentityCredential authentication unavailable. The workload options are not fully configured|The `WorkloadIdentityCredential` requires `client_id`, `tenant_id` and `token_file_path` to authenticate with Microsoft Entra ID.|
  • If using `DefaultAzureCredential` then:
    • Ensure client ID is specified via the `workload_identity_client_id` keyword argument or the `AZURE_CLIENT_ID` env variable.
    • Ensure tenant ID is specified via the `AZURE_TENANT_ID` env variable.
    • Ensure token file path is specified via `AZURE_FEDERATED_TOKEN_FILE` env variable.
    • Ensure authority host is specified via `AZURE_AUTHORITY_HOST` env variable.
  • If using `WorkloadIdentityCredential` then:
    • Ensure tenant ID is specified via the `tenant_id` keyword argument or the `AZURE_TENANT_ID` env variable.
    • Ensure client ID is specified via the `client_id` keyword argument or the `AZURE_CLIENT_ID` env variable.
    • Ensure token file path is specified via the `token_file_path` keyword argument or the `AZURE_FEDERATED_TOKEN_FILE` environment variable.
  • Consult the [product troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for other issues.
| +#### `ClientAuthenticationError` for applications using [Azure Kubernetes Service identity bindings](https://learn.microsoft.com/azure/aks/identity-bindings-concepts) + +| Error Message |Description| Mitigation | +|---|---|---| +|
  • AADSTS700211: No matching federated identity record found for presented assertion issuer ...
  • AADSTS700212: No matching federated identity record found for presented assertion audience 'api://AKSIdentityBinding'.
|`WorkloadIdentityCredential` isn't configured to use the identity binding proxy|Set the `enable_azure_proxy` keyword argument to `True` when creating `WorkloadIdentityCredential`. Note that identity binding mode isn't supported when `WorkloadIdentityCredential` is used via `DefaultAzureCredential`. `WorkloadIdentityCredential` should be used directly in this scenario.| + +For asynchronous identity binding requests, the credential uses aiohttp when it supports the `server_hostname` argument (aiohttp 3.9 and later). If aiohttp is missing or lacks this support, the credential falls back to Requests running in an executor thread. + +Identity binding mode forwards `connection_timeout`, `read_timeout`, `connection_data_block_size`, and `use_env_settings` to its transport. It continues to select its own transport and session and uses the AKS-provided SNI and CA configuration; credential constructor options for custom transports, sessions, and TLS settings do not override that configuration. + +Token caching uses the original Microsoft Entra endpoint, not the proxy URL. A path prefix in `AZURE_KUBERNETES_TOKEN_PROXY` therefore doesn't change the tenant used for cache entries or prevent token reuse. + ## Troubleshoot `AzurePipelinesCredential` authentication issues [comment]: # ( cspell:ignore oidcrequesturi ) diff --git a/sdk/identity/azure-identity/azure/identity/_constants.py b/sdk/identity/azure-identity/azure/identity/_constants.py index 56e33444742d..4f86f3d94c48 100644 --- a/sdk/identity/azure-identity/azure/identity/_constants.py +++ b/sdk/identity/azure-identity/azure/identity/_constants.py @@ -68,6 +68,10 @@ class EnvironmentVariables: AZURE_REGIONAL_AUTHORITY_NAME = "AZURE_REGIONAL_AUTHORITY_NAME" AZURE_FEDERATED_TOKEN_FILE = "AZURE_FEDERATED_TOKEN_FILE" + AZURE_KUBERNETES_SNI_NAME = "AZURE_KUBERNETES_SNI_NAME" + AZURE_KUBERNETES_TOKEN_PROXY = "AZURE_KUBERNETES_TOKEN_PROXY" + AZURE_KUBERNETES_CA_FILE = "AZURE_KUBERNETES_CA_FILE" + AZURE_KUBERNETES_CA_DATA = "AZURE_KUBERNETES_CA_DATA" AZURE_TOKEN_CREDENTIALS = "AZURE_TOKEN_CREDENTIALS" WORKLOAD_IDENTITY_VARS = (AZURE_AUTHORITY_HOST, AZURE_TENANT_ID, AZURE_FEDERATED_TOKEN_FILE) diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/azd_cli.py b/sdk/identity/azure-identity/azure/identity/_credentials/azd_cli.py index ee90e55ca17c..dd6c11a528a8 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/azd_cli.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/azd_cli.py @@ -258,19 +258,25 @@ def sanitize_output(output: str) -> str: def extract_cli_error_message(output: str) -> Optional[str]: """ - Extract a single, user-friendly message from azd consoleMessage JSON output. + Extract a single, user-friendly message from azd's stderr JSON output. + + azd writes JSON error messages to stderr. The format depends on the azd version: + + * v1.24.0+: ``{"error":"...","message":"...","suggestion":"..."}`` (single line) + * v1.23.7 - v1.23.15: an empty ``{"type":"consoleMessage",...}`` line followed by + the structured ``{"error":"..."}`` line + * pre-v1.23.7 (legacy): a single ``{"type":"consoleMessage","data":{"message":"..."}}`` + line whose ``data.message`` carries the entire ``ERROR: ...`` output + + The structured ``"error"`` field is preferred when present; otherwise the function falls + back to the first non-empty legacy ``consoleMessage`` ``data.message``. Returns ``None`` + if no message can be extracted. :param str output: The output from the Azure Developer CLI command. :return: A user-friendly error message if found, otherwise None. :rtype: Optional[str] - - Preference order: - 1) A message containing "Suggestion" (case-insensitive) - 2) The second message if multiple are present - 3) The first message if only one exists - Returns None if no messages can be parsed. """ - messages: List[str] = [] + fallback: Optional[str] = None for line in output.splitlines(): line = line.strip() if not line: @@ -279,29 +285,23 @@ def extract_cli_error_message(output: str) -> Optional[str]: obj = json.loads(line) except json.JSONDecodeError: # not JSON -> ignore continue - if isinstance(obj, dict): + if not isinstance(obj, dict): + continue + + # Prefer the structured "error" field (azd v1.23.7+). + err = obj.get("error") + if isinstance(err, str) and err.strip(): + return sanitize_output(err.strip()) + + # Fall back to the first non-empty legacy consoleMessage data.message. + if fallback is None: data = obj.get("data") if isinstance(data, dict): msg = data.get("message") if isinstance(msg, str) and msg.strip(): - messages.append(msg.strip()) - continue - msg = obj.get("message") - if isinstance(msg, str) and msg.strip(): - messages.append(msg.strip()) - - if not messages: - return None - - # Prefer the suggestion line if present - for msg in messages: - if "suggestion" in msg.lower(): - return sanitize_output(msg) + fallback = msg.strip() - # If more than one message exists, return the last one - if len(messages) > 1: - return sanitize_output(messages[-1]) - return sanitize_output(messages[0]) + return sanitize_output(fallback) if fallback else None def _run_command(command_args: List[str], timeout: int) -> str: diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/workload_identity.py b/sdk/identity/azure-identity/azure/identity/_credentials/workload_identity.py index 8ca89185b058..ffd14fbbe68b 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/workload_identity.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/workload_identity.py @@ -9,6 +9,7 @@ from .client_assertion import ClientAssertionCredential from .._constants import EnvironmentVariables +from .._internal import within_credential_chain, within_dac WORKLOAD_CONFIG_ERROR = ( @@ -16,6 +17,16 @@ "configured. See the troubleshooting guide for more information: " "https://aka.ms/azsdk/python/identity/workloadidentitycredential/troubleshoot" ) +CA_DATA_FILE_ERROR = "Both AZURE_KUBERNETES_CA_FILE and AZURE_KUBERNETES_CA_DATA are set. Only one should be set." +CUSTOM_PROXY_ENV_ERROR = ( + "AZURE_KUBERNETES_TOKEN_PROXY is not set but other custom endpoint-related environment variables are present." +) +_TOKEN_PROXY_TRANSPORT_OPTIONS = ( + "connection_timeout", + "read_timeout", + "connection_data_block_size", + "use_env_settings", +) class TokenFileMixin: @@ -57,6 +68,9 @@ class WorkloadIdentityCredential(ClientAssertionCredential, TokenFileMixin): :keyword str client_id: The client ID of a Microsoft Entra app registration. :keyword str token_file_path: The path to a file containing a Kubernetes service account token that authenticates the identity. + :keyword bool enable_azure_proxy: Whether to use the AKS identity binding proxy when its configuration is available. + Defaults to False. Use this credential directly; identity binding mode isn't supported through + DefaultAzureCredential. .. admonition:: Example: @@ -100,6 +114,33 @@ def __init__( self._token_file_path = token_file_path + if kwargs.pop("enable_azure_proxy", False) and not within_dac.get() and not within_credential_chain.get(): + token_proxy_endpoint = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_TOKEN_PROXY) + sni = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_SNI_NAME) + ca_file = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_CA_FILE) + ca_data = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_CA_DATA) + if token_proxy_endpoint: + if ca_file and ca_data: + raise ValueError(CA_DATA_FILE_ERROR) + + transport = _get_transport( + sni=sni, + token_proxy_endpoint=token_proxy_endpoint, + ca_file=ca_file, + ca_data=ca_data, + **{name: kwargs[name] for name in _TOKEN_PROXY_TRANSPORT_OPTIONS if name in kwargs}, + ) + + if transport: + kwargs["transport"] = transport + else: + raise ValueError( + "Transport creation failed. Ensure that the requests package is installed to enable token " + "proxy usage in this credential." + ) + elif sni or ca_file or ca_data: + raise ValueError(CUSTOM_PROXY_ENV_ERROR) + super(WorkloadIdentityCredential, self).__init__( tenant_id=tenant_id, client_id=client_id, @@ -107,3 +148,19 @@ def __init__( token_file_path=token_file_path, **kwargs, ) + + +def _get_transport(sni, token_proxy_endpoint, ca_file, ca_data, **kwargs): + try: + from .._internal.token_binding_transport_requests import CustomRequestsTransport + + return CustomRequestsTransport( + sni=sni, + proxy_endpoint=token_proxy_endpoint, + ca_file=ca_file, + ca_data=ca_data, + **kwargs, + ) + + except ImportError: + return None diff --git a/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py b/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py index d4d9ff0ae536..4e235b27b5f6 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py @@ -73,6 +73,7 @@ def _run_pipeline(self, request: HttpRequest, **kwargs: Any) -> AccessTokenInfo: kwargs.pop("claims", None) kwargs.pop("client_secret", None) enable_cae = kwargs.pop("enable_cae", False) + token_endpoint = request.url now = int(time.time()) response = self._pipeline.run(request, retry_on_methods=self._POST, **kwargs) - return self._process_response(response, now, enable_cae=enable_cae, **kwargs) + return self._process_response(response, now, token_endpoint=token_endpoint, enable_cae=enable_cae, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py b/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py index 85837b9230cf..db5427590b02 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py @@ -191,7 +191,9 @@ def obtain_token_on_behalf_of(self, scopes, client_credential, user_assertion, * def _build_pipeline(self, **kwargs): pass - def _process_response(self, response: PipelineResponse, request_time: int, **kwargs) -> AccessTokenInfo: + def _process_response( + self, response: PipelineResponse, request_time: int, token_endpoint: str, **kwargs + ) -> AccessTokenInfo: content = response.context.get( ContentDecodePolicy.CONTEXT_NAME ) or ContentDecodePolicy.deserialize_from_http_generics(response.http_response) @@ -264,7 +266,8 @@ def _process_response(self, response: PipelineResponse, request_time: int, **kwa "client_id": self._get_cache_client_id(**kwargs), "response": content, "scope": response.http_request.body["scope"].split(), - "token_endpoint": response.http_request.url, + # A proxy may have rewritten the request URL. MSAL derives the cache realm from this endpoint. + "token_endpoint": token_endpoint, }, now=request_time, ) diff --git a/sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_mixin.py b/sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_mixin.py new file mode 100644 index 000000000000..ccf55667afed --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_mixin.py @@ -0,0 +1,140 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cspell:ignore cafile +import os +import urllib.parse +from typing import Optional, Any + +from azure.core.rest import HttpRequest + + +class TokenBindingTransportMixin: + """Mixin class providing URL validation, CA file tracking, and proxy URL functionality for transport classes.""" + + def __init__(self, **kwargs: Any) -> None: + """Initialize CA file tracking and proxy attributes.""" + self._ca_file = kwargs.pop("ca_file", None) + self._ca_data = kwargs.pop("ca_data", None) + self._proxy_endpoint = kwargs.pop("proxy_endpoint", None) + self._sni = kwargs.pop("sni", None) + + self._ca_file_mtime: Optional[float] = None + + if self._ca_file and self._ca_data: + raise ValueError("Both ca_file and ca_data are set. Only one should be set") + + if self._proxy_endpoint: + self._validate_url(self._proxy_endpoint) + + # If we have a ca_file, read it once and store as ca_data + if self._ca_file: + self._load_ca_file_to_data() + + super().__init__(**kwargs) + + def _validate_url(self, url: str) -> None: + """Validate that a URL meets security requirements for HTTPS connections. + + :param url: The URL to validate. + :type url: str + :raises ValueError: If the URL does not meet security requirements. + """ + parsed_url = urllib.parse.urlparse(url) + if parsed_url.scheme != "https": + raise ValueError(f"Endpoint URL ({url}) must use the 'https' scheme. Got '{parsed_url.scheme}' instead.") + if parsed_url.username or parsed_url.password: + raise ValueError(f"Endpoint URL ({url}) must not contain username or password.") + if parsed_url.fragment: + raise ValueError(f"Endpoint URL ({url}) must not contain a fragment.") + if parsed_url.query: + raise ValueError(f"Endpoint URL ({url}) must not contain query parameters.") + + def _load_ca_file_to_data(self) -> None: + """Load CA file content into ca_data and track modification time. + + :raises ValueError: If the CA file is empty on first read. + """ + try: + with open(self._ca_file, "r", encoding="utf-8") as f: + content = f.read() + mtime = os.fstat(f.fileno()).st_mtime + + # Check if the file is empty + if not content: + # If no prior ca_data exists (first read), fail + if self._ca_data is None: + raise ValueError(f"CA file ({self._ca_file}) is empty. Cannot establish secure connection.") + # If we had prior ca_data, keep it (mid-rotation scenario) + return + + # File has content, update ca_data and tracking + self._ca_data = content + self._ca_file_mtime = mtime + except (OSError, IOError) as e: + # If no prior ca_data exists (first read), fail + if self._ca_data is None: + raise ValueError(f"Failed to read CA file ({self._ca_file}): {e}") from e + # If we can't read the file, keep existing ca_data but clear mtime + # so we'll try to reload on the next change check + self._ca_file_mtime = None + + def _has_ca_file_changed(self) -> bool: + """Check if the CA file has changed since last load. + + :return: True if the CA file has changed, False otherwise. + :rtype: bool + """ + if not self._ca_file: + return False + + if not os.path.exists(self._ca_file): + # File was deleted, consider this a change if we had data before + return self._ca_data is not None or self._ca_file_mtime is not None + + try: + # Check modification time + current_mtime = os.path.getmtime(self._ca_file) + return self._ca_file_mtime != current_mtime + except (OSError, IOError): + # If we can't read the file stats, assume it changed + return True + + def _update_request_url(self, request: HttpRequest) -> None: + """Update the request URL to use proxy endpoint if configured. + + :param request: The HTTP request object to update. + :type request: ~azure.core.rest.HttpRequest + """ + if self._proxy_endpoint: + parsed_request_url = urllib.parse.urlparse(request.url) + parsed_proxy_url = urllib.parse.urlparse(self._proxy_endpoint) + proxy_path = parsed_proxy_url.path.rstrip("/") + request_origin = ( + parsed_request_url.scheme, + parsed_request_url.hostname, + parsed_request_url.port if parsed_request_url.port is not None else 443, + ) + proxy_origin = ( + parsed_proxy_url.scheme, + parsed_proxy_url.hostname, + parsed_proxy_url.port if parsed_proxy_url.port is not None else 443, + ) + # Retries reuse the request, whose URL may already point to the proxy. + if request_origin == proxy_origin and ( + parsed_request_url.path == proxy_path or parsed_request_url.path.startswith(proxy_path + "/") + ): + return + combined_path = proxy_path + "/" + parsed_request_url.path.lstrip("/") + new_url = urllib.parse.urlunparse( + ( + parsed_proxy_url.scheme, + parsed_proxy_url.netloc, + combined_path, + parsed_request_url.params, + parsed_request_url.query, + parsed_request_url.fragment, + ) + ) + request.url = new_url diff --git a/sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_requests.py b/sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_requests.py new file mode 100644 index 000000000000..2bcf841293b1 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_requests.py @@ -0,0 +1,62 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +""" +Requests transport class for WorkloadIdentityCredential with token proxy support. +""" +import ssl +from typing import Any, Optional + +from requests.adapters import HTTPAdapter +from requests import Session +from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import, no-name-in-module + RequestsTransport, +) +from azure.core.rest import HttpRequest + +from .token_binding_transport_mixin import TokenBindingTransportMixin + + +class SNIAdapter(HTTPAdapter): + """A custom HTTPAdapter that allows setting a custom SNI hostname.""" + + def __init__(self, server_hostname: Optional[str], ca_data: Optional[str], **kwargs: Any) -> None: + self.server_hostname = server_hostname + self.ca_data = ca_data + super().__init__(**kwargs) + + def init_poolmanager(self, connections: int, maxsize: int, block: bool = False, **pool_kwargs: Any) -> None: + if self.server_hostname: + pool_kwargs["server_hostname"] = self.server_hostname + pool_kwargs["ssl_context"] = ssl.create_default_context(cadata=self.ca_data) + super().init_poolmanager(connections, maxsize, block, **pool_kwargs) + + +class CustomRequestsTransport(TokenBindingTransportMixin, RequestsTransport): + """Custom RequestsTransport with SNI and CA certificate support for WorkloadIdentityCredential.""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + self.session: Optional[Session] = None + super().__init__(*args, **kwargs) + self._update_adaptor() + + def _update_adaptor(self) -> None: + """Update the session's adapter with the current SNI and CA data.""" + if not self.session: + self.session = Session() + self.session.trust_env = self._use_env_settings + + adapter = SNIAdapter(self._sni, self._ca_data) + self.session.mount("https://", adapter) + + def send(self, request: HttpRequest, **kwargs: Any) -> Any: + self._update_request_url(request) + + # Check if CA file has changed and reload ca_data if needed + if self._ca_file and self._has_ca_file_changed(): + self._load_ca_file_to_data() + # If ca_data was updated, recreate SSL context with the new data + if self._ca_data: + self._update_adaptor() + return super().send(request, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/_version.py b/sdk/identity/azure-identity/azure/identity/_version.py index bf1a5a06394c..59f2e124e917 100644 --- a/sdk/identity/azure-identity/azure/identity/_version.py +++ b/sdk/identity/azure-identity/azure/identity/_version.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -VERSION = "1.26.1" +VERSION = "1.27.0" diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/workload_identity.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/workload_identity.py index 16c7f8a5b746..868066e69c34 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/workload_identity.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/workload_identity.py @@ -4,14 +4,19 @@ # ------------------------------------ # cspell:ignore cafile import os +from inspect import signature from typing import Any, Optional from .client_assertion import ClientAssertionCredential from ..._credentials.workload_identity import ( TokenFileMixin, WORKLOAD_CONFIG_ERROR, + CA_DATA_FILE_ERROR, + CUSTOM_PROXY_ENV_ERROR, + _TOKEN_PROXY_TRANSPORT_OPTIONS, ) from ..._constants import EnvironmentVariables +from ..._internal import within_credential_chain, within_dac class WorkloadIdentityCredential(ClientAssertionCredential, TokenFileMixin): @@ -35,6 +40,9 @@ class WorkloadIdentityCredential(ClientAssertionCredential, TokenFileMixin): :keyword str client_id: The client ID of a Microsoft Entra app registration. :keyword str token_file_path: The path to a file containing a Kubernetes service account token that authenticates the identity. + :keyword bool enable_azure_proxy: Whether to use the AKS identity binding proxy when its configuration is available. + Defaults to False. Use this credential directly; identity binding mode isn't supported through + DefaultAzureCredential. .. admonition:: Example: @@ -78,6 +86,33 @@ def __init__( self._token_file_path = token_file_path + if kwargs.pop("enable_azure_proxy", False) and not within_dac.get() and not within_credential_chain.get(): + token_proxy_endpoint = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_TOKEN_PROXY) + sni = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_SNI_NAME) + ca_file = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_CA_FILE) + ca_data = os.environ.get(EnvironmentVariables.AZURE_KUBERNETES_CA_DATA) + if token_proxy_endpoint: + if ca_file and ca_data: + raise ValueError(CA_DATA_FILE_ERROR) + + transport = _get_transport( + sni=sni, + token_proxy_endpoint=token_proxy_endpoint, + ca_file=ca_file, + ca_data=ca_data, + **{name: kwargs[name] for name in _TOKEN_PROXY_TRANSPORT_OPTIONS if name in kwargs}, + ) + + if transport: + kwargs["transport"] = transport + else: + raise ValueError( + "Async transport creation failed. Ensure that the aiohttp or requests package is installed to " + "enable token proxy usage in this credential." + ) + elif sni or ca_file or ca_data: + raise ValueError(CUSTOM_PROXY_ENV_ERROR) + super().__init__( tenant_id=tenant_id, client_id=client_id, @@ -85,3 +120,34 @@ def __init__( token_file_path=token_file_path, **kwargs, ) + + +def _get_transport(sni, token_proxy_endpoint, ca_file, ca_data, **kwargs): + try: + from aiohttp import ClientSession + + from .._internal.token_binding_transport_aiohttp import CustomAioHttpTransport + + if "server_hostname" not in signature(ClientSession._request).parameters: # pylint: disable=protected-access + raise ImportError("aiohttp transport requires server_hostname support") + return CustomAioHttpTransport( + sni=sni, + proxy_endpoint=token_proxy_endpoint, + ca_file=ca_file, + ca_data=ca_data, + **kwargs, + ) + except ImportError: + # Fallback to async-wrapped requests transport + try: + from .._internal.token_binding_transport_asyncio import CustomAsyncioRequestsTransport + + return CustomAsyncioRequestsTransport( + sni=sni, + proxy_endpoint=token_proxy_endpoint, + ca_file=ca_file, + ca_data=ca_data, + **kwargs, + ) + except ImportError: + return None diff --git a/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py b/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py index 400cb2da2daf..3c1b3606f8f6 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py @@ -92,6 +92,9 @@ async def _run_pipeline(self, request: HttpRequest, **kwargs) -> AccessTokenInfo kwargs.pop("claims", None) kwargs.pop("client_secret", None) enable_cae = kwargs.pop("enable_cae", False) + token_endpoint = request.url now = int(time.time()) response = await self._pipeline.run(request, retry_on_methods=self._POST, **kwargs) - return self._process_response(response, now, enable_cae=enable_cae, tenant_id=tenant_id, **kwargs) + return self._process_response( + response, now, token_endpoint=token_endpoint, enable_cae=enable_cae, tenant_id=tenant_id, **kwargs + ) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_aiohttp.py b/sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_aiohttp.py new file mode 100644 index 000000000000..1a21c5b13d54 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_aiohttp.py @@ -0,0 +1,37 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +""" +Aiohttp transport class for the asynchronous WorkloadIdentityCredential with token proxy support. +""" +import ssl +from typing import Any + +from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import, no-name-in-module + AioHttpTransport, +) +from azure.core.rest import HttpRequest + +from ..._internal.token_binding_transport_mixin import TokenBindingTransportMixin + + +class CustomAioHttpTransport(TokenBindingTransportMixin, AioHttpTransport): + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._ssl_context = ssl.create_default_context(cadata=self._ca_data) + + async def send(self, request: HttpRequest, **kwargs: Any) -> Any: + self._update_request_url(request) + kwargs.setdefault("server_hostname", self._sni) + + # Check if CA file has changed and reload ca_data if needed + if self._ca_file and self._has_ca_file_changed(): + self._load_ca_file_to_data() + # If ca_data was updated, recreate SSL context with the new data + if self._ca_data: + self._ssl_context = ssl.create_default_context(cadata=self._ca_data) + + kwargs.setdefault("ssl", self._ssl_context) + return await super().send(request, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_asyncio.py b/sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_asyncio.py new file mode 100644 index 000000000000..cc8428ddd5ab --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/aio/_internal/token_binding_transport_asyncio.py @@ -0,0 +1,57 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +""" +Asyncio Requests transport class for the asynchronous WorkloadIdentityCredential with token proxy support. +""" +from typing import Any, Optional + +from requests import Session +from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import, no-name-in-module + AsyncioRequestsTransport, +) +from azure.core.rest import HttpRequest + +from ..._internal.token_binding_transport_mixin import TokenBindingTransportMixin +from ..._internal.token_binding_transport_requests import SNIAdapter + + +class CustomAsyncioRequestsTransport(TokenBindingTransportMixin, AsyncioRequestsTransport): + + def __init__(self, *args, **kwargs): + self.session: Optional[Session] = None + super().__init__(*args, **kwargs) + self._update_adaptor() + + def _update_adaptor(self) -> None: + """Update the session's adapter with the current SNI and CA data.""" + if not self.session: + self.session = Session() + self.session.trust_env = self._use_env_settings + + adapter = SNIAdapter(self._sni, self._ca_data) + self.session.mount("https://", adapter) + + async def send(self, request: HttpRequest, **kwargs: Any) -> Any: + self._update_request_url(request) + + # Check if CA file has changed and reload ca_data if needed + if self._ca_file and self._has_ca_file_changed(): + self._load_ca_file_to_data() + # If ca_data was updated, recreate SSL context with the new data + if self._ca_data: + self._update_adaptor() + + connection_timeout = kwargs.pop("connection_timeout", self.connection_config.timeout) + if isinstance(connection_timeout, tuple): + if "read_timeout" in kwargs: + raise ValueError("Cannot set tuple connection_timeout and read_timeout together") + kwargs["connection_timeout"] = connection_timeout + else: + kwargs["connection_timeout"] = ( + connection_timeout, + kwargs.pop("read_timeout", self.connection_config.read_timeout), + ) + + return await super().send(request, **kwargs) diff --git a/sdk/identity/azure-identity/design-decisions.md b/sdk/identity/azure-identity/design-decisions.md index 0929d243f722..782b872e988a 100644 --- a/sdk/identity/azure-identity/design-decisions.md +++ b/sdk/identity/azure-identity/design-decisions.md @@ -515,6 +515,15 @@ DAC substitutes a `FailedDACCredential` placeholder that raises `CredentialUnava error message. This placeholder pattern exists specifically because some credentials fail *by design* during construction. +### `WorkloadIdentityCredential` AKS "binding mode" (FIC-per-MI ceiling workaround) +PR [#43287](https://github.com/Azure/azure-sdk-for-python/pull/43287) (2025-11) + +Entra limits Federated Identity Credentials (FICs) per managed identity, which large AKS +clusters can exhaust. Binding mode routes the FIC exchange through an AKS-side proxy +(`enable_azure_proxy=True`, configured via `AZURE_KUBERNETES_TOKEN_PROXY` and SNI/CA env vars) +so a single set of FICs serves many pods. The proxy path is intentionally skipped when running +inside a `ChainedTokenCredential`. + --- ## Recurring patterns worth internalizing diff --git a/sdk/identity/azure-identity/tests/test_aad_client.py b/sdk/identity/azure-identity/tests/test_aad_client.py index 752c186c7d8f..338320bb6f36 100644 --- a/sdk/identity/azure-identity/tests/test_aad_client.py +++ b/sdk/identity/azure-identity/tests/test_aad_client.py @@ -72,7 +72,11 @@ def test_none_content_handling(): client = AadClient("tenant id", "client id", transport=transport) with pytest.raises(ClientAuthenticationError): - client._process_response(mock_pipeline_response, int(1234567890)) + client._process_response( + mock_pipeline_response, + int(1234567890), + token_endpoint="https://login.microsoftonline.com/tenant/oauth2/v2.0/token", + ) @pytest.mark.skip(reason="Adding body to HttpResponseError str. Not an issue bc we don't automatically log errors") diff --git a/sdk/identity/azure-identity/tests/test_azd_cli_credential.py b/sdk/identity/azure-identity/tests/test_azd_cli_credential.py index 1aef5c3225de..12a209edeb41 100644 --- a/sdk/identity/azure-identity/tests/test_azd_cli_credential.py +++ b/sdk/identity/azure-identity/tests/test_azd_cli_credential.py @@ -346,7 +346,11 @@ def test_claims_challenge_raises_error(get_token_method): claims = '{"access_token":{"acrs":{"essential":true,"values":["p1"]}}}' credential = AzureDeveloperCliCredential() - expected_message = "Suggestion: re-authentication required, run `azd auth login` to acquire a new token." + expected_message = ( + "ERROR: fetching token: AADSTS50076: Due to a configuration change made by your administrator, " + "or because you moved to a new location, you must use multi-factor authentication to access " + "'tenant-id'. Trace ID: trace-id Correlation ID: correlation-id Timestamp: 2025-08-18 22:08:14Z" + ) error_output = """\ {"data":{"message":"\\nERROR: fetching token: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'tenant-id'. Trace ID: trace-id Correlation ID: correlation-id Timestamp: 2025-08-18 22:08:14Z\\n"}} {"data":{"message":"Suggestion: re-authentication required, run `azd auth login` to acquire a new token.\\n"}}""" @@ -439,36 +443,8 @@ def fake_check_output(command_line, **kwargs): class TestExtractCliErrorMessage: """Tests for the error message extraction function.""" - def test_extract_suggestion_message_preferred(self): - """Should prefer messages containing 'Suggestion' (case-insensitive)""" - output = """\ -{"type":"consoleMessage","timestamp":"2025-08-18T15:08:14.4849845-07:00","data":{"message":"\\nERROR: fetching token: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'tenant-id'. Trace ID: trace-id Correlation ID: correlation-id Timestamp: 2025-08-18 22:08:14Z\\n"}} -{"type":"consoleMessage","timestamp":"2025-08-18T15:08:14.4849845-07:00","data":{"message":"Suggestion: re-authentication required, run `azd auth login` to acquire a new token.\\n"}}""" - - result = extract_cli_error_message(output) - assert result == "Suggestion: re-authentication required, run `azd auth login` to acquire a new token." - - def test_extract_suggestion_case_insensitive(self): - """Should find 'suggestion' in any case""" - output = """\ -{"type":"consoleMessage","data":{"message":"First message"}} -{"type":"consoleMessage","data":{"message":"SUGGESTION: Try running azd auth login"}}""" - - result = extract_cli_error_message(output) - assert result == "SUGGESTION: Try running azd auth login" - - def test_extract_last_message_when_no_suggestion(self): - """Should return last message when multiple messages but no suggestion""" - output = """\ -{"type":"consoleMessage","data":{"message":"First error message"}} -{"type":"consoleMessage","data":{"message":"Second error message"}} -{"type":"consoleMessage","data":{"message":"Third error message"}}""" - - result = extract_cli_error_message(output) - assert result == "Third error message" - def test_extract_first_message_when_only_one(self): - """Should return first message when only one exists""" + """Should return the first message when only one exists""" output = '{"type":"consoleMessage","data":{"message":"Only error message"}}' result = extract_cli_error_message(output) @@ -481,33 +457,52 @@ def test_extract_message_from_nested_data(self): result = extract_cli_error_message(output) assert result == "Error in nested data" - def test_extract_message_from_root_level(self): - """Should extract message from root level of JSON""" - output = '{"message":"Root level error message"}' + def test_extract_first_non_empty_data_message(self): + """Should return the first non-empty data.message; later messages are ignored. + + ``azd auth token`` (pre-v1.23.7) emits the entire ``ERROR: ... Suggestion: ...`` + blob inside a single ``consoleMessage`` line, so multi-line legacy output is + only seen if a separate ``Message(ctx, "")`` precedes it. The first non-empty + line is always the substantive error. + """ + output = """\ +{"type":"consoleMessage","timestamp":"2025-08-18T15:08:14.4849845-07:00","data":{"message":"\\nERROR: fetching token: AADSTS50076: multi-factor authentication required\\n\\nSuggestion: re-authentication required, run `azd auth login` to acquire a new token.\\n"}}""" result = extract_cli_error_message(output) - assert result == "Root level error message" + assert result == ( + "ERROR: fetching token: AADSTS50076: multi-factor authentication required\n\n" + "Suggestion: re-authentication required, run `azd auth login` to acquire a new token." + ) - def test_extract_mixed_message_locations(self): - """Should handle messages at different JSON levels""" + def test_extract_first_message_when_multiple_present(self): + """Multiple consoleMessage lines: first non-empty wins (matches Go/.NET).""" output = """\ -{"message":"Root level message"} -{"data":{"message":"Nested message"}} -{"data":{"message":"suggestion: Use this suggestion"}}""" +{"type":"consoleMessage","data":{"message":"First error message"}} +{"type":"consoleMessage","data":{"message":"Second error message"}} +{"type":"consoleMessage","data":{"message":"Third error message"}}""" result = extract_cli_error_message(output) - assert result == "suggestion: Use this suggestion" + assert result == "First error message" - def test_ignore_empty_messages(self): - """Should ignore empty or whitespace-only messages""" + def test_skip_empty_console_message_then_take_first_non_empty(self): + """Empty consoleMessage lines are skipped; the first non-empty one is returned.""" output = """\ -{"data":{"message":" "}} -{"data":{"message":""}} -{"data":{"message":"Valid message"}}""" +{"type":"consoleMessage","data":{"message":" "}} +{"type":"consoleMessage","data":{"message":""}} +{"type":"consoleMessage","data":{"message":"Valid message"}}""" result = extract_cli_error_message(output) assert result == "Valid message" + def test_root_level_message_field_not_extracted(self): + """Only the structured ``error`` field or legacy ``data.message`` is extracted.""" + # Root-level "message" alone (no "error", no "data.message") is friendly text like + # "Authentication with Azure failed." that we intentionally do not surface. + output = '{"message":"Root level error message"}' + + result = extract_cli_error_message(output) + assert result is None + def test_ignore_non_json_lines(self): """Should ignore lines that are not valid JSON""" output = """\ @@ -517,7 +512,7 @@ def test_ignore_non_json_lines(self): {"data":{"message":"Suggestion: Another valid message"}}""" result = extract_cli_error_message(output) - assert result == "Suggestion: Another valid message" + assert result == "Valid JSON message" def test_ignore_non_string_messages(self): """Should ignore messages that are not strings""" @@ -540,7 +535,7 @@ def test_ignore_empty_lines(self): """ result = extract_cli_error_message(output) - assert result == "Second message" + assert result == "First message" def test_sanitize_token_in_output(self): """Should sanitize tokens in the extracted message""" @@ -571,15 +566,20 @@ def test_return_none_for_whitespace_only_output(self): result = extract_cli_error_message(" \n\n \t ") assert result is None - def test_complex_real_world_example(self): - """Should handle complex real-world azd output""" - output = """\ -{"type":"consoleMessage","timestamp":"2025-08-18T15:08:14.4849845-07:00","data":{"message":"\\nERROR: fetching token: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'tenant-id'. Trace ID: trace-id Correlation ID: correlation-id Timestamp: 2025-08-18 22:08:14Z\\n"}} -{"type":"consoleMessage","timestamp":"2025-08-18T15:08:14.4849845-07:00","data":{"message":"Suggestion: re-authentication required, run `azd auth login` to acquire a new token.\\n"}} -{"type":"progress","data":{"activity":"Cleaning up"}}""" + def test_complex_real_world_pre_v1_23_7_example(self): + """Pre-v1.23.7 ``azd auth token`` output: a single consoleMessage containing the full error.""" + output = ( + '{"type":"consoleMessage","timestamp":"2026-04-14T22:03:37.687535934Z",' + '"data":{"message":"\\nERROR: fetching token: failed to authenticate:\\n' + "(invalid_tenant) AADSTS90002: Tenant 'test' not found...\\n\\n" + '"}}' + ) result = extract_cli_error_message(output) - assert result == "Suggestion: re-authentication required, run `azd auth login` to acquire a new token." + assert result == ( + "ERROR: fetching token: failed to authenticate:\n" + "(invalid_tenant) AADSTS90002: Tenant 'test' not found..." + ) def test_strip_whitespace_from_messages(self): """Should strip leading and trailing whitespace from messages""" @@ -597,3 +597,68 @@ def test_handle_malformed_json_gracefully(self): result = extract_cli_error_message(output) assert result == "suggestion: This should be found" + + def test_extract_structured_error_v1_24_format(self): + """Should extract the 'error' field from azd v1.24.0+ structured stderr.""" + # The AAD error here intentionally contains an embedded newline (decoded from \n in JSON). + aad_error = "fetching token: failed to authenticate:\n" "(invalid_tenant) AADSTS90002: Tenant 'test' not found" + output = ( + '{"error":"fetching token: failed to authenticate:\\n' + "(invalid_tenant) AADSTS90002: Tenant 'test' not found" + '","links":[{"title":"azd auth login reference","url":"https://example.com"}],' + '"message":"Authentication with Azure failed.",' + '"suggestion":"Run \'azd auth login\' to sign in again."}' + ) + + result = extract_cli_error_message(output) + assert result == aad_error + assert "Authentication with Azure failed." not in result + assert "suggestion" not in result.lower() + + def test_extract_structured_error_preceded_by_empty_console_message(self): + """v1.23.7 - v1.23.15: empty consoleMessage line precedes the structured error.""" + aad_error = "fetching token: failed to authenticate" + output = ( + '{"type":"consoleMessage","timestamp":"2026-04-13T17:43:24.7558297-07:00",' + '"data":{"message":"\\n"}}\n' + '{"error":"' + aad_error + '",' + '"message":"Authentication with Azure failed.",' + '"suggestion":"Run \'azd auth login\' to sign in again."}' + ) + + result = extract_cli_error_message(output) + assert result == aad_error + assert "consoleMessage" not in result + + def test_structured_error_takes_precedence_over_console_message(self): + """The structured 'error' field should win over a non-empty consoleMessage line.""" + aad_error = "AADSTS70008: Refresh token expired" + output = ( + '{"type":"consoleMessage","timestamp":"...",' + '"data":{"message":"some informational console output"}}\n' + '{"error":"' + aad_error + '",' + '"message":"Authentication with Azure failed."}' + ) + + result = extract_cli_error_message(output) + assert result == aad_error + assert "informational console output" not in result + + def test_structured_error_empty_falls_back_to_console_message(self): + """An empty 'error' field shouldn't short-circuit; legacy parsing should still run.""" + output = ( + '{"error":"","message":"Authentication with Azure failed."}\n' + '{"type":"consoleMessage","data":{"message":"ERROR: real message"}}' + ) + + result = extract_cli_error_message(output) + assert result == "ERROR: real message" + + def test_structured_error_sanitizes_token(self): + """Tokens embedded in the structured 'error' field should be sanitized.""" + output = '{"error":"got \\"token\\": \\"secret-abc\\" leaked"}' + + result = extract_cli_error_message(output) + assert result is not None + assert "secret-abc" not in result + assert "****" in result diff --git a/sdk/identity/azure-identity/tests/test_azd_cli_credential_async.py b/sdk/identity/azure-identity/tests/test_azd_cli_credential_async.py index d71e649b3df8..531ff2252c2f 100644 --- a/sdk/identity/azure-identity/tests/test_azd_cli_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_azd_cli_credential_async.py @@ -342,7 +342,11 @@ async def test_claims_challenge_raises_error(get_token_method): claims = '{"access_token":{"acrs":{"essential":true,"values":["p1"]}}}' credential = AzureDeveloperCliCredential() - expected_message = "Suggestion: re-authentication required, run `azd auth login` to acquire a new token." + expected_message = ( + "ERROR: fetching token: AADSTS50076: Due to a configuration change made by your administrator, " + "or because you moved to a new location, you must use multi-factor authentication to access " + "'tenant-id'. Trace ID: trace-id Correlation ID: correlation-id Timestamp: 2025-08-18 22:08:14Z" + ) error_output = """\ {"data":{"message":"\\nERROR: fetching token: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'tenant-id'. Trace ID: trace-id Correlation ID: correlation-id Timestamp: 2025-08-18 22:08:14Z\\n"}} {"data":{"message":"Suggestion: re-authentication required, run `azd auth login` to acquire a new token.\\n"}}""" diff --git a/sdk/identity/azure-identity/tests/test_token_binding_transport.py b/sdk/identity/azure-identity/tests/test_token_binding_transport.py new file mode 100644 index 000000000000..c1908fddf3e7 --- /dev/null +++ b/sdk/identity/azure-identity/tests/test_token_binding_transport.py @@ -0,0 +1,326 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cspell:ignore ests +from contextlib import contextmanager +import os +from unittest.mock import patch + +import pytest +from msal import TokenCache +from azure.core.pipeline import AsyncPipeline, Pipeline +from azure.core.pipeline.policies import AsyncRetryPolicy, RetryPolicy +from azure.core.pipeline.transport import AsyncHttpTransport +from azure.core.rest import HttpRequest +from azure.identity import WorkloadIdentityCredential +from azure.identity._internal import within_credential_chain, within_dac +from azure.identity._internal.token_binding_transport_mixin import TokenBindingTransportMixin +from azure.identity._internal.token_binding_transport_requests import CustomRequestsTransport +from azure.identity.aio import WorkloadIdentityCredential as AsyncWorkloadIdentityCredential +from azure.identity.aio._internal.token_binding_transport_aiohttp import CustomAioHttpTransport +from azure.identity.aio._internal.token_binding_transport_asyncio import CustomAsyncioRequestsTransport + +from proxy_server import TokenProxyHandler, TokenProxyTestServer + + +@pytest.mark.asyncio +@pytest.mark.parametrize("transport_mode", ["sync", "aiohttp", "asyncio-requests"]) +@pytest.mark.parametrize("proxy_path", ["", "/binding", "/api/binding/"]) +@pytest.mark.parametrize("retry", [False, True]) +@pytest.mark.parametrize("enable_cae", [False, True]) +async def test_proxy_token_cache_uses_original_endpoint(transport_mode, proxy_path, retry, enable_cae, tmp_path): + paths = [] + expected_path = proxy_path.rstrip("/") + "/tenant/oauth2/v2.0/token" + + def handle_request(handler): + paths.append(handler.path) + handler.rfile.read(int(handler.headers["Content-Length"])) + if handler.path != expected_path: + handler._send_json_response({"error": "wrong path"}, status_code=404) + elif retry and len(paths) == 1: + handler._send_json_response({"error": "temporarily unavailable"}, status_code=503) + else: + handler._send_json_response({"access_token": "cached-token", "token_type": "Bearer", "expires_in": 3600}) + + token_file = tmp_path / "token" + token_file.write_text("test-assertion", encoding="utf-8") + credential_type = WorkloadIdentityCredential if transport_mode == "sync" else AsyncWorkloadIdentityCredential + unavailable_modules = ( + {"azure.identity.aio._internal.token_binding_transport_aiohttp": None} + if transport_mode == "asyncio-requests" + else {} + ) + with patch.object(TokenProxyHandler, "_handle_request", handle_request): + with TokenProxyTestServer() as server: + env = { + "AZURE_KUBERNETES_TOKEN_PROXY": server.base_url + proxy_path, + "AZURE_KUBERNETES_CA_FILE": server.ca_file, + } + with patch.dict(os.environ, env, clear=True), patch.dict("sys.modules", unavailable_modules): + credential = credential_type( + tenant_id="tenant", + client_id="client", + token_file_path=str(token_file), + enable_azure_proxy=True, + use_env_settings=False, + retry_total=1, + retry_backoff_factor=0, + ) + scope = "https://graph.microsoft.com/.default" + if isinstance(credential, AsyncWorkloadIdentityCredential): + async with credential: + first = await credential.get_token(scope, enable_cae=enable_cae) + cached = await credential.get_token(scope, enable_cae=enable_cae) + else: + with credential: + first = credential.get_token(scope, enable_cae=enable_cae) + cached = credential.get_token(scope, enable_cae=enable_cae) + + assert first.token == cached.token == "cached-token" + cache = credential._client._get_cache(enable_cae=enable_cae) + entries = list(cache.search(TokenCache.CredentialType.ACCESS_TOKEN)) + assert len(entries) == 1 + assert entries[0]["realm"] == "tenant" + assert entries[0]["environment"] == "login.microsoftonline.com" + assert paths == [expected_path] * (2 if retry else 1) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("transport_mode", ["sync", "aiohttp", "asyncio-requests"]) +@pytest.mark.parametrize( + "options", + [ + {}, + { + "connection_timeout": 7, + "read_timeout": 9, + "connection_data_block_size": 8192, + "use_env_settings": False, + }, + { + "connection_timeout": 11, + "read_timeout": 13, + "connection_data_block_size": 16384, + "use_env_settings": True, + }, + ], + ids=["defaults", "custom-without-env", "custom-with-env"], +) +async def test_credential_forwards_proxy_transport_options(transport_mode, options, tmp_path): + token_file = tmp_path / "token" + token_file.write_text("test-assertion", encoding="utf-8") + credential_type = WorkloadIdentityCredential if transport_mode == "sync" else AsyncWorkloadIdentityCredential + expected_type = { + "sync": CustomRequestsTransport, + "aiohttp": CustomAioHttpTransport, + "asyncio-requests": CustomAsyncioRequestsTransport, + }[transport_mode] + unavailable_modules = ( + {"azure.identity.aio._internal.token_binding_transport_aiohttp": None} + if transport_mode == "asyncio-requests" + else {} + ) + with TokenProxyTestServer() as server: + env = { + "AZURE_KUBERNETES_TOKEN_PROXY": server.base_url, + "AZURE_KUBERNETES_SNI_NAME": "1234.ests.aks", + "AZURE_KUBERNETES_CA_FILE": server.ca_file, + } + if options.get("use_env_settings") is False: + env["HTTPS_PROXY"] = "http://unreachable.invalid:1" + env["REQUESTS_CA_BUNDLE"] = "unused-ca.pem" + with patch.dict(os.environ, env, clear=True), patch.dict("sys.modules", unavailable_modules): + credential = credential_type( + tenant_id="tenant", + client_id="client", + token_file_path=str(token_file), + enable_azure_proxy=True, + connection_verify=False, + connection_cert="unused-cert.pem", + session=object(), + session_owner=False, + transport=object(), + sni="unused.example", + token_proxy_endpoint="https://unused.example", + ca_file="unused-ca.pem", + ca_data="unused CA data", + **options, + ) + transport = credential._client._pipeline._transport + assert type(transport) is expected_type + config = transport.connection_config + assert config.timeout == options.get("connection_timeout", 300) + assert config.read_timeout == options.get("read_timeout", 300) + assert config.data_block_size == options.get("connection_data_block_size", 4096) + assert config.verify is True + assert config.cert is None + assert transport._session_owner is True + assert transport._sni == env["AZURE_KUBERNETES_SNI_NAME"] + assert transport._proxy_endpoint == server.base_url + assert transport._ca_file == server.ca_file + + if isinstance(credential, AsyncWorkloadIdentityCredential): + async with credential: + with patch.object(transport.session, "request", wraps=transport.session.request) as send: + token = await credential.get_token("https://graph.microsoft.com/.default") + assert transport.session.trust_env == options.get("use_env_settings", True) + else: + with credential: + with patch.object(transport.session, "request", wraps=transport.session.request) as send: + token = credential.get_token("https://graph.microsoft.com/.default") + assert transport.session.trust_env == options.get("use_env_settings", True) + + assert token.token + timeout = send.call_args.kwargs["timeout"] + if transport_mode == "aiohttp": + assert timeout.sock_connect == config.timeout + assert timeout.sock_read == config.read_timeout + else: + assert timeout == (config.timeout, config.read_timeout) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "options,expected_timeout", + [ + ({}, (7, 9)), + ({"connection_timeout": 11}, (11, 9)), + ({"read_timeout": 13}, (7, 13)), + ({"connection_timeout": 11, "read_timeout": 13}, (11, 13)), + ({"connection_timeout": (17, 19)}, (17, 19)), + ], +) +async def test_asyncio_requests_timeout_overrides(options, expected_timeout): + with TokenProxyTestServer() as server: + async with CustomAsyncioRequestsTransport( + ca_file=server.ca_file, connection_timeout=7, read_timeout=9, use_env_settings=False + ) as transport: + with patch.object(transport.session, "request", wraps=transport.session.request) as send: + response = await transport.send(HttpRequest("GET", server.base_url + "/health"), **options) + assert response.status_code == 200 + assert send.call_args.kwargs["timeout"] == expected_timeout + with pytest.raises(ValueError, match="Cannot set tuple connection_timeout and read_timeout together"): + await transport.send( + HttpRequest("GET", server.base_url + "/health"), connection_timeout=(17, 19), read_timeout=13 + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("credential_type", [WorkloadIdentityCredential, AsyncWorkloadIdentityCredential]) +@pytest.mark.parametrize("in_dac", [False, True]) +@pytest.mark.parametrize("in_chain", [False, True]) +async def test_proxy_selection_respects_credential_context(credential_type, in_dac, in_chain): + dac_context = within_dac.set(in_dac) + chain_context = within_credential_chain.set(in_chain) + try: + with patch.dict(os.environ, {"AZURE_KUBERNETES_TOKEN_PROXY": "https://proxy.example/binding"}, clear=True): + credential = credential_type( + tenant_id="tenant-id", + client_id="client-id", + token_file_path="token-file", + enable_azure_proxy=True, + ) + try: + transport = credential._client._pipeline._transport + assert isinstance(transport, TokenBindingTransportMixin) == (not in_dac and not in_chain) + finally: + if isinstance(credential, AsyncWorkloadIdentityCredential): + await credential.close() + else: + credential.close() + finally: + within_credential_chain.reset(chain_context) + within_dac.reset(dac_context) + + +@pytest.mark.parametrize( + "url,expected", + [ + ("https://login.example/tenant/token?q=1", "https://proxy.example/binding/tenant/token?q=1"), + ("https://proxy.example/binding/tenant/token?q=1", "https://proxy.example/binding/tenant/token?q=1"), + ("https://PROXY.example:443/binding/tenant/token", "https://PROXY.example:443/binding/tenant/token"), + ("https://proxy.example/binding", "https://proxy.example/binding"), + ("https://proxy.example/binding-other/token", "https://proxy.example/binding/binding-other/token"), + ("https://proxy.example:444/binding/token", "https://proxy.example/binding/binding/token"), + ("https://proxy.example:0/binding/token", "https://proxy.example/binding/binding/token"), + ("https://proxy.example.other/binding/token", "https://proxy.example/binding/binding/token"), + ("http://proxy.example/binding/token", "https://proxy.example/binding/binding/token"), + ], +) +def test_proxy_url_rewrite_is_idempotent(url, expected): + transport = TokenBindingTransportMixin(proxy_endpoint="https://proxy.example/binding/") + request = HttpRequest("POST", url) + transport._update_request_url(request) + assert request.url == expected + transport._update_request_url(request) + assert request.url == expected + + +def test_ca_file_atomic_replacement(tmp_path): + ca_file = tmp_path / "ca.pem" + ca_file.write_text("old CA", encoding="utf-8") + old_mtime = ca_file.stat().st_mtime + replacement = tmp_path / "replacement.pem" + replacement.write_text("new CA", encoding="utf-8") + os.utime(replacement, (old_mtime + 60, old_mtime + 60)) + original_open = open + + @contextmanager + def replace_after_read(*args, **kwargs): + with original_open(*args, **kwargs) as stream: + yield stream + os.replace(replacement, ca_file) + + with patch("builtins.open", replace_after_read): + transport = TokenBindingTransportMixin(ca_file=str(ca_file)) + + assert transport._ca_data == "old CA" + assert transport._ca_file_mtime == old_mtime + assert transport._has_ca_file_changed() + transport._load_ca_file_to_data() + assert transport._ca_data == "new CA" + assert transport._ca_file_mtime == ca_file.stat().st_mtime + assert not transport._has_ca_file_changed() + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "transport_type", [CustomRequestsTransport, CustomAioHttpTransport, CustomAsyncioRequestsTransport] +) +@pytest.mark.parametrize("proxy_path", ["", "/binding", "/binding/"]) +@pytest.mark.parametrize("recover", [True, False], ids=["recovers", "exhausted"]) +async def test_proxy_url_with_pipeline_retry(transport_type, proxy_path, recover): + paths = [] + bodies = [] + expected_path = proxy_path.rstrip("/") + "/tenant/oauth2/v2.0/token?test=1" + body = b"client_assertion=test-assertion" + + def handle_request(handler): + paths.append(handler.path) + bodies.append(handler.rfile.read(int(handler.headers["Content-Length"]))) + if handler.path != expected_path: + handler._send_json_response({"error": "wrong path"}, status_code=404) + elif len(paths) == 1 or not recover: + handler._send_json_response({"error": "temporarily unavailable"}, status_code=503) + else: + handler._send_json_response({"access_token": "test-token"}) + + with patch.object(TokenProxyHandler, "_handle_request", handle_request): + with TokenProxyTestServer() as server: + transport = transport_type( + proxy_endpoint=server.base_url + proxy_path, ca_file=server.ca_file, use_env_settings=False + ) + request = HttpRequest("POST", "https://login.example/tenant/oauth2/v2.0/token?test=1", content=body) + retry_options = {"retry_total": 1, "retry_status": 1, "retry_backoff_factor": 0} + if isinstance(transport, AsyncHttpTransport): + async with AsyncPipeline(transport, policies=[AsyncRetryPolicy(**retry_options)]) as pipeline: + response = await pipeline.run(request, retry_on_methods=["POST"]) + else: + with Pipeline(transport, policies=[RetryPolicy(**retry_options)]) as pipeline: + response = pipeline.run(request, retry_on_methods=["POST"]) + + assert response.http_response.status_code == (200 if recover else 503) + assert request.url == server.base_url + expected_path + assert paths == [expected_path, expected_path] + assert bodies == [body, body] diff --git a/sdk/identity/azure-identity/tests/test_workload_identity_credential.py b/sdk/identity/azure-identity/tests/test_workload_identity_credential.py index 6cc9816ea9d1..981825f5e787 100644 --- a/sdk/identity/azure-identity/tests/test_workload_identity_credential.py +++ b/sdk/identity/azure-identity/tests/test_workload_identity_credential.py @@ -4,12 +4,28 @@ # ------------------------------------ # cspell:ignore cafile ests import os +import tempfile +import time from unittest.mock import mock_open, MagicMock, patch import pytest -from azure.identity import WorkloadIdentityCredential +from azure.core.rest import HttpRequest +from azure.core.exceptions import ServiceRequestError, ServiceResponseError +from azure.identity import DefaultAzureCredential, WorkloadIdentityCredential +from azure.identity._credentials.workload_identity import _get_transport from helpers import mock_response, build_aad_response, GET_TOKEN_METHODS +from proxy_server import TokenProxyTestServer + + +PEM_CERT_PATH = os.path.join(os.path.dirname(__file__), "certificate.pem") + + +@pytest.fixture(scope="module") +def ca_data() -> str: + """Read CA certificate data from a PEM file for testing.""" + with open(PEM_CERT_PATH, "r", encoding="utf-8") as f: + return f.read() def test_workload_identity_credential_initialize(): @@ -46,3 +62,557 @@ def send(request, **kwargs): assert token.token == access_token open_mock.assert_called_once_with(token_file_path, encoding="utf-8") + + +class TestWorkloadIdentityCredentialTokenProxy: + """Test cases for WorkloadIdentityCredential with enable_azure_proxy=True.""" + + def test_default_credential_ignores_proxy_configuration(self): + env = { + "AZURE_TENANT_ID": "tenant-id", + "AZURE_CLIENT_ID": "client-id", + "AZURE_FEDERATED_TOKEN_FILE": "token-file", + "AZURE_TOKEN_CREDENTIALS": "WorkloadIdentityCredential", + "AZURE_KUBERNETES_TOKEN_PROXY": "https://proxy.example/binding", + } + with patch.dict(os.environ, env, clear=True): + with patch("azure.identity._credentials.workload_identity._get_transport") as get_transport: + with DefaultAzureCredential(enable_azure_proxy=True) as credential: + assert len(credential.credentials) == 1 + assert isinstance(credential.credentials[0], WorkloadIdentityCredential) + get_transport.assert_not_called() + with WorkloadIdentityCredential(enable_azure_proxy=True): + get_transport.assert_called_once() + + def test_enable_azure_proxy_creates_custom_transport(self): + """Test that enable_azure_proxy=True creates a custom transport with correct parameters.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + sni_hostname = "sni.example.com" + ca_file_path = "/path/to/ca.pem" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + "AZURE_KUBERNETES_SNI_NAME": sni_hostname, + "AZURE_KUBERNETES_CA_FILE": ca_file_path, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity._credentials.workload_identity._get_transport") as mock_get_transport: + mock_transport_instance = MagicMock() + mock_get_transport.return_value = mock_transport_instance + + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + mock_get_transport.assert_called_once_with( + sni=sni_hostname, + token_proxy_endpoint=proxy_endpoint, + ca_file=ca_file_path, + ca_data=None, + ) + + def test_enable_azure_proxy_with_ca_data(self): + """Test enable_azure_proxy with CA data instead of CA file.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + ca_data = "-----BEGIN CERTIFICATE-----\nTest CA data\n-----END CERTIFICATE-----" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + "AZURE_KUBERNETES_CA_DATA": ca_data, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity._credentials.workload_identity._get_transport") as mock_get_transport: + mock_transport_instance = MagicMock() + mock_get_transport.return_value = mock_transport_instance + + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + mock_get_transport.assert_called_once_with( + sni=None, + token_proxy_endpoint=proxy_endpoint, + ca_file=None, + ca_data=ca_data, + ) + + def test_enable_azure_proxy_minimal_config(self): + """Test enable_azure_proxy with minimal configuration (only proxy endpoint).""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity._credentials.workload_identity._get_transport") as mock_get_transport: + mock_transport_instance = MagicMock() + mock_get_transport.return_value = mock_transport_instance + + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + mock_get_transport.assert_called_once_with( + sni=None, + token_proxy_endpoint=proxy_endpoint, + ca_file=None, + ca_data=None, + ) + + def test_enable_azure_proxy_missing_proxy_endpoint(self): + """Test that enable_azure_proxy=True without proxy endpoint uses the normal transport.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + + # Ensure proxy endpoint env var is not set + with patch.dict(os.environ, {}, clear=False): + if "AZURE_KUBERNETES_TOKEN_PROXY" in os.environ: + del os.environ["AZURE_KUBERNETES_TOKEN_PROXY"] + + with patch("azure.identity._credentials.workload_identity._get_transport") as mock_get_transport: + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + mock_get_transport.assert_not_called() + + def test_enable_azure_proxy_both_ca_file_and_data_raises_error(self): + """Test that setting both CA file and CA data raises ValueError.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + ca_file_path = "/path/to/ca.pem" + ca_data = "-----BEGIN CERTIFICATE-----\nTest CA data\n-----END CERTIFICATE-----" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + "AZURE_KUBERNETES_CA_FILE": ca_file_path, + "AZURE_KUBERNETES_CA_DATA": ca_data, + } + + with patch.dict(os.environ, env_vars, clear=False): + with pytest.raises(ValueError, match="Both AZURE_KUBERNETES_CA_FILE and AZURE_KUBERNETES_CA_DATA are set"): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + def test_enable_azure_proxy_missing_endpoint_with_custom_env_vars_raises_error(self): + """Test that enable_azure_proxy=True without proxy endpoint but with other custom env vars raises ValueError.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + sni_hostname = "sni.example.com" + ca_file_path = "/path/to/ca.pem" + ca_data = "-----BEGIN CERTIFICATE-----\nTest CA data\n-----END CERTIFICATE-----" + + # Ensure proxy endpoint is not set + if "AZURE_KUBERNETES_TOKEN_PROXY" in os.environ: + del os.environ["AZURE_KUBERNETES_TOKEN_PROXY"] + + # Test with SNI set but no proxy endpoint + env_vars_sni = { + "AZURE_KUBERNETES_SNI_NAME": sni_hostname, + } + with patch.dict(os.environ, env_vars_sni, clear=False): + with pytest.raises(ValueError): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + # Test with CA file set but no proxy endpoint + env_vars_ca_file = { + "AZURE_KUBERNETES_CA_FILE": ca_file_path, + } + with patch.dict(os.environ, env_vars_ca_file, clear=False): + with pytest.raises(ValueError): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + # Test with CA data set but no proxy endpoint + env_vars_ca_data = { + "AZURE_KUBERNETES_CA_DATA": ca_data, + } + with patch.dict(os.environ, env_vars_ca_data, clear=False): + with pytest.raises(ValueError): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + def test_enable_azure_proxy_false_does_not_create_transport(self): + """Test that enable_azure_proxy=False (default) does not create a custom transport.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + + with patch("azure.identity._credentials.workload_identity._get_transport") as mock_get_transport: + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=False, + ) + mock_get_transport.assert_not_called() + + +class TestCustomRequestsTransport: + """Test cases for the custom RequestsTransport used by WorkloadIdentityCredential.""" + + def test_get_transport_creates_custom_requests_transport(self, ca_data): + """Test that _get_transport creates CustomRequestsTransport with correct parameters.""" + sni = "test.sni.com" + proxy_endpoint = "https://proxy.example.com:8080" + ca_file = PEM_CERT_PATH + + transport = _get_transport( + sni=sni, + token_proxy_endpoint=proxy_endpoint, + ca_file=ca_file, + ca_data=None, + ) + + assert transport is not None + assert hasattr(transport, "_sni") + assert hasattr(transport, "_proxy_endpoint") + assert hasattr(transport, "_ca_file") + assert hasattr(transport, "_ca_data") + assert transport._sni == sni + assert transport._proxy_endpoint == proxy_endpoint + assert transport._ca_file == ca_file + assert transport._ca_data == ca_data + + def test_get_transport_with_minimal_config(self): + """Test _get_transport with minimal configuration.""" + proxy_endpoint = "https://proxy.example.com:8080" + + transport = _get_transport( + sni=None, + token_proxy_endpoint=proxy_endpoint, + ca_file=None, + ca_data=None, + ) + + assert transport is not None + assert transport._sni is None + assert transport._proxy_endpoint == proxy_endpoint + assert transport._ca_file is None + assert transport._ca_data is None + + def test_custom_requests_transport_inherits_from_token_binding_mixin(self): + """Test that CustomRequestsTransport inherits from TokenBindingTransportMixin.""" + transport = _get_transport( + sni="test.sni.com", + token_proxy_endpoint="https://proxy.example.com:8080", + ca_file=None, + ca_data=None, + ) + + assert transport is not None + + # Verify inheritance from TokenBindingTransportMixin + from azure.identity._internal.token_binding_transport_mixin import TokenBindingTransportMixin + + assert isinstance(transport, TokenBindingTransportMixin) + + # Verify TokenBindingTransportMixin methods are available + assert hasattr(transport, "_update_request_url") + assert hasattr(transport, "_has_ca_file_changed") + assert hasattr(transport, "_load_ca_file_to_data") + assert hasattr(transport, "_validate_url") + + +class TestCustomRequestsTransportWithLocalServer: + """Integration tests using a local test server for CustomRequestsTransport.""" + + def test_basic_https_request(self): + """Test basic HTTPS request to test server.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create transport with server's CA certificate + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + request = HttpRequest("GET", f"{server.base_url}/health") + + response = transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + assert "timestamp" in data + + def test_post_request_with_body(self): + """Test POST request with request body.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + # Prepare OAuth-like request + body = "grant_type=client_credentials&scope=https://graph.microsoft.com/.default" + request = HttpRequest( + "POST", + f"{server.base_url}/tenant/oauth2/v2.0/token", + headers={"Content-Type": "application/x-www-form-urlencoded"}, + data=body.encode("utf-8"), + ) + + response = transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert "access_token" in data + assert data["token_type"] == "Bearer" + assert data["expires_in"] == 3600 + + def test_proxy_endpoint_comprehensive(self): + """Test comprehensive proxy endpoint functionality with various HTTP methods and scenarios.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Configure transport with proxy endpoint + transport = _get_transport( + sni=None, token_proxy_endpoint=server.base_url, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + + # Test 1: POST request with JSON body through proxy + post_data = {"grant_type": "client_credentials", "scope": "https://graph.microsoft.com/.default"} + post_request = HttpRequest( + "POST", + "https://login.microsoftonline.com/tenant/oauth2/v2.0/token2", + headers={"Content-Type": "application/json"}, + json=post_data, + ) + + post_response = transport.send(post_request) + assert post_response.status_code == 200 + post_data_response = post_response.json() + assert post_data_response["method"] == "POST" + assert post_data_response["proxied_path"] == "/tenant/oauth2/v2.0/token2" + + # Test 2: PUT request through proxy + put_request = HttpRequest( + "PUT", + "https://graph.microsoft.com/v1.0/me/profile", + headers={"Content-Type": "application/json"}, + json={"displayName": "Test User"}, + ) + + put_response = transport.send(put_request) + assert put_response.status_code == 200 + put_data_response = put_response.json() + assert put_data_response["method"] == "PUT" + assert put_data_response["proxied_path"] == "/v1.0/me/profile" + + # Test 3: DELETE request through proxy + delete_request = HttpRequest("DELETE", "https://graph.microsoft.com/v1.0/applications/app-id") + + delete_response = transport.send(delete_request) + assert delete_response.status_code == 200 + delete_data_response = delete_response.json() + assert delete_data_response["method"] == "DELETE" + assert delete_data_response["proxied_path"] == "/v1.0/applications/app-id" + + # Test 4: Complex URL with multiple path segments and query parameters + complex_url = "https://management.azure.com/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/account?api-version=2021-04-01&expand=properties" + complex_request = HttpRequest("GET", complex_url) + + complex_response = transport.send(complex_request) + assert complex_response.status_code == 200 + complex_data_response = complex_response.json() + assert complex_data_response["method"] == "GET" + expected_path = "/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/account?api-version=2021-04-01&expand=properties" + assert complex_data_response["proxied_path"] == expected_path + + # Test 5: Request with custom headers through proxy + headers_request = HttpRequest( + "GET", + "https://vault.azure.net/secrets/test-secret?api-version=7.3", + headers={ + "Authorization": "Bearer test-token", + "X-Custom-Header": "proxy-test-value", + "User-Agent": "Azure-SDK-For-Python", + }, + ) + + headers_response = transport.send(headers_request) + assert headers_response.status_code == 200 + headers_data_response = headers_response.json() + assert headers_data_response["method"] == "GET" + assert headers_data_response["proxied_path"] == "/secrets/test-secret?api-version=7.3" + + # Verify headers were forwarded through proxy + received_headers = headers_data_response["headers_received"] + assert "Authorization" in received_headers + assert "X-Custom-Header" in received_headers + assert received_headers["Authorization"] == "Bearer test-token" + assert received_headers["X-Custom-Header"] == "proxy-test-value" + + def test_sni_with_custom_hostname(self): + """Test SNI (Server Name Indication) with custom hostname.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Use SNI with a different hostname than the server + transport = _get_transport( + sni="1234.ests.aks", token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + + request = HttpRequest("GET", f"{server.base_url}/health") + response = transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + + # Check an invalid SNI hostname + transport = _get_transport( + sni="unmatched.sni.hostname", token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + request = HttpRequest("GET", f"{server.base_url}/health") + with pytest.raises(ServiceRequestError): + transport.send(request) + + def test_ca_file_change_detection(self): + """Test CA file change detection with real certificates.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create a copy of the CA file that we can modify + ca_file = server.ca_file + if ca_file is None: + pytest.skip("CA file not available") + + assert ca_file is not None # Type hint for mypy + with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".pem") as temp_ca: + with open(ca_file, "r") as original: + original_content = original.read() + temp_ca.write(original_content) + temp_ca_path = temp_ca.name + + try: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=temp_ca_path, ca_data=None) + assert transport is not None + + # First request should work + request = HttpRequest("GET", f"{server.base_url}/health") + response1 = transport.send(request) + assert response1.status_code == 200 + + # Modify the CA file (add some content) + time.sleep(0.1) + with open(temp_ca_path, "a") as f: + f.write("\n# Modified for testing\n") + + # Second request should still work (using the same cert content) + response2 = transport.send(request) + assert transport._ca_data != original_content + assert "Modified for testing" in transport._ca_data + assert response2.status_code == 200 + + finally: + os.unlink(temp_ca_path) + + def test_ssl_error_handling(self): + """Test SSL error handling.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create transport without proper CA file (will cause SSL error) + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=None, ca_data=None) + assert transport is not None + + request = HttpRequest("GET", f"{server.base_url}/health") + + # Should raise SSL-related error + with pytest.raises((ServiceRequestError, ServiceResponseError)): + transport.send(request) + + def test_server_error_response(self): + """Test handling of server error responses.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + request = HttpRequest("GET", f"{server.base_url}/error/500") + + response = transport.send(request) + + assert response.status_code == 500 + # Should not raise exception, just return error response + + def test_custom_headers_preserved(self): + """Test that custom headers are preserved and sent to server.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + custom_headers = { + "Authorization": "Bearer test-token", + "User-Agent": "CustomRequestsTransport/1.0", + "X-Custom-Header": "test-value", + } + + request = HttpRequest("GET", f"{server.base_url}/proxy/test", headers=custom_headers) + + response = transport.send(request) + + assert response.status_code == 200 + data = response.json() + + # Server echoes back the headers it received + received_headers = data["headers_received"] + assert "Authorization" in received_headers + assert "User-Agent" in received_headers + assert "X-Custom-Header" in received_headers + assert received_headers["Authorization"] == "Bearer test-token" + + def test_query_parameters_preserved(self): + """Test that query parameters are preserved in proxy requests.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport( + sni=None, token_proxy_endpoint=server.base_url, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + + # Request with query parameters + original_url = "https://example.com/api/data?scope=read&limit=10&format=json" + request = HttpRequest("GET", original_url) + + response = transport.send(request) + + assert response.status_code == 200 + data = response.json() + + # The path should include the query parameters + expected_path = "/api/data?scope=read&limit=10&format=json" + assert data["proxied_path"] == expected_path diff --git a/sdk/identity/azure-identity/tests/test_workload_identity_credential_async.py b/sdk/identity/azure-identity/tests/test_workload_identity_credential_async.py index 65b5b6f21426..299fae0e87ab 100644 --- a/sdk/identity/azure-identity/tests/test_workload_identity_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_workload_identity_credential_async.py @@ -4,12 +4,33 @@ # ------------------------------------ # cspell:ignore cafile aexit ests import os +import tempfile +import time +import asyncio +from time import sleep as real_sleep from unittest.mock import mock_open, patch, MagicMock +from aiohttp import ClientSession import pytest -from azure.identity.aio import WorkloadIdentityCredential +from azure.core.rest import HttpRequest +from azure.core.exceptions import ServiceRequestError, ServiceResponseError +from azure.identity.aio import DefaultAzureCredential, WorkloadIdentityCredential +from azure.identity.aio._credentials.workload_identity import _get_transport +from azure.identity.aio._internal.token_binding_transport_aiohttp import CustomAioHttpTransport +from azure.identity.aio._internal.token_binding_transport_asyncio import CustomAsyncioRequestsTransport from helpers import mock_response, build_aad_response, GET_TOKEN_METHODS +from proxy_server import TokenProxyTestServer + + +PEM_CERT_PATH = os.path.join(os.path.dirname(__file__), "certificate.pem") + + +@pytest.fixture(scope="module") +def ca_data() -> str: + """Read CA certificate data from a PEM file for testing.""" + with open(PEM_CERT_PATH, "r", encoding="utf-8") as f: + return f.read() def test_workload_identity_credential_initialize(): @@ -47,3 +68,867 @@ async def send(request, **kwargs): assert token.token == access_token open_mock.assert_called_once_with(token_file_path, encoding="utf-8") + + +class TestWorkloadIdentityCredentialTokenProxyAsync: + """Async test cases for WorkloadIdentityCredential with enable_azure_proxy=True.""" + + @pytest.mark.asyncio + async def test_default_credential_ignores_proxy_configuration(self): + env = { + "AZURE_TENANT_ID": "tenant-id", + "AZURE_CLIENT_ID": "client-id", + "AZURE_FEDERATED_TOKEN_FILE": "token-file", + "AZURE_TOKEN_CREDENTIALS": "WorkloadIdentityCredential", + "AZURE_KUBERNETES_TOKEN_PROXY": "https://proxy.example/binding", + } + with patch.dict(os.environ, env, clear=True): + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as get_transport: + async with DefaultAzureCredential(enable_azure_proxy=True) as credential: + assert len(credential.credentials) == 1 + assert isinstance(credential.credentials[0], WorkloadIdentityCredential) + get_transport.assert_not_called() + async with WorkloadIdentityCredential(enable_azure_proxy=True): + get_transport.assert_called_once() + + def test_enable_azure_proxy_creates_custom_aiohttp_transport(self): + """Test that enable_azure_proxy=True creates a custom aiohttp transport with correct parameters.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + sni_hostname = "sni.example.com" + ca_file_path = "/path/to/ca.pem" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + "AZURE_KUBERNETES_SNI_NAME": sni_hostname, + "AZURE_KUBERNETES_CA_FILE": ca_file_path, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as mock_get_transport: + mock_transport_instance = MagicMock() + mock_get_transport.return_value = mock_transport_instance + + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + mock_get_transport.assert_called_once_with( + sni=sni_hostname, + token_proxy_endpoint=proxy_endpoint, + ca_file=ca_file_path, + ca_data=None, + ) + + def test_enable_azure_proxy_with_ca_data(self): + """Test enable_azure_proxy with CA data instead of CA file.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + ca_data = "-----BEGIN CERTIFICATE-----\nTest CA data\n-----END CERTIFICATE-----" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + "AZURE_KUBERNETES_CA_DATA": ca_data, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as mock_get_transport: + mock_transport_instance = MagicMock() + mock_get_transport.return_value = mock_transport_instance + + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + mock_get_transport.assert_called_once_with( + sni=None, + token_proxy_endpoint=proxy_endpoint, + ca_file=None, + ca_data=ca_data, + ) + + def test_enable_azure_proxy_minimal_config(self): + """Test enable_azure_proxy with minimal configuration (only proxy endpoint).""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as mock_get_transport: + mock_transport_instance = MagicMock() + mock_get_transport.return_value = mock_transport_instance + + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + mock_get_transport.assert_called_once_with( + sni=None, + token_proxy_endpoint=proxy_endpoint, + ca_file=None, + ca_data=None, + ) + + def test_enable_azure_proxy_missing_proxy_endpoint(self): + """Test that enable_azure_proxy=True without proxy endpoint uses the normal transport.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + + # Ensure proxy endpoint env var is not set + with patch.dict(os.environ, {}, clear=False): + if "AZURE_KUBERNETES_TOKEN_PROXY" in os.environ: + del os.environ["AZURE_KUBERNETES_TOKEN_PROXY"] + + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as mock_get_transport: + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + mock_get_transport.assert_not_called() + + def test_enable_azure_proxy_both_ca_file_and_data_raises_error(self): + """Test that setting both CA file and CA data raises ValueError.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + proxy_endpoint = "https://proxy.example.com:8080" + ca_file_path = "/path/to/ca.pem" + ca_data = "-----BEGIN CERTIFICATE-----\nTest CA data\n-----END CERTIFICATE-----" + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + "AZURE_KUBERNETES_CA_FILE": ca_file_path, + "AZURE_KUBERNETES_CA_DATA": ca_data, + } + + with patch.dict(os.environ, env_vars, clear=False): + with pytest.raises(ValueError, match="Both AZURE_KUBERNETES_CA_FILE and AZURE_KUBERNETES_CA_DATA are set"): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + def test_enable_azure_proxy_missing_endpoint_with_custom_env_vars_raises_error(self): + """Test that enable_azure_proxy=True without proxy endpoint but with other custom env vars raises ValueError.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + sni_hostname = "sni.example.com" + ca_file_path = "/path/to/ca.pem" + ca_data = "-----BEGIN CERTIFICATE-----\nTest CA data\n-----END CERTIFICATE-----" + + # Ensure proxy endpoint is not set + if "AZURE_KUBERNETES_TOKEN_PROXY" in os.environ: + del os.environ["AZURE_KUBERNETES_TOKEN_PROXY"] + + # Test with SNI set but no proxy endpoint + env_vars_sni = { + "AZURE_KUBERNETES_SNI_NAME": sni_hostname, + } + with patch.dict(os.environ, env_vars_sni, clear=False): + with pytest.raises(ValueError): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + # Test with CA file set but no proxy endpoint + env_vars_ca_file = { + "AZURE_KUBERNETES_CA_FILE": ca_file_path, + } + with patch.dict(os.environ, env_vars_ca_file, clear=False): + with pytest.raises(ValueError): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + # Test with CA data set but no proxy endpoint + env_vars_ca_data = { + "AZURE_KUBERNETES_CA_DATA": ca_data, + } + with patch.dict(os.environ, env_vars_ca_data, clear=False): + with pytest.raises(ValueError): + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + @pytest.mark.asyncio + @pytest.mark.parametrize("get_token_method", GET_TOKEN_METHODS) + async def test_enable_azure_proxy_get_token_success(self, get_token_method): + """Test successful token acquisition when using token proxy.""" + tenant_id = "tenant-id" + client_id = "client-id" + access_token = "foo-access-token" + token_file_path = "foo-path" + assertion = "foo-assertion" + proxy_endpoint = "https://proxy.example.com:8080" + + async def send(request, **kwargs): + assert "claims" not in kwargs + assert "tenant_id" not in kwargs + assert request.data.get("client_assertion") == assertion + return mock_response(json_payload=build_aad_response(access_token=access_token)) + + mock_transport_instance = MagicMock(send=send) + + env_vars = { + "AZURE_KUBERNETES_TOKEN_PROXY": proxy_endpoint, + } + + with patch.dict(os.environ, env_vars, clear=False): + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as mock_get_transport: + mock_get_transport.return_value = mock_transport_instance + + credential = WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=True, + ) + + open_mock = mock_open(read_data=assertion) + with patch("builtins.open", open_mock): + token = await getattr(credential, get_token_method)("scope") + assert token.token == access_token + + open_mock.assert_called_once_with(token_file_path, encoding="utf-8") + + def test_enable_azure_proxy_false_does_not_create_transport(self): + """Test that enable_azure_proxy=False (default) does not create a custom transport.""" + tenant_id = "tenant-id" + client_id = "client-id" + token_file_path = "foo-path" + + with patch("azure.identity.aio._credentials.workload_identity._get_transport") as mock_get_transport: + WorkloadIdentityCredential( + tenant_id=tenant_id, + client_id=client_id, + token_file_path=token_file_path, + enable_azure_proxy=False, + ) + mock_get_transport.assert_not_called() + + +class TestCustomAioHttpTransport: + """Test cases for the custom AioHttpTransport used by WorkloadIdentityCredential.""" + + def test_get_transport_creates_workload_identity_aiohttp_transport(self, ca_data): + """Test that _get_transport creates WorkloadIdentityAioHttpTransport with correct parameters.""" + sni = "test.sni.com" + proxy_endpoint = "https://proxy.example.com:8080" + ca_file = PEM_CERT_PATH + + transport = _get_transport( + sni=sni, + token_proxy_endpoint=proxy_endpoint, + ca_file=ca_file, + ca_data=None, + ) + + assert type(transport) is CustomAioHttpTransport + assert hasattr(transport, "_sni") + assert hasattr(transport, "_proxy_endpoint") + assert hasattr(transport, "_ca_file") + assert hasattr(transport, "_ca_data") + assert transport._sni == sni + assert transport._proxy_endpoint == proxy_endpoint + assert transport._ca_file == ca_file + assert transport._ca_data == ca_data + + assert hasattr(transport, "_ssl_context") + assert transport._ssl_context is not None + + def test_get_transport_with_minimal_config(self): + """Test _get_transport with minimal configuration.""" + proxy_endpoint = "https://proxy.example.com:8080" + + transport = _get_transport( + sni=None, + token_proxy_endpoint=proxy_endpoint, + ca_file=None, + ca_data=None, + ) + + assert transport is not None + assert transport._sni is None + assert transport._proxy_endpoint == proxy_endpoint + assert transport._ca_file is None + assert transport._ca_data is None + + assert hasattr(transport, "_ssl_context") + assert transport._ssl_context is not None + + def test_workload_identity_aiohttp_transport_inherits_from_token_binding_mixin(self): + """Test that WorkloadIdentityAioHttpTransport inherits from TokenBindingTransportMixin.""" + transport = _get_transport( + sni="test.sni.com", + token_proxy_endpoint="https://proxy.example.com:8080", + ca_file=None, + ca_data=None, + ) + + assert transport is not None + + # Verify inheritance from TokenBindingTransportMixin + from azure.identity._internal.token_binding_transport_mixin import TokenBindingTransportMixin + + assert isinstance(transport, TokenBindingTransportMixin) + + # Verify TokenBindingTransportMixin methods are available + assert hasattr(transport, "_update_request_url") + assert hasattr(transport, "_has_ca_file_changed") + assert hasattr(transport, "_load_ca_file_to_data") + assert hasattr(transport, "_validate_url") + + +class TestCustomAioHttpTransportWithLocalServer: + """Integration tests using a local test server for WorkloadIdentityAioHttpTransport.""" + + @pytest.mark.asyncio + async def test_basic_https_request(self): + """Test basic HTTPS request to test server.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create transport with server's CA certificate + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + request = HttpRequest("GET", f"{server.base_url}/health") + + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + assert "timestamp" in data + + @pytest.mark.asyncio + async def test_post_request_with_body(self): + """Test POST request with request body.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + # Prepare OAuth-like request + body = "grant_type=client_credentials&scope=https://graph.microsoft.com/.default" + request = HttpRequest( + "POST", + f"{server.base_url}/tenant/oauth2/v2.0/token", + headers={"Content-Type": "application/x-www-form-urlencoded"}, + data=body.encode("utf-8"), + ) + + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert "access_token" in data + assert data["token_type"] == "Bearer" + assert data["expires_in"] == 3600 + + @pytest.mark.asyncio + async def test_proxy_endpoint_comprehensive(self): + """Test comprehensive proxy endpoint functionality with various HTTP methods and scenarios.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Configure transport with proxy endpoint + transport = _get_transport( + sni=None, token_proxy_endpoint=server.base_url, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + + # Test 1: POST request with JSON body through proxy + post_data = {"grant_type": "client_credentials", "scope": "https://graph.microsoft.com/.default"} + post_request = HttpRequest( + "POST", + "https://login.microsoftonline.com/tenant/oauth2/v2.0/token2", + headers={"Content-Type": "application/json"}, + json=post_data, + ) + + post_response = await transport.send(post_request) + assert post_response.status_code == 200 + post_data_response = post_response.json() + assert post_data_response["method"] == "POST" + assert post_data_response["proxied_path"] == "/tenant/oauth2/v2.0/token2" + + # Test 2: PUT request through proxy + put_request = HttpRequest( + "PUT", + "https://graph.microsoft.com/v1.0/me/profile", + headers={"Content-Type": "application/json"}, + json={"displayName": "Test User"}, + ) + + put_response = await transport.send(put_request) + assert put_response.status_code == 200 + put_data_response = put_response.json() + assert put_data_response["method"] == "PUT" + assert put_data_response["proxied_path"] == "/v1.0/me/profile" + + # Test 3: DELETE request through proxy + delete_request = HttpRequest("DELETE", "https://graph.microsoft.com/v1.0/applications/app-id") + + delete_response = await transport.send(delete_request) + assert delete_response.status_code == 200 + delete_data_response = delete_response.json() + assert delete_data_response["method"] == "DELETE" + assert delete_data_response["proxied_path"] == "/v1.0/applications/app-id" + + # Test 4: Complex URL with multiple path segments and query parameters + complex_url = "https://management.azure.com/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/account?api-version=2021-04-01&expand=properties" + complex_request = HttpRequest("GET", complex_url) + + complex_response = await transport.send(complex_request) + assert complex_response.status_code == 200 + complex_data_response = complex_response.json() + assert complex_data_response["method"] == "GET" + expected_path = "/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/account?api-version=2021-04-01&expand=properties" + assert complex_data_response["proxied_path"] == expected_path + + # Test 5: Request with custom headers through proxy + headers_request = HttpRequest( + "GET", + "https://vault.azure.net/secrets/test-secret?api-version=7.3", + headers={ + "Authorization": "Bearer test-token", + "X-Custom-Header": "proxy-test-value", + "User-Agent": "Azure-SDK-For-Python", + }, + ) + + headers_response = await transport.send(headers_request) + assert headers_response.status_code == 200 + headers_data_response = headers_response.json() + assert headers_data_response["method"] == "GET" + assert headers_data_response["proxied_path"] == "/secrets/test-secret?api-version=7.3" + + # Verify headers were forwarded through proxy + received_headers = headers_data_response["headers_received"] + assert "Authorization" in received_headers + assert "X-Custom-Header" in received_headers + assert received_headers["Authorization"] == "Bearer test-token" + assert received_headers["X-Custom-Header"] == "proxy-test-value" + + @pytest.mark.asyncio + async def test_sni_with_custom_hostname(self): + """Test SNI (Server Name Indication) with custom hostname.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Use SNI with a different hostname than the server + transport = _get_transport( + sni="1234.ests.aks", token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + + request = HttpRequest("GET", f"{server.base_url}/health") + + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + + transport = _get_transport( + sni="unmatched.sni.hostname", token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + request = HttpRequest("GET", f"{server.base_url}/health") + with pytest.raises(ServiceRequestError): + await transport.send(request) + + @pytest.mark.asyncio + async def test_ca_file_change_detection(self): + """Test CA file change detection with real certificates.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create a copy of the CA file that we can modify + ca_file = server.ca_file + if ca_file is None: + pytest.skip("CA file not available") + + assert ca_file is not None # Type hint for mypy + with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".pem") as temp_ca: + with open(ca_file, "r") as original: + original_content = original.read() + temp_ca.write(original_content) + temp_ca_path = temp_ca.name + + try: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=temp_ca_path, ca_data=None) + assert transport is not None + + # First request should work + request = HttpRequest("GET", f"{server.base_url}/health") + response1 = await transport.send(request) + assert response1.status_code == 200 + + # Modify the CA file (add some content) + real_sleep(0.1) + with open(temp_ca_path, "a") as f: + f.write("\n# Modified for testing\n") + + # Second request should still work (using the same cert content) + response2 = await transport.send(request) + assert transport._ca_data != original_content + assert response2.status_code == 200 + + finally: + os.unlink(temp_ca_path) + + @pytest.mark.asyncio + async def test_ssl_error_handling(self): + """Test SSL error handling.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create transport without proper CA file (will cause SSL error) + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=None, ca_data=None) + assert transport is not None + + request = HttpRequest("GET", f"{server.base_url}/health") + + # Should raise SSL-related error + with pytest.raises((ServiceRequestError, ServiceResponseError)): + await transport.send(request) + + @pytest.mark.asyncio + async def test_server_error_response(self): + """Test handling of server error responses.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + request = HttpRequest("GET", f"{server.base_url}/error/500") + + response = await transport.send(request) + + assert response.status_code == 500 + # Should not raise exception, just return error response + + @pytest.mark.asyncio + async def test_custom_headers_preserved(self): + """Test that custom headers are preserved and sent to server.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + custom_headers = { + "Authorization": "Bearer test-token", + "User-Agent": "WorkloadIdentityAioHttpTransport/1.0", + "X-Custom-Header": "test-value", + } + + request = HttpRequest("GET", f"{server.base_url}/proxy/test", headers=custom_headers) + + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + + # Server echoes back the headers it received + received_headers = data["headers_received"] + assert "Authorization" in received_headers + assert "User-Agent" in received_headers + assert "X-Custom-Header" in received_headers + assert received_headers["Authorization"] == "Bearer test-token" + + @pytest.mark.asyncio + async def test_query_parameters_preserved(self): + """Test that query parameters are preserved in proxy requests.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport( + sni=None, token_proxy_endpoint=server.base_url, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + + # Request with query parameters + original_url = "https://example.com/api/data?scope=read&limit=10&format=json" + request = HttpRequest("GET", original_url) + + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + + # The path should include the query parameters + expected_path = "/api/data?scope=read&limit=10&format=json" + assert data["proxied_path"] == expected_path + + @pytest.mark.asyncio + async def test_concurrent_requests(self): + """Test handling multiple concurrent requests.""" + with TokenProxyTestServer(use_ssl=True) as server: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert transport is not None + + async def make_request(request_id): + request = HttpRequest("GET", f"{server.base_url}/health") + response = await transport.send(request) + return request_id, response.status_code, response.json() + + # Make 5 concurrent requests + tasks = [make_request(i) for i in range(5)] + results = await asyncio.gather(*tasks) + + # All requests should succeed + assert len(results) == 5 + for request_id, status_code, data in results: + assert status_code == 200 + assert data["status"] == "healthy" + + +class TestCustomAsyncioRequestsTransportFallback: + """Test cases for the custom AsyncioRequestsTransport used by WorkloadIdentityCredential.""" + + @pytest.mark.asyncio + @pytest.mark.parametrize("supports_sni", [False, True]) + @pytest.mark.parametrize("sni", [None, "test.sni.com"]) + async def test_transport_selection_checks_server_hostname_support(self, supports_sni, sni, ca_data): + async def request_without_sni(self, method, url): + raise AssertionError("Transport selection must not send requests") + + async def request_with_sni(self, method, url, *, server_hostname=None): + raise AssertionError("Transport selection must not send requests") + + request_method = request_with_sni if supports_sni else request_without_sni + with patch.object(ClientSession, "_request", request_method): + transport = _get_transport( + sni=sni, + token_proxy_endpoint="https://proxy.example.com/binding", + ca_file=None, + ca_data=ca_data, + ) + + async with transport: + expected_type = CustomAioHttpTransport if supports_sni else CustomAsyncioRequestsTransport + assert type(transport) is expected_type + assert transport._sni == sni + assert transport._proxy_endpoint == "https://proxy.example.com/binding" + assert transport._ca_data == ca_data + + @pytest.mark.asyncio + async def test_transport_selection_without_aiohttp(self): + with patch.dict("sys.modules", {"aiohttp": None}): + transport = _get_transport( + sni=None, + token_proxy_endpoint="https://proxy.example.com/binding", + ca_file=None, + ca_data=None, + ) + + async with transport: + assert type(transport) is CustomAsyncioRequestsTransport + + def test_get_transport_creates_workload_identity_asyncio_requests_transport(self, ca_data): + """Test that _get_transport creates WorkloadIdentityAsyncioRequestsTransport with correct parameters.""" + sni = "test.sni.com" + proxy_endpoint = "https://proxy.example.com:8080" + ca_file = PEM_CERT_PATH + + with patch.dict("sys.modules", {"azure.identity.aio._internal.token_binding_transport_aiohttp": None}): + transport = _get_transport( + sni=sni, + token_proxy_endpoint=proxy_endpoint, + ca_file=ca_file, + ca_data=None, + ) + + assert type(transport) is CustomAsyncioRequestsTransport + assert hasattr(transport, "_sni") + assert hasattr(transport, "_proxy_endpoint") + assert hasattr(transport, "_ca_file") + assert hasattr(transport, "_ca_data") + assert transport._sni == sni + assert transport._proxy_endpoint == proxy_endpoint + assert transport._ca_file == ca_file + assert transport._ca_data == ca_data + + @pytest.mark.asyncio + async def test_basic_https_request(self): + """Test basic HTTPS request to test server.""" + with TokenProxyTestServer(use_ssl=True) as server: + # Create transport with server's CA certificate + with patch.dict("sys.modules", {"azure.identity.aio._internal.token_binding_transport_aiohttp": None}): + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None) + assert type(transport) is CustomAsyncioRequestsTransport + request = HttpRequest("GET", f"{server.base_url}/health") + + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + assert "timestamp" in data + + @pytest.mark.asyncio + async def test_proxy_endpoint_comprehensive(self): + """Test comprehensive proxy endpoint functionality with various HTTP methods and scenarios.""" + with TokenProxyTestServer(use_ssl=True) as server: + with patch.dict("sys.modules", {"azure.identity.aio._internal.token_binding_transport_aiohttp": None}): + transport = _get_transport( + sni=None, token_proxy_endpoint=server.base_url, ca_file=server.ca_file, ca_data=None + ) + assert type(transport) is CustomAsyncioRequestsTransport + + # Test 1: POST request with JSON body through proxy + post_data = {"grant_type": "client_credentials", "scope": "https://graph.microsoft.com/.default"} + post_request = HttpRequest( + "POST", + "https://login.microsoftonline.com/tenant/oauth2/v2.0/token2", + headers={"Content-Type": "application/json"}, + json=post_data, + ) + + post_response = await transport.send(post_request) + assert post_response.status_code == 200 + post_data_response = post_response.json() + assert post_data_response["method"] == "POST" + assert post_data_response["proxied_path"] == "/tenant/oauth2/v2.0/token2" + + # Test 2: PUT request through proxy + put_request = HttpRequest( + "PUT", + "https://graph.microsoft.com/v1.0/me/profile", + headers={"Content-Type": "application/json"}, + json={"displayName": "Test User"}, + ) + + put_response = await transport.send(put_request) + assert put_response.status_code == 200 + put_data_response = put_response.json() + assert put_data_response["method"] == "PUT" + assert put_data_response["proxied_path"] == "/v1.0/me/profile" + + # Test 3: DELETE request through proxy + delete_request = HttpRequest("DELETE", "https://graph.microsoft.com/v1.0/applications/app-id") + + delete_response = await transport.send(delete_request) + assert delete_response.status_code == 200 + delete_data_response = delete_response.json() + assert delete_data_response["method"] == "DELETE" + assert delete_data_response["proxied_path"] == "/v1.0/applications/app-id" + + # Test 4: Complex URL with multiple path segments and query parameters + complex_url = "https://management.azure.com/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/account?api-version=2021-04-01&expand=properties" + complex_request = HttpRequest("GET", complex_url) + + complex_response = await transport.send(complex_request) + assert complex_response.status_code == 200 + complex_data_response = complex_response.json() + assert complex_data_response["method"] == "GET" + expected_path = "/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/account?api-version=2021-04-01&expand=properties" + assert complex_data_response["proxied_path"] == expected_path + + # Test 5: Request with custom headers through proxy + headers_request = HttpRequest( + "GET", + "https://vault.azure.net/secrets/test-secret?api-version=7.3", + headers={ + "Authorization": "Bearer test-token", + "X-Custom-Header": "proxy-test-value", + "User-Agent": "Azure-SDK-For-Python", + }, + ) + + headers_response = await transport.send(headers_request) + assert headers_response.status_code == 200 + headers_data_response = headers_response.json() + assert headers_data_response["method"] == "GET" + assert headers_data_response["proxied_path"] == "/secrets/test-secret?api-version=7.3" + + # Verify headers were forwarded through proxy + received_headers = headers_data_response["headers_received"] + assert "Authorization" in received_headers + assert "X-Custom-Header" in received_headers + assert received_headers["Authorization"] == "Bearer test-token" + assert received_headers["X-Custom-Header"] == "proxy-test-value" + + @pytest.mark.asyncio + async def test_sni_with_custom_hostname(self): + """Test SNI (Server Name Indication) with custom hostname.""" + with TokenProxyTestServer(use_ssl=True) as server: + with patch.dict("sys.modules", {"azure.identity.aio._internal.token_binding_transport_aiohttp": None}): + # Use SNI with a different hostname than the server + transport = _get_transport( + sni="1234.ests.aks", token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None + ) + assert type(transport) is CustomAsyncioRequestsTransport + + request = HttpRequest("GET", f"{server.base_url}/health") + response = await transport.send(request) + + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + + # Check an invalid SNI hostname + transport = _get_transport( + sni="unmatched.sni.hostname", token_proxy_endpoint=None, ca_file=server.ca_file, ca_data=None + ) + assert transport is not None + request = HttpRequest("GET", f"{server.base_url}/health") + with pytest.raises(ServiceRequestError): + await transport.send(request) + + @pytest.mark.asyncio + async def test_ca_file_change_detection(self): + """Test CA file change detection with real certificates.""" + with TokenProxyTestServer(use_ssl=True) as server: + with patch.dict("sys.modules", {"azure.identity.aio._internal.token_binding_transport_aiohttp": None}): + # Create a copy of the CA file that we can modify + ca_file = server.ca_file + if ca_file is None: + pytest.skip("CA file not available") + + assert ca_file is not None # Type hint for mypy + with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".pem") as temp_ca: + with open(ca_file, "r") as original: + original_content = original.read() + temp_ca.write(original_content) + temp_ca_path = temp_ca.name + + try: + transport = _get_transport(sni=None, token_proxy_endpoint=None, ca_file=temp_ca_path, ca_data=None) + assert type(transport) is CustomAsyncioRequestsTransport + + # First request should work + request = HttpRequest("GET", f"{server.base_url}/health") + response1 = await transport.send(request) + assert response1.status_code == 200 + + # Modify the CA file (add some content) + real_sleep(0.1) + with open(temp_ca_path, "a") as f: + f.write("\n# Modified for testing\n") + + # Second request should still work (using the same cert content) + response2 = await transport.send(request) + assert transport._ca_data != original_content + assert response2.status_code == 200 + + finally: + os.unlink(temp_ca_path)